Re: [xslt] Question about xsl:copy-of.



Jia Pu said:
> I run xsltproc on following stylesheet and xml input.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> <xsl:output method="text"/>
> <xsl:template match="/">
> <xsl:copy-of select="."/>
> </xsl:template>
> </xsl:stylesheet>
>
> <?xml version="1.0"?>
> <?xml-stylesheet href="file:///c:/temp/test.xsl" type="text/xsl"?>
> <employee>
> 	<name>John Doe</name>
> 	<department>Widget Sales</department>
> 	<salary>62,000 </salary>
> </employee>
>
> The output was:
>
>         John Doe
>         Widget Sales
>         62,000
>
>
> Where are the tags? I would expect output:
> <employee>
> 	<name>John Doe</name>
> 	<department>Widget Sales</department>
> 	<salary>62,000 </salary>
> </employee>

What happens if you remove the line "<xsl:output method="text"/> from your
stylesheet?  And why does that happen?

Bill



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]