XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Kenneth LeeSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Kenneth Lee
Date: 12 Oct 2004 01:18 AM
Originally Posted: 12 Oct 2004 12:15 AM
I don't have an offline driver so I'm using Netscape 7.2 to do my translating.

I used

<xsl:output method='xml' version="1.0" indent='yes'
standalone='yes' omit-xml-declaration='no' />
to try to create an xml header when none of my tags were showing up on screen.
Saving the page shows the tags, but has no change because of the above command.
Tried various other things without success.
When I tried Microsoft Internet Explorer, it redirected to a new window in Netscape.
<!--
<xsl:variable name='startXml' select='&lt;?xml version="1.0"?&gt;'/>
<![CDATA[<?xml version="1.0"?>]]>
-->
I think the ? terminates both of these with an invalid character, but doesn't show what it really is complaining about.
Removing the ? does remove the error message, but doesn't make the file xml.

I later found this:
<xsl:processing-instruction name='xml'>version="1.0"</xsl:processing-instruction>
If I save and open the page, I get normal XML browser output, but the direct xml conversion still strips and hides all tags from the view.
I'd like to see the converted xml output file without first saving it.

Interesting little edit feature. You enter text with linefeeds originally, it enters <br> commands.
then you edit it, it retains the linefeeds and shows <br> in the text. When you re-post, <br> becomes part of the
text and all linefeeds go away.

Postnext
Tony LavinioSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Tony Lavinio
Date: 12 Oct 2004 10:51 AM
It's not clear exactly what you are doing. Are you running the transform
in Stylus, saving the output, and then trying to view it in IE and/or
Netscape? Are you using a webserver, or just looking at files in the
filesystem? Are you depending on IE's XSLT engine, or Netscape's? Did
you use an .xml document with an xsl-stylesheet PI, as specified in
http://www.w3.org/TR/xml-stylesheet/ ?

Postnext
Kenneth LeeSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Kenneth Lee
Date: 12 Oct 2004 05:13 PM
I have a file on my PC with an .xml extension, it links to a file with an .xsl extension.
I double click the .xml file from Windows Explorer, it brings up Netscape which shows just a string of text.
If I copy the file:: link, manually bring up Internet Explorer, copy the link and hit enter, it brings up a new Netscape window which shows just a string of text.
If I copy the Netscape page to another .xml file and double click that file, I get a well formed XML document output listing instead of a string of text.

Originally I asked how to put in the <?...?> processing command. More reading answered that question. Now I'm wondering why I'm not getting XML output when I'm sending XML input and if there is a cure for that.

Postnext
Kenneth LeeSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Kenneth Lee
Date: 12 Oct 2004 05:19 PM
Originally Posted: 12 Oct 2004 05:16 PM
Whoops, meant "...bring up Internet Explorer, paste the link and hit enter..."<br> Considering what edit did to me the first time, this time I'll just add a reply instead.

Postnext
Ivan PedruzziSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Ivan Pedruzzi
Date: 12 Oct 2004 05:41 PM
Kenneth,

1) In your system the .xml file extension is associated to netscape
this is way when double click it opens Netscape

2) IE renders .xml file using a default stylesheet unless xml-stylesheet PI is defined
like that

<?xml-stylesheet type='text/xsl' href='my.xsl'?>

Could you show us the XSLT + XML you are using?

Ivan

Postnext
Kenneth LeeSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Kenneth Lee
Date: 13 Oct 2004 01:17 AM
I don't mind going to Netscape as my default as long as it works properly.
Note that something in my configuration has disabled IE from rendering XML files. Probably happened when I downloaded Netscape 7.2. I don't know if rendering problem exists there as well
Here are my files:


FormExample2.xml:
<?xml version="1.0"?>
<!--
-->
<?xml-stylesheet type="application/xml" href="FormExample2.xsl"?>

<warehouse>
<item>
<name>orange</name>
<country>USA</country>
</item>
<item>
<name>ice wine</name>
<country>Canada</country>
</item>
<item>
<name>apple</name>
<country>USA</country>
</item>
</warehouse>




FormExample2.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='xml' version="1.0" indent='yes'
standalone='yes' omit-xml-declaration='no' />

<xsl:template match="/">
<!--
<xsl:variable name='startXml' select='&lt;xml version="1.0"&gt;'/>
<![CDATA[<?xml version="1.0"?>]]>
-->
<xsl:processing-instruction name='xml'>version="1.0"</xsl:processing-instruction><xsl:apply-templates/>
</xsl:template>

<xsl:template match="warehouse">
<storage>
<title>Transform data</title>
<xsl:apply-templates select='item/country' />
</storage>
</xsl:template>

<xsl:template match="text()|@*">
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="country">
<country>
<xsl:apply-templates />
<xsl:apply-templates select='../name' />
</country>
</xsl:template>

<xsl:template match="name">
<xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>




What I see in Netscape:
Transform dataUSAorangeCanadaice wineUSAapple



FormExampleoUT.xml(saving rendered page from Netscape):
<?xml version="1.0"?>
<storage><title>Transform data</title><country>USA<name>orange</name></country><country>Canada<name>ice wine</name></country><country>USA<name>apple</name></country></storage>

Postnext
Ivan PedruzziSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Ivan Pedruzzi
Date: 13 Oct 2004 03:50 PM
kenneth,

The problem is that Netscape renders the xml document (the result of the transformation) as it was HTML.
What you see are the tag values; tags that are not HTML are ignored.

Netscape doesn't have a default stylesheet like IE does to display xml documents as HTML
If you type in IE res://msxml/defaultss.xsl you can see the transformation (written in the old xsl standard)

You don't need to create manually the xml pi, XSLT does it for you.

I still can't parse this

> FormExampleoUT.xml(saving rendered page from Netscape):
> <?xml version="1.0"?>
> <storage><title>Transform data</title><country>USA<name>orange</name></country><country>Canada<name>ice wine</name></country><country>USA<name>apple</name></country></storage>


Ivan

Postnext
Kenneth LeeSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Kenneth Lee
Date: 13 Oct 2004 08:40 PM
If I display FormExampleoUT.xml on Netscape, it gives me a warning message that it doesn't have a xslt document assigned and then displays the XML in a format that looks just like I remember IE doing with tags, colapsable(sp?) links, etc.

Posttop
Ivan PedruzziSubject: Using XSLT to create XML output - how do I put in xml tag?
Author: Ivan Pedruzzi
Date: 14 Oct 2004 12:03 AM
Kenneth

Let me more precise, Netscape is able to render xml documents when loaded from URL
but seems to use a different execution path with the xslt transformation result.

Ivan

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.