entry n.50 - 2004/10/04
Updated 2004/10/05-06 and 07
I wrote an archived entries database in XML. I also wrote a DTD and a XSL file to validate and give a presentation to the XML.
It seems to be a nice and tidy way to organize repetitive datas as web log entries. A summary of the entry`s text and a link to the full entry enable the user to scroll through all the entries and select the interesting ones.
XSL offers powerful presentation and manipulation tools.
"The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements."(w3schools)
It works worked offline
on my computer (operating system WIN98SE) but, when published, it only
works with IE6. Firefox gives me an error (now also offline):
"Error loading stylesheet: An XSLT stylesheet does not have an
XML mimetype"
I`m trying to find a solution but all I got so far are explanations like:
" Mozilla requires that the XML and XSLT file holding the stylesheet be sent with an XML mimetype (text/xml or application/xml). This is the most common reason for XSLT not running in Mozilla, as Internet Explorer is not as strict. "
Well, IE may not be as strict, but it doesn`t display transformed
XML if I use <?xml-stylesheet
type="text/xml" href="database.xsl"?> and, anyway,
Firefox gives me again the same error. Tried on the stylesheet <xsl:output
media-type="text/xml" method="xml"/> and on Firefox I got:
"Error loading stylesheet: (null)". The confusing part
of it all is that I wrote the XML
and the XSL
files following the W3schools
tutorial. They use <?xml-stylesheet type="text/xsl"
href="database.xsl"?> and everything is fine. The transformed
XML works nicely
with IE6, Firefox and Netscape7. After becoming increasingly frustrated,
I just copied their files here.
I published them on my server exactly as they are and...they don`t
work anymore!.I get the same error on Firefox as with my files
before.
These are the answers I got from delorie for the HTTP headers of the XML:
HTTP/1.1 200 OK
Date: Thu, 07 Oct 2004 11:06:06 GMT
Server: Apache/1.3.26 (Unix)
Last-Modified: Wed, 06 Oct 2004 02:03:46 GMT
ETag: "11fb7e2-18e2-41635282"
Accept-Ranges: bytes
Content-Length: 6370
Connection: close
Content-Type: text/xml
and XSL files:
HTTP/1.1 200 OK
Date: Thu, 07 Oct 2004 11:04:23 GMT
Server: Apache/1.3.26 (Unix)
Last-Modified: Wed, 06 Oct 2004 01:55:23 GMT
ETag: "11fb7e1-96e-4163508b"
Accept-Ranges: bytes
Content-Length: 2414
Connection: close
Content-Type: text/xsl
Since the XSL Content-Type(MIME) comes back as text/xsl and Firefox needs it to be text/xml I guess the files only work with IE6 and there is no solution (yet).