Altova Mailing List Archives


Re: [xsl] Transforming XML to XML

From: Rick Taylor <taylor@-------->
To:
Date: 8/11/2004 10:20:00 PM
You can simply remove the processing instruction for the stylesheet and 
allow the browser's (IE or newer Netscape) default stylesheet to handle 
it.  Alternatively, check out the following template for converting xml to 
html string representations: http://www.xmlportfolio.com/xml-to-string/.



rick



At 02:39 PM 8/11/2004, you wrote:
I have a very simple question about transforming XML to XML.  I have been 
using XSLT to transform XML to XHTML and displaying the result in Internet 
Explorer.  I would like to do the same but with XML displayed in the 
browser.  A search of the archives has not provided a satisfactory 
solution.  Here is a simplified XML file, testdata.xml:



<?xml-stylesheet type="text/xsl" href="renewal.xsl"?>
<Data>
        <car>Chevy</car>
        <car>Dodge</car>
        <car>Ford</car>
</Data>

Here is a copy of my XSL file:



<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>

<xsl:template match="/">

                <xsl:apply-templates select="Data"/>

</xsl:template>

</xsl:stylesheet>



>From what I have read and from some of the examples I have seen, I would 
expect this to return an XML file exactly like the original document 
(testdata.xml).  Instead it is displaying a string consisting of the text 
from the <car> elements, without the XML tags: ChevyDodgeFord.  What am I 
overlooking?

**************************************************************************************************

The contents of this email and any attachments are confidential.

It is intended for the named recipient(s) only.

If you have received this email in error please notify the system manager 
or  the

sender immediately and do not disclose the contents to any one or make copies.



** This email was scanned for viruses, vandals and malicious content **
**************************************************************************************************

Rick Taylor

XML Developer

PPDM Association

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.