dataislands in mozilla

M

mlybarger

we currently have a heavy dataisland based site and would like to get
it working on mozilla to take advantage of the js debuggers and other
various tools.

there have been various issues along the way. the current issue is with
using document.selectNodes( xpathString ). mozilla doesn't seem to
define this natively, and i can't seem to find a general workable
solution to handle data islands. I found this posting

http://teamcon.com/pub/concepts/mozilla/xml.selectnodes.htm

which seemed to provide some of the selectNodes functionality, but
doesn't seem to work with just a dataisland. i'm not sure if it's the
namespaces or what not that's tripping it up, but some where along the
way, i'm getting a "NS_ERROR_DOM_TYPE_ERR", with a message of "The
expression cannot be converted to return the specified type."

I really think that moving to Sarissa would be more of an undertaking
_right now_ than to patch the current system. Plus, for us performance
is key, and I'm curious about introducing the weight of the Sarissa
library.

i'd be interested in some general discussions about using data islands
with xpath in mozilla as well as any articles on the topic.

thanks.
 
M

Martin Honnen

we currently have a heavy dataisland based site and would like to get
it working on mozilla to take advantage of the js debuggers and other
various tools.
i'd be interested in some general discussions about using data islands
with xpath in mozilla as well as any articles on the topic.

IE is a HTML browser that supports and understands the content type
text/html which is the proper content type for HTML 4. But Microsoft has
extended HTML to have an <xml> element to indicate an XML data island
where the content (or the src) of the XML data island is not handled and
parsed by IE's HTML parser but by the MSXML XML parser. So with IE you
can serve up text/html with some XML data included or linked to and IE
will take care that the HTML is parsed by the HTML parser and the XML
data by an XML parser.
However other browsers (like Mozilla or Opera) do not support that <xml>
element as an extension to HTML and that approach of embedding XML data
in HTML and the two fold approach to parsing (HTML parser for the
text/html document, XML parser for embedded XML data), instead what
happens in those browsers if you serve them a text/html document with
some <xml> element with supposedly XML data content is that the
browser's HTML parser parses everything as HTML tag soup and the <xml>
element and any supposedly XML data elements inside are parsed by HTML
rules as unknown HTML elements.
Therefore in my view if you want a cross browser approach of using XML
data from a text/html document then do not use IE's XML data islands but
use script to load the XML data from an external file (respectively URL)
as that way you have the same parsing rules, HTML parser for your HTML
document, XML parser for the XML data.
See
<http://www.faqts.com/knowledge_base/view.phtml/aid/6826/fid/616>
 
T

Thomas 'PointedEars' Lahn

Martin said:
[...] Microsoft has extended HTML to have an <xml> element to indicate an
XML data island where the content (or the src) of the XML data island is
not handled and parsed by IE's HTML parser but by the MSXML XML parser.
Therefore in my view if you want a cross browser approach of using XML
data from a text/html document then do not use IE's XML data islands but
use script to load the XML data from an external file (respectively URL)
as that way you have the same parsing rules, HTML parser for your HTML
document, XML parser for the XML data.
See
<http://www.faqts.com/knowledge_base/view.phtml/aid/6826/fid/616>

IE does not really support XHTML, but would it be not possible to extend
XHTML in an IE-compatible way that those data islands validate? If yes,
Gecko-based UAs could then use their XML parsing prototypes to parse the
island's data.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top