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]

RE: is there a generic way to iterate through all attributes of a tag.


You can use @* or attribute::*

ex. <xsl:for-each select="@*">
will loop through all the attributes of the current node.

for what you sound like you are doing, it may be better to call a template
to process attributes -

  <xsl:template match="*">
    tag: <xsl:value-of select="name()"/>
    <xsl:apply-templates select="@*"/>
    value: <xsl:value-of select="."/>
  </xsl:template>

  <xsl:template match="@*">
    attribute: <xsl:value-of select="name()"/>
  </xsl:template>



 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]