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

RE: copy-of / value-of

Subject: RE: copy-of / value-of
From: "Conal Tuohy" <conalt@xxxxxxxxxxxxxxx>
Date: Tue, 3 Sep 2002 09:26:34 +1200
copy of value of
xsl:value-of converts the selected sub-tree to a string - you will lose all
elements. You don't want this, because your content contains HTML elements
which you want in your output tree.

xsl:copy-of copies a sub-tree, including all elements.

You used <xsl:copy-of select="special"/> which copies the <special> elements
and all descendants, but you only want to copy the content from INSIDE the
<special> elements, NOT the <special> elements themselves. So you should use
<xsl:copy-of select="special/node()"/>, as Jarno suggested. This will copy
every node which is a child of the <special> element, and all their
descendants.

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Jan Theofel
> Sent: Tuesday, 3 September 2002 02:47
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  copy-of / value-of
>
>
>
> Hi,
>
> Jarno.Elovirta@xxxxxxxxx schrieb:
> >
> > > In my XML for that, I want to be able to add a tag <special> like:
> > >
> > > <special>
> > >   Some text here as line 1<br/>
> > >   Some text here as line 2
> > > </special>
> > >
> > > I also tried copy-of which is better, but copies also the
> XML tags.
> > >
> >
> > You probably want
> >
> >   <xsl:copy-of select="special/node()" />
> >
> > And if not, you should show us your stylesheet and wholeish
> input and desired output documents.
>
> See also my other mail, here the URLs:
>   http://www.etes.de/files/programm.xml
>   http://www.etes.de/files/programm-html.xsl
>
>
> The problem with the copy-of is, that the <xsl:copy-of
> select="some/node/special"> will result in
>
> <special>
>   Some text here as line 1<br/>
>   Some text here as line 2
> </special>
>
> What I want to have is instead:
>
>   Some text here as line 1<br/>
>   Some text here as line 2
>
> (Without the tags arround.)
>
> > > (I didn't find this in the docs and the FAQ is not reachable
> > > at the moment.
> > > :-(  )
> >
> > It's in the specs, believe me.
>
> Ok. But the specs are not easy to understand for a beginner
> like me. :-(
>
> Thanks,
> Jan
>
> --
> Jan Theofel                              Fon: +49 (7 11) 48 90 83 - 0
> ETES - EDV-Systemhaus GbR                Fax: +49 (7 11) 48
> 90 83 - 50
> Libanonstrasse 58 A * D-70184 Stuttgart  Web: http://www.etes.de
>
> ______________________________________
> Inflex - eMail Scanning and Protection
> Queries to: postmaster@xxxxxxx
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 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.