This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Storing HTML in XML
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] Storing HTML in XML
- From: timw at 3d3 dot com
- Date: Fri, 7 Sep 2001 07:51:15 +1000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> -----Original Message-----
> From: wbchmura@Ensign-BickfordInd.com
> You want to use:
>
> <xsl:copy-of select="title/node()" />
>
> To get it out. See the thread "Re: [xsl] Question with
> xsl:copy-of and xsl:value-of".
>
> if you dont do it this way it will be outputting <myfile> as
> part of the
> result.
>
I think you are refering to an message from Mike Kay where someone asked how
to extract the contents of the <title> tag with the enclosed nodes intact
from the following XML
<resource name="p_msc" type="packagingbulletin" format="pdf">
<title>P <small><sup>®</sup></small> MS (MSC)series Canadian
Packaging Bulletin</title>
<link>pkb_can_msc.pdf</link>
</resource>
MK> If the <title> is the current node, do <xsl:copy-of select="node()"/> to
MK> copy its children.
He also could have said <xsl:copy-of select="."/>, or equally "If the
<title> ISNT the current node, do <xsl:copy-of select="the_path/title"/> to
copy its children."
In other words, the node() isn't required. - I use copy-of in this way often
and have not needed to use it.
But you have correctly pointed out that to extract the nodes within the
selected element, xsl:value-of won't work, and xsl:copy-of is required to do
a deep copy.
Tim
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list