(Should Be) Simple XSLT Query Problem
Posted: Fri Sep 23, 2005 8:39 am
Hey folks,
I'm working on an XSLT file here and running into a bit of a problem. Take the following XML source:
How would I go about selecting the contents of <body> (including _all_ nodes underneath it) into a variable.
As far as I've gotten is (from 'body' scope):
<xsl:variable name="varBody" select="descendant-or-self::*" />
That gives me all the contents (including children & grandchildren), but I'm missing the nodes/tags.
What I want:
"This is the body of the text <div>including HTML tags</div>"
What I'm getting:
"This is the body of the text including HTML tags"
How should I be referencing it? I heard mention of 'xsl:copy-of' but couldn't produce anything different from above when trying it. Seems like it should be simple enough, but I'm stuck.
Thanks in advance.
I'm working on an XSLT file here and running into a bit of a problem. Take the following XML source:
Code: Select all
<note>
<title>Hello</title>
<body>This is the body of the text <div>including HTML tags</div>.</body>
</note>
As far as I've gotten is (from 'body' scope):
<xsl:variable name="varBody" select="descendant-or-self::*" />
That gives me all the contents (including children & grandchildren), but I'm missing the nodes/tags.
What I want:
"This is the body of the text <div>including HTML tags</div>"
What I'm getting:
"This is the body of the text including HTML tags"
How should I be referencing it? I heard mention of 'xsl:copy-of' but couldn't produce anything different from above when trying it. Seems like it should be simple enough, but I'm stuck.
Thanks in advance.