Subject: RE: [xsl] creating name value pairs From: "Scott Trenda" <Scott.Trenda@xxxxxxxx> Date: Wed, 7 Nov 2007 17:54:56 -0600 |
Kotes, Welcome to the list. When asking for advice on an open-ended question like this, it's most helpful when you can provide a larger, more extensive example of the input you need to process, and the corresponding output. Two data points isn't very much for us to glean patterns from... for all I know about exactly what you're trying to do, I could recommend: <Object1 xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <Node1> a=1^b=2</Node1> </Object1> and it'd technically be correct. :P But I'm guessing that you want something like this. <Object1 xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <Node1> <xsl:for-each select="//Node[@name and @value]"> <xsl:value-of select="concat(@name, '=', @value)"/> <xsl:if test="position() != last()">^</xsl:if> </xsl:for-each> </Node1> </Object1> ~ Scott -----Original Message----- From: kotes mogili [mailto:xsltlist@xxxxxxxxx] Sent: Wednesday, November 07, 2007 5:45 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] creating name value pairs Hi, Can any body suggest how to transform the following xml to xml transformation. Node elements can increase dynamically. <Object> <Node name="a" value="1"/> <Node name="b" value="2"/> </Object> to <Object1> <Node1> a=1^b=2</Node1> </Object1> Thanks Venkat
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] creating name value pairs, kotes mogili | Thread | RE: [xsl] creating name value pairs, Michael Kay |
[xsl] creating name value pairs, kotes mogili | Date | RE: [xsl] creating name value pairs, Michael Kay |
Month |