Xpath and DOM
Ray Waldin
rwaldin at pacbell.net
Wed Dec 15 10:07:33 GMT 1999
I believe there are a few gotchas with any XPath/XSLT to "pure" DOM L1
mapping, no matter what language or implementaion. Here are a few I've run
into:
1) DOM L1 lacks "real" support for namspace to prefix mapping so you have
to know the exact prefixes used in the documents you process, whereas with
XPath via XSLT namespace prefixes are automagically mapped for you.
2) no support for the XPath namespace axis so you cannot query or select
based on namespace
3) no support for the XSLT document() function. This would be a useful DOM
extension to XPath, but DOM L1 (or L2 for that matter) has no mechanism for
opening a document.
4) DOM does not support ID/IDREFs as it has no concept of attribute types
(this is a function of the parser, not the DOM) which means there's no way
to map the XPath id() function to a pure DOM implementation. Another
WIBN! The Sun parser (ProjectX TR2) has an extension function which
supports ID/IDREFs (XmlDocument.getElementsById() I think), but even this
support is limited to elements which are parsed as opposed to elements
which you construct using the DOM Document.createElement() API.
Anyone know of any others?
-Ray
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list