[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Storing HTML in XML

Subject: RE: Storing HTML in XML
From: timw@xxxxxxx
Date: Fri, 7 Sep 2001 07:51:15 +1000
storing html in xml
> -----Original Message-----
> From: wbchmura@xxxxxxxxxxxxxxxxxxxxxx

> You want to use:
> 
>  <xsl:copy-of select="title/node()" />
> 
> To get it out.  See the thread "Re:  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>&#174;</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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.