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]
Other format: [Raw text]

Re: exlt set.distinct.template.xsl ?


Hello Hans,

> Can anyone please explain , the difference between   <xsl:value-of
> select="."/> and <xsl:copy-of select="." /> ?

without seeing your whole code in context and result i cant comment in any
great detail as the template is tested and works properly.

the difference between value of returns the value contained within the xml
tags, copy or copy-of returns the xml result.

i assume that u actually recieved the correct result, but did not *see*
it...as it was wrapped in xml, and u probably outputted html

the following example xml and xsl clearly illustrates the difference between
value-of and copy-of


xsl
----------------------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
 <xsl:template match="root">

 this is copy of
 <xsl:apply-templates select="test" mode="test1"/>

 <br/>

 this is value of
 <xsl:apply-templates select="test" mode="test2"/>
 </xsl:template>

 <xsl:template match="test" mode="test1">
 <xsl:copy-of select="."/>
 </xsl:template>

 <xsl:template match="test" mode="test2">
 <xsl:value-of select="."/>
 </xsl:template>

</xsl:stylesheet>

xml
------------------------------------------
<?xml version="1.0" ?>
<root>

<test>1</test>

<test>2</test>


</root>



HTH, jim fuller
>
> Thanks,
>
>
> Hans Braumüller
> -- + --
> Networking Artist
> http://crosses.net
> http://kunstserie.com
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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]