XML not rendered

0 views
Skip to first unread message

Vincent Nicolas

unread,
Nov 27, 2001, 5:27:39 AM11/27/01
to
I've got a xml file that can be seen with IE5, in a tree form.
Mozilla renders only garbage...

What is a problem ?

--
Le Vintz.
http://membres.tripod.fr/vnicolas/

Florian Ramillien

unread,
Nov 27, 2001, 6:11:03 AM11/27/01
to
Vincent Nicolas wrote:

> I've got a xml file that can be seen with IE5, in a tree form.
> Mozilla renders only garbage...
>
> What is a problem ?
>
>

Actually, Mozilla don't have a default XSL that show your XML page in a
good form.

But if your XML page as a XSL style-sheet, it can be display correctly.
Take a look at:

http://mozilla.org/projects/xslt/test.xml

Florian.

Malodushnļkh

unread,
Nov 27, 2001, 1:00:28 PM11/27/01
to

Henri Sivonen

unread,
Nov 27, 2001, 1:58:21 PM11/27/01
to
In article <Xns91667415E8FEDv...@195.242.64.73>, Vincent
Nicolas <vnic...@ixo.fr_NoSpaM> wrote:

> I've got a xml file that can be seen with IE5, in a tree form.
> Mozilla renders only garbage...
>
> What is a problem ?

You haven't applied a style sheet to the XML file.

--
Henri Sivonen
hen...@clinet.fi
http://www.clinet.fi/~henris/

Lincoln Ramsay

unread,
Nov 27, 2001, 6:32:09 PM11/27/01
to
Vincent Nicolas wrote:

> I've got a xml file that can be seen with IE5, in a tree form.
> Mozilla renders only garbage...

IE5 (on MacOS 9 at least) has a bug where it doesn't display properly formatted
XHTML 1.0 To get this behaviour on windows, you have to give the file a .xml
extension.

I guess some people might consider this a useful feature, but it doesn't belong
in a Web Browser.

To display XML in a Browser, you need to tell the browser how to display the
data (with some kind of stylesheet).

--
. \|/
. (o o)
+----------------------------------------------ooO--(_)--Ooo--+
| There is no emotion, there is peace. There is no ignorance, |
| there is knowledge. There is no passion, there is serenity. |
| There is no death, there is the force. -- Jedi Code |
+-------------------------------------------------------------+

Vincent Nicolas

unread,
Nov 28, 2001, 4:11:55 AM11/28/01
to
Florian Ramillien <frami...@com6.fr> wrote in
news:3C0374C...@com6.fr:

Ok, I understand. Once again, IE5 tries to do more things that we want...

Ranjit Mathew

unread,
Nov 28, 2001, 11:32:14 PM11/28/01
to
It would be quite nice (REALLY nice) if Moz could
apply a default XSL to XML files that do not supply
one. That shouldn't be too hard.

Or is it that it would not be "propah"?

Ranjit.

--
Ranjit Mathew E-Mail: Ranjit...@thbs.com

Member (Technical Staff), Phone: +91-80-209 75 11/12/13
Torry Harris Business Solutions, Fax: +91-80-226 84 42
Bangalore, INDIA. http://www.torryharris.com/

Michael Gratton

unread,
Nov 29, 2001, 2:20:41 AM11/29/01
to

Ranjit Mathew wrote:

>
> It would be quite nice (REALLY nice) if Moz could
> apply a default XSL to XML files that do not supply
> one. That shouldn't be too hard.

I dunno, it seems much more correct to not have a default, because unless you *do* specify a stylesheet, style for arbitrary XML is inherently undefined.

But to be able to configure one if needed, either through the Preferences, via a hidden pref or using something like userContent.css would be cool.

--
Mike Gratton <mi...@vee.net>
Leader in leachate production and transmission since 1976.
<http://web.vee.net/>

Nicolás Lichtmaier

unread,
Nov 30, 2001, 11:57:37 PM11/30/01
to
>> It would be quite nice (REALLY nice) if Moz could
>> apply a default XSL to XML files that do not supply one. That
>> shouldn't be too hard.
>
>
> I dunno, it seems much more correct to not have a default, because
> unless you *do* specify a stylesheet, style for arbitrary XML is
> inherently undefined.
>
> But to be able to configure one if needed, either through the
> Preferences, via a hidden pref or using something like userContent.css
> would be cool.


What Mozilla is doing now isn't more correct than what explorer does.
And all things being equal, Explorer's behaviour is far more useful.

Michael Gratton

unread,
Dec 2, 2001, 7:16:40 PM12/2/01
to

Nicolás Lichtmaier wrote:

>
> What Mozilla is doing now isn't more correct than what explorer does.

Oh, I don't know about that. Web browsers apply somthing approaching the W3C's suggested style to HTML makrup when rendering it, which is obviously a good thing. But no-one as specified a "default" style for XML markup, precisely because you can't know how to render arbitary content.

If, however you are dealing with a well known and supported doctype, like SVG, MathML or similar, one which has defined style, then Moz is justified in rendering it using that style.

> And all things being equal, Explorer's behaviour is far more useful.

Initially, if you're trying to view an XML document, yes. But something like the DOM inspector is far more useful for "rendering" arbitary XML content, IMHO.

Matthew Thomas

unread,
Dec 2, 2001, 7:31:19 PM12/2/01
to mozilla...@mozilla.org
Michael Gratton wrote:
>
> Ranjit Mathew wrote:
> >
> > It would be quite nice (REALLY nice) if Moz could
> > apply a default XSL to XML files that do not supply
> > one. That shouldn't be too hard.
>
> I dunno, it seems much more correct to not have a default, because
> unless you *do* specify a stylesheet, style for arbitrary XML is
> inherently undefined.

Undefined means that browsers can do whatever they like with it. MSIE
does whatever it likes with it; it shows it as a collapsible tree.
Mozilla does whatever it likes with it; it shows it as stream of text.
The tree rendering is clearly more useful than the stream of text
rendering. Therefore MSIE's behavior is more correct.

> But to be able to configure one if needed, either through the
> Preferences, via a hidden pref or using something like userContent.css
> would be cool.

>...

Cool but useless, since even amongst those users who liked to look at
vanilla XML files (developers, mainly), a majority would not -- and
should not have to -- bother doing anything special to see the tree.

`[RFE] Better Default layout for "vanilla" XML documents'
<http://bugzilla.mozilla.org/show_bug.cgi?id=64945>.

--
Matthew `mpt' Thomas, Mozilla UI Design component default assignee thing
<http://mozilla.org/>

Michael Gratton

unread,
Dec 2, 2001, 8:33:39 PM12/2/01
to

Matthew Thomas wrote:

>
> Therefore MSIE's behavior is more correct.

Splitting hairs: more *useful*, not more *correct*. How can you be correctly doing something that is undefined? 8)

> Cool but useless, since even amongst those users who liked to look at
> vanilla XML files (developers, mainly), a majority would not

Okay, okay, I'd still like to see it customizable, however. Maybe once Moz's XSLT support is up to it (if it isn't already) then having a default (but customizable) XSLT stylesheet to transform it into something pretty and renderable would work.

> `[RFE] Better Default layout for "vanilla" XML documents'
> <http://bugzilla.mozilla.org/show_bug.cgi?id=64945>.

Check. I should probably go have a read.

Jason Antony

unread,
Dec 3, 2001, 8:47:52 PM12/3/01
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


Lincoln Ramsay wrote:

> IE5 (on MacOS 9 at least) has a bug where it doesn't display properly
> formatted XHTML 1.0 To get this behaviour on windows, you have to
> give the file a .xml extension.


To see this in action, visit this XHTML 1.0 page in Mozilla/Opera:

http://www.opera.com/pressreleases/xhtml/20011026.xml

Do the same in IE. Now laugh.

No probs with the same page in HTML 4.0 Trans:

http://www.opera.com/pressreleases/20011101.html

This is Opera's response to Microsoft blocking their browser from
MSN.com. Very insightful reading for newbies, old hat for those in the know.

Cheers
Jason


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (MingW32) - WinPT 0.5.1b
Comment: http://www.geocities.com/jemvai777/gpgkey.html

iEYEAREDAAYFAjwMK0AACgkQ/G4MPZc4dZSD0QCdFK6D0zE/T3GwdRRGq7Fk2sn2
tBcAoI0DhwGHZZrQmWeRSCC5RMjBnaBj
=9ch5
-----END PGP SIGNATURE-----

Matthew Thomas

unread,
Dec 12, 2001, 8:28:24 PM12/12/01
to mozilla...@mozilla.org
Michael Gratton wrote:
>
> Matthew Thomas wrote:
> >
> > Therefore MSIE's behavior is more correct.
>
> Splitting hairs: more *useful*, not more *correct*. How can you be
> correctly doing something that is undefined? 8)
>...

By doing what people want and expect, instead of what they don't want or expect.

> > Cool but useless, since even amongst those users who liked to look
> > at vanilla XML files (developers, mainly), a majority would not
>
> Okay, okay, I'd still like to see it customizable, however.

>...

Why?

DeMoN LaG

unread,
Dec 13, 2001, 5:15:43 PM12/13/01
to
m...@mailandnews.com (Matthew Thomas) wrote in
news:3C180438...@mailandnews.com, on 12 Dec 2001:

> Michael Gratton wrote:
>>
>> Matthew Thomas wrote:
>> >
>> > Therefore MSIE's behavior is more correct.
>>
>> Splitting hairs: more *useful*, not more *correct*. How can you be
>> correctly doing something that is undefined? 8)
>>...
>
> By doing what people want and expect, instead of what they don't
> want or expect.
>

So because I want my boss to give me a $10/hr raise, and I work so hard
I expect it, it is correct for him to give me a raise? That logic
doesn't pan out. What people want or expect is irrelavent. What the
rules say is what is important. If the rules say nothing, nothing is
correct or incorrect

--
ICQ: N/A (temporarily)
AIM: FlyersR1 9
email: de_on-lag@ho_e.co_
_ = m

Patrick Gallagher

unread,
Dec 13, 2001, 5:52:05 PM12/13/01
to
DeMoN LaG wrote:

Seems to me, when there is a defined set of rules for something,
anything outside of those rules is extraneous, irrelevant, and
inappropriate. Supporting things that do not follow standards encourages
people to stray from standards, and results in various incompatibilities
- Both Netscape and Microsoft were guilty of this on many occasions
during the "browser wars" and it didn't benefit anyone, it created a
rift in the internet (this site requires...). If you're going to start
adding non-standard features, devise a plan, submit it to the W3C, and
when they recommend it, implement it - until then, worry about getting
the standards that are already in place implemented and working
correctly... There's still a long way to go on that front, and wasting
time supporting things that are not standard seems rather wasteful and
frivolous (on page rendering - UI is a different story).

That being said, the "correct" thing to do is to get the W3C
standards implemented to the fullest. The mozilla team is doing a great
job on this, and although they've still got a ways to go, they've done
better than anyone else has even considered attempting :)

Patrick

Michael Gratton

unread,
Dec 13, 2001, 8:04:09 PM12/13/01
to

Late reply, didn't see your post.. 8/

Matthew Thomas wrote:

>
> By doing what people want and expect, instead of what they don't want or expect.
>


Hmm, I don't know about you, but I don't want to see what MS thinks a
plain XML file looks like, I'd prefer to see it as plain, orninary text,
maybe w/ syntax highlighting.

>
> Why?
>


Mainly for the reason above.

Matthew Thomas

unread,
Dec 23, 2001, 2:28:14 AM12/23/01
to mozilla...@mozilla.org
DeMoN LaG wrote:
>
> m...@mailandnews.com (Matthew Thomas) wrote in
>...
> > Michael Gratton wrote:
>...

> > > Splitting hairs: more *useful*, not more *correct*. How can you be
> > > correctly doing something that is undefined? 8)
>...
> > By doing what people want and expect, instead of what they don't
> > want or expect.
>...

> So because I want my boss to give me a $10/hr raise, and I work so
> hard I expect it, it is correct for him to give me a raise? That
> logic doesn't pan out.

No, but only because your boss has better things he could be doing with
the $10. Mozilla, on the other hand, has nothing better it could be
doing with unstyled XML than showing it as an expandable tree.

> What people want or expect is irrelavent.
> What the rules say is what is important. If the rules say nothing,
> nothing is correct or incorrect

>...

Let me guess, you work for a government agency?

Matthew Thomas

unread,
Dec 23, 2001, 2:32:32 AM12/23/01
to mozilla...@mozilla.org
Michael Gratton wrote:
>...
> Matthew Thomas wrote:
>...

> > By doing what people want and expect, instead of what they don't
> > want or expect.
>
> Hmm, I don't know about you, but I don't want to see what MS thinks a
> plain XML file looks like,

Please lose your fixation with Microsoft. This is nothing to do with
what some company `thinks' a plain XML file looks like; it is everything
to do with what is most useful for users. Showing it as an expandable
tree would be a good idea, *for Mozilla*, no matter how Microsoft chose
to display it.

> I'd prefer to see it as plain, orninary
> text, maybe w/ syntax highlighting.

>...

That's exactly what View Source is for.

DeMoN LaG

unread,
Dec 23, 2001, 2:47:44 PM12/23/01
to
m...@mailandnews.com (Matthew Thomas) wrote in
news:3C25878E...@mailandnews.com, on 23 Dec 2001:
>
> Let me guess, you work for a government agency?
>

I'm a cashier at a food store, actually...

Michael Gratton

unread,
Jan 4, 2002, 12:33:25 AM1/4/02
to
Matthew Thomas wrote:

>
> Please lose your fixation with Microsoft. This is nothing to do with
> what some company `thinks' a plain XML file looks like;


Hey, I have no such fixation; the above comment was made in the context
of discussing the correctness of MSIE's behaviour when it renders an XML
file which specifies no style. I don't believe that discussing whether
it is correct or not constitutes a "fixation".

I was trying to point out that you were (at least trivially) wrong when
you argued that IE's behaviour is correct because it does "... what

people want and expect, instead of what they don't want or expect".

> Showing it as an expandable

> tree would be a good idea, *for Mozilla*, no matter how Microsoft chose
> to display it.


Sure, I have no problem with that, but that was't what what being
discussed, in that part of the post.

Geeze, you really need to lose your overraction fixation. ;)

>
> That's exactly what View Source is for.
>

So what is view source for when viewing a text file? What if a file
containing XML or HTML markup is served as text/plain? Moz renders it as
text and view source displays the same thing as the browser window.

<rant>
The reason Moz applies style to HTML is because the style for HTML is
well known. The HMTL REC defines and suggests style for HTML elements,
and Moz can follow that. Moz can only apply style to XML if it too is
well known (XHTML, SVG, MathML, etc) or if it is specified using, say,
an xml-stylesheet PI. If it has neither then these, then sure, apply
some default style to it. You can't call it correct though, and at least
make it configurable, through a hidden pref or something similar to
userStyle.css or userChrome.css, so people who (sanely enough) don't
like their XML initially displayed as a tree can fix it.
</rant>

Mike.

Matthew Thomas

unread,
Jan 17, 2002, 3:53:17 PM1/17/02
to mozilla...@mozilla.org
Michael Gratton wrote:
>
> Matthew Thomas wrote:
>...

> > Please lose your fixation with Microsoft. This is nothing to do with
> > what some company `thinks' a plain XML file looks like;
>...

> I was trying to point out that you were (at least trivially) wrong
> when you argued that IE's behaviour is correct because it does "...
> what people want and expect, instead of what they don't want or
> expect".

That's not wrong. Computer programs are supposed to do what people want
and expect. That's what they're *for*. If they don't do what a majority
of their users want and expect, they're wrong.

(There are a few caveats with respect to disenfranchising future users
by current actions, but those caveats don't apply here.)

>...


> > That's exactly what View Source is for.
>
> So what is view source for when viewing a text file?

The same thing as for HTML or XML: showing the unadulterated source of
the file. Mozilla currently doesn't do this, which is a major bug.

It just so happens that for text/plain there's *currently* no special
rendering in the browser, so the browser view and the source view are
exactly the same. However, Mozilla's text/plain rendering would be
considerably more useful if it did the same things that it does for
text/plain in e-mail messages -- coloring quoted text, highlighting
*bold* and /italics/, and linking URIs. This would be very useful when
reading text/plain e-zines, for example, since they often link to other
Web pages.

> What if a file
> containing XML or HTML markup is served as text/plain? Moz renders it
> as text and view source displays the same thing as the browser window.

At the moment, yes.

> <rant>
> The reason Moz applies style to HTML is because the style for HTML is
> well known.

No, the reason Mozilla applies style to HTML is because that is what
users expect. Mozilla 1.x applied style to HTML back in the days when
Mosaic and Cello and various other Web browsers had noticable market
share amongst Web users, and to a large extent all the browsers rendered
HTML in different ways. The style certainly was not well known in those days.

> The HMTL REC defines and suggests style for HTML elements,

No, it does not. (There are a few exceptions, mainly media-specific
presentational elements like B and I.)

> and Moz can follow that. Moz can only apply style to XML if it too is
> well known (XHTML, SVG, MathML, etc) or if it is specified using, say,
> an xml-stylesheet PI. If it has neither then these, then sure, apply
> some default style to it. You can't call it correct though,

I can, and do.

> and at
> least make it configurable,

It is configurable. If you want the stream of text, hit Ctrl+U. If you
want the tree, don't hit Ctrl+U.

> through a hidden pref or something similar
> to userStyle.css or userChrome.css, so people who (sanely enough)
> don't like their XML initially displayed as a tree can fix it.
> </rant>

>...

No, because the amount of work required for those masochists who prefer
unstyled XML to appear as a meaningless stream of text to hit Ctrl+U on
those occasions where they felt agitated enough that they really really
did want the meaningless stream of text instead of a slightly less
meaningless and definitely more manipulable pretty tree would be
considerably less than the amount of work required to implement and test
and maintain a hidden pref to control whether or not unstyled XML was
shown as a pretty tree when in the browser rather than the source view.

Hmmm, perhaps I should have drawn that last sentence as a tree.

Mike Gratton

unread,
Jan 19, 2002, 10:11:07 PM1/19/02
to

Matthew Thomas wrote:
>
> That's not wrong. Computer programs are supposed to do what people want
> and expect. That's what they're *for*. If they don't do what a majority
> of their users want and expect, they're wrong.

Arg! This is getting circular. Yes, that was the point you made it a
while back. What I was trying to sa, and I'll say it again, is that
having a browser displaying an unstyled XML document as a tree is *not*
what *I*, and others expect it to do. Don't forget us, we're users too.

Obviously, there are others out there which may (for some unknown
reason) expect it to be displayed as a tree. That's fine, but Moz should
allow the user to make that choice. It doesn't even matter what the
default is, just so long as it is customizable. Even a hidden pref would do.

> The same thing as for HTML or XML: showing the unadulterated source of
> the file. Mozilla currently doesn't do this, which is a major bug.

Eh? How so?

> [snippage: good suggestions for displaying text/plain]


> This would be very useful when
> reading text/plain e-zines, for example, since they often link to other
> Web pages.

Yep, look, I agree. Damm fine idea.

>>containing XML or HTML markup is served as text/plain? Moz renders it
>>as text and view source displays the same thing as the browser window.
>
> At the moment, yes.
>

Ahh, and according to the W3C, that's the way it supposed to be. This is
good behaviour - getting the browser trying to do content sniffing and
ignoring the mime type the server sends leads to a world of pain.

> No, the reason Mozilla applies style to HTML is because that is what
> users expect. Mozilla 1.x applied style to HTML back in the days when
> Mosaic and Cello and various other Web browsers had noticable market
> share amongst Web users, and to a large extent all the browsers rendered
> HTML in different ways. The style certainly was not well known in those days.
>
>
>> The HMTL REC defines and suggests style for HTML elements,
>
> No, it does not. (There are a few exceptions, mainly media-specific
> presentational elements like B and I.)

Just to be a pedantic git, from
<http://www.w3.org/TR/1999/REC-html401-19991224>:

7.4.1, The HEAD element.

"User agents do not generally render elements that appear in the HEAD as
content."

9.2 Structured text.

"Generally, visual user agents present EM text in italics and STRONG
text in bold font."

And so on. In addition, the CSS specs provide sample style sheets for
user agents displaying HTML.

>>You can't call it correct though,
>>
>
> I can, and do.

I can see we're obviously going to disagree on this then. You'e not
convincing me, and I'm not convincing you.

>> and at
>>least make it configurable,
>>
>
> It is configurable. If you want the stream of text, hit Ctrl+U. If you
> want the tree, don't hit Ctrl+U.

Ahh, come on Matthew, configurable my arse. For development work that
will be about as useful as saying to a user, "if you don't want
javascript activated for particular site, go disable it in your prefs,
then when you're done, reenable it". It's a completely useless
suggestion. Also take into account the target audience of people viewing
XML with no explicit or implicit style; developers, not Joe Public.


> No, because the amount of work required for those masochists who prefer
> unstyled XML to appear as a meaningless stream of text to hit Ctrl+U on
> those occasions where they felt agitated enough

I think you'll find that the masochists who get agitated enough are
developers that during the course of building, debugging, testing and
maintaining a web application that uses XML "natively" get sick of
hitting Ctrl-U constantly when wanting to see the raw XML output from
the application.

Like I said, Joe Public won't care if it is or isn't styled as a tree,
they'll think "what the hell??" and hit the back button. Developers are
the only ones who will care about this, they are the only ones who will
benefit from actualle seeing XML in the browser, and the ones who are
most likely to want to be able to apply other default style.

Given this, then replacing the current, useless rendering of XML with a
tree like representation is going to give most developers a marginal
gain because they're going to have to hit Ctrl-U anyway.

> considerably less than the amount of work required to implement and test
> and maintain a hidden pref to control whether or not unstyled XML was
> shown as a pretty tree when in the browser rather than the source view.

I would have though that a good way to implement this would be to just
include some XSLT + CSS Moz's chrome, then have the app use that when
displaying XML with no explicit or implicit style. Then, implementing
the pref is just configuring the URI of the XSLT and CSS. Fairly easy,
I'd imagine, and yep, I'm quite happy to volunteer my services to
implement this, and it looks like that is the approach Heikki has taken
in bug 64945 anyway.

Why are we arguing about this again?

> Hmmm, perhaps I should have drawn that last sentence as a tree.
>

Maybe. 8)

--
Mike Gratton <mi...@vee.net>
"Every motive escalate."
Blatant self-promotion: <http://web.vee.net/>

Reply all
Reply to author
Forward
0 new messages