This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Getting Attribute names in an XML with XSLT stylesheet


Is there any provisions to explicitly display the attribute name of an XML 
element. It's easy to get an attribute value (knowing or w/o knowing 
attribute name) but I could not find any easy way to get the name of an 
attribute (FYI, I don't know attribute name existing in a XML element, 
beforehand)
For example, consider an XML element,
  <CurrentStatus
	ServiceHealth="Available"/>
  I wanna display the attribute name (ie ServiceHealth) by means of XPath in 
XSLT stylesheet. I used XSLT segment,

     <xsl:template match="CurrentStatus">
       <td>
       <xsl:apply-templates select="@*"/>
       </td>
    </xsl:template>
     <xsl:template match="@*">
           <xsl:value-of select="."/>
    </xsl:template>
    but this displays only attribute's value not it's name.

   any help?
thanks,
-Morgan


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]