I have an XML definition that contains an element with child elements. For example:
<a>
<b>
<c>C</c>
<d>D</d>
</b>
</a>
I have an XSLT with an output of text. For example:
<xsl...>
<xsl:output method="text" indent="yes"/>
<xsl:template match="/">
<xsl:copy-of select="/a/b" />
...
I want to copy the entire b element and its children into a whitespace-removed string so that I can generate a SQL query. For example:
select * from some-table where xml = '<b><c>C</c><d>D</d></b>'
At the moment copy-of is finding the b element but dropping off all element and attribute information leaving only the text content within each. I think this might be to do with the output type.
Any ideas?