OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Question for the XPath and DOM folks

[ Lists Home | Date Index | Thread Index ]

> You missed the point of the question which is about the 
> difference between the DOM and XPath data models. I know what 
> the answer to the question is based on just the XPath data model. 
> 

Well, the question asked what DOM nodes are returned by an XPath query. The answer is, none: an XPath expression can only return XPath nodes. Any mapping to DOM nodes is up to the vendor (until the DOM XPath API comes out).

But if you change the question to ask "what is the value of count(foo/text())", then the only possible answer is 1, and any product that says otherwise is non-conformant.

MSXML3, when I last looked, was non-conformant in this respect. (See XSLT Programmer's Reference, 2nd Edition, Wrox Press, page 700).

XML Spy, incidentally, only uses whatever XSLT and XPath processors you configure it to use, it does not have its own. So telling us what answer XML Spy gives, without telling us how it is configured, is rather pointless.

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com 

> 
> 	> Given the following XML in a DOM document
> 	> 
> 	> <foo>
> 	> bar
> 	> <![CDATA[
> 	> baz
> 	> ]]>
> 	> quux
> 	> </foo>
> 	>
> 	> and the following XPath
> 	> 
> 	> //text()
> 	> 
> 	> what should be the resulting DOM nodes and why? 





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS