What code could I use in replace of <xsl:copy-of select="tag"/>, that when applied to the following xml..
<tag>
content
<a>
b
</a>
</tag>
..would give the following result: ?
content
<a>
b
</a>
I wish to echo out all the content therein, but excluding the parent tag
Basically I have several sections of content in my xml file, formatted in html, grouped in xml tags
I wish to conditionally access them & echo them out
For example: <xsl:copy-of select="description"/>
The extra parent tags generated do not affect the browser rendering, but they are invalid tags, & I would prefer to be able to remove them
Am I going about this in totally the wrong way?
Since you want to include the
contentpart as well, you’ll need thenode()function, not the*operator:I’ve tested this on the input example and the result is the example result:
Without hard-coding the root node name, this can be:
This is useful in situations when you are already processing the root node and want an exact copy of all elements inside, excluding the root node. For example: