Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2005, 09:57 PM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default copy-of question.

the xml:
-----------------------------------------
<?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 xslt:
------------------------------------------
<?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" encoding="UTF-8"/>
<xsl:template match="/">
   <xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>

Now i try to open the xml file in Mozilla Firefox. I thought that I will see:
<employee>
    <name>John Doe</name>
    <department>Widget Sales</department>
    <salary>62,000</salary>
</employee>

However I only see:
John Doe
Widget Sales
62,000

So why didn't i see all the tags.
 
Old January 8th, 2005, 05:59 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

When you use xsl:output method="text", the result tree is serialized by outputting all the text nodes, and ignoring the element and attribute markup.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 8th, 2005, 11:51 AM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes. That fixed it.

Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
copy and rename red_fiesta Classic ASP Professional 1 November 8th, 2006 11:00 AM
Copy folders surendran PHP How-To 2 July 25th, 2006 10:36 PM
copy value in char ct Excel VBA 1 October 27th, 2005 08:30 AM
Copy to Clipboard Clive Astley Access 5 July 16th, 2004 07:16 PM
How to copy file? eapsokha Classic ASP Databases 2 November 14th, 2003 11:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.