[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] How do i get a name-value pair in HTML output


Subject: RE: [xsl] How do i get a name-value pair in HTML output
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Tue, 23 Jan 2001 10:03:10 -0000

> I have an abitrary XML doc looking something like this :
> 
> <?xml version="1.0"?>
> <myroot value1="first"
>          value2="second"
>          value3="third">
> 
> now i want to able to run this through XSLT producing an html like :
> 
> myroot
> 	value1=first
> 	value2=second
> 	value3=third

You could kick-start the solution with

<xsl:value-of select="name()"/>
<xsl:for-each select="@*">
   <xsl:value-of select="concat(name(), ' = ', .)"/>
</xsl:for-each>

Mike Kay 

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



Current Thread
Keywords