|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl attribute value
Hi
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<?xml-stylesheet type='text/xsl' href='../old/test.xsl' ?>
<Report>
<Group>
<GroupValue type='PO'>PO0005</GroupValue>
</Group>
<Group>
<GroupValue type='SUPPLIER'>Supplier One</GroupValue>
</Group>
</Report>In the above XML exmple I am trying to generate the following output :- PO = PO0005 SUPPLIER = Supplier One I am using the following xslt. <?xml version="1.0" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/Report">
<xsl:for-each select="Group">
<xsl:value-of select="GroupValue[@type]" /> =
<xsl:value-of select="GroupValue" /><br />
</xsl:for-each>
</xsl:template></xsl:stylesheet> This is generating the following output :- PO0005 = PO0005 Supplier One = Supplier One Basically it is not printing the vlue of attribute 'type'. When I chnge the XSLT as follows :- <xsl:template match="/Report">
<xsl:for-each select="Group/GroupValue">
<xsl:value-of select="@type" /> =
<xsl:value-of select="." /><br />
</xsl:for-each>
</xsl:template>Then it works. But my requirement is to print attribute value if the current node is <Group>. Any suggestion? Thanks. Arun _________________________________________________________________ Yantras for power and success. Yantras for peace and joy. http://www.astroyogi.com/NewMsn/astroshopping/yantra/ Yantras that change your life.
|
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








