473,395 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

xsl:copy-of question

I would like to copy the entire tree. However, it only copy the text.

The xml file is the following:
<?xml version="1.0"?>
<hello>
Hello there, world!
<AAA>valueA</AAA>
</hello>

The xsl file is the following:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="UTF-16" method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>

The result is
Hello there, world! valueA

I would like to get
<hello>
Hello there, world!
<AAA>valueA</AAA>
</hello>

Thanks

David
Jul 20 '05 #1
1 1503
Most probably you are viewing the result with a browser.

When viewed with a normal text editor the result is an exact copy of the
source xml document.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"David Shen" <ds*****@yahoo.com> wrote in message
news:db**************************@posting.google.c om...
I would like to copy the entire tree. However, it only copy the text.

The xml file is the following:
<?xml version="1.0"?>
<hello>
Hello there, world!
<AAA>valueA</AAA>
</hello>

The xsl file is the following:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output encoding="UTF-16" method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>

The result is
Hello there, world! valueA

I would like to get
<hello>
Hello there, world!
<AAA>valueA</AAA>
</hello>

Thanks

David

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kevin Dean | last post by:
I'm trying to create an XSL transformation that will strip out development-specific attributes from deployment descriptors and other XML files. I have already successfully done so with web.xml but...
11
by: Tjerk Wolterink | last post by:
I've a problem in an xsl transformation. My xml input: --- input.xml --- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE xc:content > <xc:xcontent...
2
by: Beniamin Tecar | last post by:
Hi, I have an xml : <DataRecords> <Point Alias='A' Value='1' Status='0' /> <Point Alias='B' Value='2' Status='0' /> </DataRecords> I have needed by an XSL to insert a node between...
8
by: Knighterrant | last post by:
I want to copy elements from one namespace to anothor, how to create the xslt? for example, the source data is: <s:mail xmlns:s="urn:source-namespace"> <s:subject>xxxx</s:subject>...
2
by: marktm | last post by:
I want to sort the my XML by Montn and the day. I am using this as my XSL. What am I doing wrong? <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> ...
3
by: bhushan.kharabe | last post by:
Hi, I am stuck in problem involving transformation where the tree structure of the target is different than the tree structure of the source. My input xml looks like <?xml version="1.0"...
3
by: @do | last post by:
Hi! My XML File is something like this: <?xml version="1.0" encoding="ISO-8859-1"?> <item_list> <item_list_elements> <code>01600</code> <name>John</name> <text>some text ABC</text>
4
by: carra | last post by:
Hi If I have some XML that looks like this... <heading1>fdfdfdfdf</heading> <para>text1</para> <para>text2</para> <table>Table structure</table> <para>text3</para> <heading2>gfhgjg</heading>...
3
by: Andy Dingley | last post by:
>From a thread over in c.i.w.a.h "RFC: From XHTML to HTML via XSLT" http://groups.google.co.uk/group/comp.infosystems.www.authoring.html/msg/f112c230061ffe86 As is well-known, the XSLT HTML...
2
by: mtugnoli | last post by:
I've found a sample on http://msdn2.microsoft.com/en-us/library/ms766561.aspx to filter a .XML ex. <?xml version="1.0"?> <COLLECTION dateCreated="01-04-2000"> <BOOK> <TITLE>Splish...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.