| Author |
XML displayed as raw code in FireFox
|
|
| ironchef 2005-02-16, 4:30 am |
| Please help, this is driving me nuts:
FF displays MY XML in raw code format but display other students same xml
doc properly.
But in IE, my XML is displayed properly.
What is going on ?
thanks
| |
| Martin Honnen 2005-02-16, 6:37 pm |
|
ironchef wrote:
> FF displays MY XML in raw code format but display other students same xml
> doc properly.
There is nothing wrong with displaying the source code (raw format?) of
an XML document, why shouldn't that be proper display?
But Firefox can pretty-print the structure of an XML document but of
course you need to make sure that your server serves the file with the
proper Content-Type header e.g. application/xml to Firefox so that is
recognized as XML. Probably currently the document is served as
text/plain and rendered as such.
If you give us a URL we can check then we can tell you the HTTP headers
but of course you yourself need to make sure your server is configured
properly.
--
Martin Honnen
http://JavaScript.FAQTs.com/
| |
| ironchef 2005-02-16, 6:37 pm |
| "Martin Honnen"
> There is nothing wrong with displaying the source code (raw format?) of
> an XML document, why shouldn't that be proper display?
> But Firefox can pretty-print the structure of an XML document but of
> course you need to make sure that your server serves the file with the
> proper Content-Type header e.g. application/xml to Firefox so that is
> recognized as XML. Probably currently the document is served as
> text/plain and rendered as such.
> If you give us a URL we can check then we can tell you the HTTP headers
> but of course you yourself need to make sure your server is configured
> properly.
Thanks Martin, I am new to XML - I thought if the browser can parse the doc
w/o error
then it should just pretty-print the structure and if not, something is
outta whack
(ie something not configured properly)
so it's the web server huh ? I am surprised as I tried to think that way
cause
it is served out of UNIX-based ISP and they been around for a while
here is the URL
http://www.panix.com/~rchin/xml4www/
| |
| Martin Honnen 2005-02-16, 6:37 pm |
|
ironchef wrote:
> I thought if the browser can parse the doc
> w/o error
> then it should just pretty-print the structure and if not, something is
> outta whack
> (ie something not configured properly)
IE on Win (since IE 5) has used MSXML and XSL to pretty-print XML that
doesn't link to a stylesheet, but not every browser supports XSL or XSLT
so Opera for instance will just render the XML as an unstyled document.
> so it's the web server huh ? I am surprised as I tried to think that way
> cause
> it is served out of UNIX-based ISP and they been around for a while
>
> here is the URL
> http://www.panix.com/~rchin/xml4www/
The file
<http://www.panix.com/~rchin/xml4www/staff2.xml>
is indeed served as text/plain to Mozilla and thus correctly rendered.
But even if you served it as application/xml or text/xml it would not be
pretty-printed with the help of XSL, instead it will be rendered
according to the CSS stylesheet
<http://www.panix.com/~rchin/xml4www/staff.css>
--
Martin Honnen
http://JavaScript.FAQTs.com/
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |