interfaced@gmail.com wrote:
> I am trying to include and xml document inside my xhtml document. There
> are a number of reasons for this including portability, multiple
> interface generation, and scalability of information.
Portabiblity? The main browser (or at least one of the major browsers)
is still IE on Win and that does not even support rendering XHTML served
with an XML MIME type (e.g. a generic XML MIME type like application/xml
or the XHTML MIME type application/xhtml+xml). And XML inside XHTML
makes only sense if you have the browser understanding your XHTML as XML
and the other XML being moved in a different namespace with some CSS
support to avoid rendering it.
If you need to load XML data in an HTML document then including it
inline is not portable, load it from a URL then with script methods,
that is much more portable if you use XMLHttpRequest:
<http://www.faqts.com/knowledge_base/view.phtml/aid/6826/fid/616>
> My problem is that javascript is understanding the nodes in my xml
> document as html elements.
>
> <xml>
> <book>
> <title>Lord of the Rings</title>
> </book>
> </xml>
> Is there a way to exclude this xml node from the xhtml rules?
Do you have any specification or documentation suggesting that putting
an element with tag name xml into a document indicates some special
treatment? Neither the HTML 4 nor the XHTML 1.0 specification suggests that.
IE/Win (which as noted above does not render XHTML served with an XML
MIME type) has an extension to its HTML parser where HTML elements (!)
with tag name xml are recognized as so called XML data islands and where
the contents of the XML element is then parsed with MSXML according to
XML rules. But that is not portable at all and has nothing to do with
XHTML you said you want to use.
--
Martin Honnen
http://JavaScript.FAQTs.com/
Received on Sat Dec 3 04:34:42 2005