-2

I have an xml with several parent-child structures. One structure is like this:

<parent>
  <child>Sam</child>
  <child>Tom</child>
  <child>Joe</child>
</parent>

I want the result to look like this:

<parent>
  <child>Sam;Tom;Joe</child>
</parent>

How do I achieve the result in XSLT?

NJR
  • 1
  • 2
    By writing XSLT, and only then posting a question here *after* you're truly struck and can demonstrate what you've tried and how the results differ from what you want. Not by presuming that we're here to write code for you from your specification. Read [ask]. – kjhughes Mar 30 '17 at 01:44

1 Answers1

0

In XSLT 2.0 you can write:

<xsl:template match="parent">
  <xsl:copy>
    <child>
      <xsl:value-of select="child" separator=";"/>
    </child>
  </xsl:copy>
</xsl:template>
Valdi_Bo
  • 30,023
  • 4
  • 23
  • 41