How to get the attribute name from xml using xslt
-
Hai, i want to get the attribute names from the xml using xslt... my xml is: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?> <!-- Edited by XMLSpy® --> <catalog> <cd select="true"> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd select="true"> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>UK</country> <company>CBS Records</company> <price>9.90</price> <year>1988</year> </cd> </catalog> Now i want to get the value select equal to true or false.. Any one help me.... Regards, Subbu.H
-
Hai, i want to get the attribute names from the xml using xslt... my xml is: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?> <!-- Edited by XMLSpy® --> <catalog> <cd select="true"> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd select="true"> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>UK</country> <company>CBS Records</company> <price>9.90</price> <year>1988</year> </cd> </catalog> Now i want to get the value select equal to true or false.. Any one help me.... Regards, Subbu.H
H.Subbulakshmi wrote:
i want to get the attribute names from the xml using xslt
H.Subbulakshmi wrote:
Now i want to get the value select equal to true or false..
I don't know what that means but the following XSLT will render the names of all the attributes that have the value
true
<xsl:for-each select="//*/@*[.='true']">
<p>
<xsl:value-of select="name()"/>
</p>
</xsl:for-each>led mike