Reputation: 27
I need to get the value of a node with an xml format but all i'm getting is the values inside those tags.
Body:
<input>
<first>one</first>
<second>two</second>
<third>three</third>
</input>
XQuery
<PayloadAsMessage>
<xsl:value-of select="/input"/>
</PayloadAsMessage>
Expected output:
<PayloadAsMessage>
<first>one</first>
<second>two</second>
<third>three</third>
</PayloadAsMessage>
What i'm getting:
<PayloadAsMessage>
onetwothree
</PayloadAsMessage>
Upvotes: 0
Views: 111
Reputation: 11771
xsl:value-of
takes the string value of an element (it's also XSLT, not XQuery). To copy the XML exactly, use either xsl:copy-of
(XSLT 1) or xsl:sequence
(XSLT2).
<xsl:copy-of select="/input/*"/>
or
<xsl:sequence select="/input/*"/>
Upvotes: 1