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]

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


> 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


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