Subject: Re: Outputting dynamically
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Wed, 6 Nov 2002 15:22:45 -0000
|
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
|