Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display attributes with XSL

Status
Not open for further replies.

Nosferatu

Programmer
Jun 9, 2000
412
RO
Hello...

I really never got into XSLT until now and I am having some problems finding the right way to do this:
what I need is to display for each element that has certain attributes its value, along with the attributes.

For example, for
Code:
<n1 attr1=&quot;at1&quot; attr2 = &quot;at2&quot;>
    <n2 attr1=&quot;at3&quot; attr2 = &quot;at4&quot;>Data</n2>
    <n3 attr1=&quot;at5&quot; attr2 = &quot;at6&quot;>Data1</n3>
</n1>

the output would be:
###at1 ###at2
###at3 ###at4 Data1
###at5 ###at6 Data2

Can anybody help me on this?
Thanks!
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Not sure if this is exactly what you want but what about:

<xsl:for-each select=&quot;//Root/n&quot;>
<xsl:value-of select=&quot;@attr1&quot;/> <xsl:value-of select=&quot;@attr2&quot;/> <xsl:value-of select=&quot;.&quot;> <br/>
<xsl:for-each select=&quot;n&quot;>
<xsl:value-of select=&quot;@attr1&quot;/> <xsl:value-of select=&quot;@attr2&quot;/> <xsl:value-of select=&quot;.&quot;> <br/>
</xsl:for-each>
</xsl:for-each>
Nick (Software Developer)


nick@retrographics.fsnet.co.uk
nick.price@myenable.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top