ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
Re: [xsl] Outputting dynamically
by David Carlisle other posts by this author
Nov 6 2002 3:09PM messages near this date
Re: [xsl] Outputting dynamically | RE: [xsl] Problem With Different Colors for Alternate Rows
Your desription isn't very clear...


>  I want to ouput only these
>  attributes being passed.
>  Any suggestions, 

You can't _just_ output attributes, do you mean that you want
an identity transform, but just don't copy attributes not in the
supplied list so in your example the output would be 

<customer> 
  <order> 
     <orderdet> 
       <item itemid="145" desc="hammer"/> 
       <item itemid="145" desc="nails"/> 
     </orderdet> 
  </order> 
</customer> 

as itemid and desc attributes get copied but id and qty do not?

if so take the identity transform example from the xslt spec and add
the template

<xsl:template match="@*" priority="10"> 
 <xsl:if test="contains(concat('|',$attr,'|'),concat('|',name(),'|'))"> 
  <xsl:copy-of select="."/> 
 </xsl:if> 
</xsl:template> 

then your 

<xsl:param name="attr" select"'itemid|desc'"/> 


should work.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
Thread:
Juan Carlos Gonzalez
Vasu Chakkera
David Carlisle

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved