This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xsl:value-of /xsl:copy-of


SoftLiban DAGHFAL Carole wrote:
> 
> Hi
> I just want to know the difference between xsl:value-of  and xsl:copy-of


There's plenty of technical terms that'll explain exactly what's
happening, but _in_practice_:

value-of returns the exposed text of the selected item, all the data
which is left if the <TAGS> are removed

copy-of places the selection, tags and all, into the results. If you
want to nest HTML inside an XML node, you probably want to use copy-of
to get at it later.

OTOH you almost always want to use value-of when reading attributes, as
copy-of would result in the attribute being added as an attribute of the
current node.

Have a play, it'll all become clear.

.dan.


:=====================:====================:
: Dan Morrison        : The Web Limited    :
:  http://here.is/dan :  http://web.co.nz  :
:  dman@es.co.nz      :  danm@web.co.nz    :
:  04 384 1472        :  04 495 8250       :
:  025 207 1140       :                    :
:.....................:....................:
: If ignorance is bliss, why aren't more people happy?
:.........................................:


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]