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

Re: Outputting dynamically

Subject: Re: Outputting dynamically
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Wed, 6 Nov 2002 15:22:45 -0000
substring before node
Hi Juan,
With your > <xsl:param name="attr" select"'itemid|desc'"/>,
i assume that you want to select the attributes itemid "or" desc.
 In which case, for the following code, you would get an output:
145
hammer
145
nails

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="node-names" select="'itemid|desc'"/>
<xsl:template match="/">
<xsl:variable name="attr1" select="substring-before($node-names,'|')"/>
<xsl:variable name="attr2" select="substring-after($node-names,'|')"/>
<xsl:for-each select="//@*[name() = $attr1 or name() = $attr2]">
<xsl:value-of select="."/><br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

HTH
Vasu
----- Original Message -----
From: "Juan Carlos Gonzalez" <jcgonz@xxxxxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, November 06, 2002 2:35 PM
Subject:  Outputting dynamically


> Hi:
>
> I want to pass the node attributes name as an
> parameter to the XSLT file to transform a XML file.
> For example:
>
> <customer id="1">
>   <order id="122" >
>      <orderdet date="12/12/02">
>        <item itemid="145" desc="hammer" qty="2"/>
>        <item itemid="145" desc="nails" qty="6"/>
>      </orderdet>
>   </order>
> </customer>
>
> Then I would have in the XSLT file something like or
> if someone can come with a better idea:
>
> <xsl:param name="attr" select"'itemid|desc'"/>
>
> and based on that I want to ouput only these
> attributes being passed.
> Any suggestions,
> thanks.
>
> __________________________________________________
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
> http://hotjobs.yahoo.com/
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>

 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.