|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Attribute List
Hi Carmelo,
I tried this example..
XML file -
<root>
<term a="1" b="2">
<term c="3" d="4">
<term e="5" f="6">
<x/>
</term>
</term>
</term>
</root>
XSL file -
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" />
<xsl:template match="/root">
<xsl:variable name = "allAttributes" select =
"descendant::term/@*"/>
<xsl:for-each select="$allAttributes">
<xsl:value-of select="name()" /> , <xsl:value-of
select="." /><xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The output produced is -
a , 1
b , 2
c , 3
d , 4
e , 5
f , 6
So descendant::term/@* "does lists" all attributes of
all descendant "term" elements.
If you can show rest of your code, and tell the exact
problem you are solving(with input XML and the desired
output), someone might suggest the right approach.
Regards,
Mukul
--- Carmelo Montanez <carmelo@xxxxxxxx> wrote:
> All:
>
> I would think that this statement will select all of
> the attributes of the
> descendant "term" elements of the context node.
>
> <xsl:variable name = "allAttributes" select =
> "descendant::term/@*"/>
>
> Instead is only selecting the attribute of the FIRST
> "term" node. What I
> am missing?. I just want a list of all Attributes
> of all descendant "term"
> elements.
>
> Thanks
> Carmelo
>
>
__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








