RE: [xsl] creating name value pairs

Subject: RE: [xsl] creating name value pairs
From: "Scott Trenda" <Scott.Trenda@xxxxxxxx>
Date: Wed, 7 Nov 2007 17:54:56 -0600

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"
  <Node1> a=1^b=2</Node1>
and it'd technically be correct. :P

But I'm guessing that you want something like this.
<Object1 xsl:version="1.0"
    <xsl:for-each select="//Node[@name and @value]">
      <xsl:value-of select="concat(@name, '=', @value)"/>
      <xsl:if test="position() != last()">^</xsl:if>

~ 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


Can any body suggest how to transform the following xml to xml
transformation. Node elements can increase dynamically.


<Node name="a" value="1"/>
<Node name="b" value="2"/>




<Node1> a=1^b=2</Node1>


Current Thread