[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Outputting dynamically

Subject: Re: Outputting dynamically
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 6 Nov 2002 15:09:32 GMT
Re:  Outputting dynamically
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.