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

RE: Problems copying elements recursively.

Subject: RE: Problems copying elements recursively.
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Thu, 6 Feb 2003 17:04:59 -0500
xslt list all elements
[ Imrran Wahid ]
> 
> I've been trying with this piece for a while but still
> cannot get it right.
> 
> I am trying to copy a certain node-tree from the xml
> document via xsl style sheet. Basically i would like
> the output to be an xml representation of the node
> tree.
> 

1)  If you just want to copy it, just use xsl:copy-of to copy the whole
nodeset of interest.

2) It appears you are trying to build up elements by inserting "<" and
">" signs (example: "<xsl:text></</xsl:text>").  DO NOT EVEN THINK OF
DOING THIS.  Plus, you do not need to do it since xslt will do what you
want (but you have to explain it clearly first).  With xslt, you build a
tree first, and then the angle brackets get put in by the serializer
when you serialize the tree to the output.  Attempts to circumvent this
process will tend to get you in trouble, and even when they work lead to
misunderstanding of how the xslt system is designed to work. (Look in
the FAQs for "disable-output-escaping" for more on this).

If you want to create an element with a name extracted from the source,
you can use xsl:element or, if you already know the name, just write the
whole element with literal tags:

<name1><xsl:value-of select='theContent'/></name1>

for example.

Cheers,

Tom P
 

 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.