Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xml declaration not written

1 view
Skip to first unread message

Ivan Longhi

unread,
Jul 11, 2006, 9:54:21 AM7/11/06
to dev-te...@lists.mozilla.org
hello,

I have a xml file:
---------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="in.xsl"?>
<eventi>
<evento><id>29153</id><titolo>Invito a corte</titolo></evento>
</eventi>
---------------

the in.xsl contains:
-----------------
<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output version="1.0" method="xml" encoding="iso-8859-1" indent="yes"
standalone="yes" />
<xsl:template match="/">
<milanomese>
<test>test</test>
<test>test</test>
<xsl:copy-of select="eventi/evento"/>
</milanomese>
</xsl:template>
</xsl:stylesheet>
-----------------

very simple, no?
if I open the file with a browser the xml file is trasformed ok, but the
browser doesn't include the xml declaration (<?xml version="1.0"
encoding="iso-8859-1" ?>) in the output.
I can't understand why!
as you can see I used the <xsl:output .... I think correctly.....

any idea?

hi,
Ivan

--------------------
http://www.retecivica.milano.it/


Martin Honnen

unread,
Jul 11, 2006, 12:32:57 PM7/11/06
to
Ivan Longhi wrote:


> if I open the file with a browser the xml file is trasformed ok, but the
> browser doesn't include the xml declaration (<?xml version="1.0"
> encoding="iso-8859-1" ?>) in the output.

How do you know? At least in Mozilla's DOM the XML declaration does not
show up as a node.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Ivan Longhi

unread,
Jul 11, 2006, 1:07:42 PM7/11/06
to dev-te...@lists.mozilla.org
Martin...@gmx.de on Tuesday, July 11, 2006 at 6:32 PM +0000 wrote:
>How do you know? At least in Mozilla's DOM the XML declaration does not
>show up as a node.

for two reasons:
- first of all the document isn't rendered by mozilla as a xml document,
that is I see only the content of the nodes, as if it is a html document
with unknown tags...
- second if I "save page as..." I see the "correctly" transformed xml file
but without the xml declaration

bye,
Ivan

--------------------
http://www.retecivica.milano.it/


Jonas Sicking

unread,
Jul 11, 2006, 11:26:46 PM7/11/06
to
Ivan Longhi wrote:
> Martin...@gmx.de on Tuesday, July 11, 2006 at 6:32 PM +0000 wrote:
>> How do you know? At least in Mozilla's DOM the XML declaration does not
>> show up as a node.
>
> for two reasons:
> - first of all the document isn't rendered by mozilla as a xml document,
> that is I see only the content of the nodes, as if it is a html document
> with unknown tags...

What is it that you expect to see? Since you are just using generic XML
without any stylesheets, you will only see:

testtest29153Invito a corte

Is that not what you are seeing?

> - second if I "save page as..." I see the "correctly" transformed xml file
> but without the xml declaration

Yeah, this sounds like a bug, but that will not affect rendering at all.
Would be great if you could file a bug on the XSLT component though so
that we can get it fixed.

/ Jonas

Martin Honnen

unread,
Jul 12, 2006, 11:12:22 AM7/12/06
to
Jonas Sicking wrote:

>> - second if I "save page as..." I see the "correctly" transformed xml
>> file
>> but without the xml declaration
>
>
> Yeah, this sounds like a bug, but that will not affect rendering at all.
> Would be great if you could file a bug on the XSLT component though so
> that we can get it fixed.

I have filed bug <https://bugzilla.mozilla.org/show_bug.cgi?id=344362>
on that issue.

0 new messages