|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Question for the XPath and DOM folks
Well a very interesting point, IMHO if you use Xpath to query a DOM tree you can obtain a) A Xpath nodeset unrelated to the DOM tree b) References to DOM nodes as the nodeset If a) No problem except that you can't use the result of an Xpath query to modify a DOM tree. If b) then the Xpath processor is not Xpath is a sort-of xpathForDom but as we see it can't be a compliant Xpath processor. I might be confused or wrong so I'll wait for an authoritative answer. ----- Original Message ----- From: Dare Obasanjo <dareo@m...> To: Garland foster <garland_foster@s...> Cc: <xml-dev@l...> Sent: Saturday, July 20, 2002 3:53 PM Subject: RE: Question for the XPath and DOM folks > If it returns a nodeset containing one text node should be returned then where does it come from and what is the node's parent? In the DOM the <foo> element has 3 children; 2 text nodes and 1 CDATA node. Your suggestion implies that the XPath query creates a new DOM node. > > Suppose we do create the new node. What happen when we query its parent? If the parent is <foo>, what happens when we ask it for its children do we get our original 3 or the newly created text node? > > I wonder what Jeni's right answer will be... > > PS: I assume this was meant to be sent to the list so I CCed XML-DEV > > -----Original Message----- > From: Garland foster [mailto:garland_foster@s...] > Sent: Sat 7/20/2002 11:46 AM > To: Dare Obasanjo > Cc: > Subject: Re: Question for the XPath and DOM folks > > > > Let's start with the wrong opinions before Jeni says the "right" thing :-) > > In my opnion it should return a nodeset containing one text node with "bar > baz quux" > The spec says that CDATA sections are treated as character data and that a > text > node cannot have a sibling which is also a text node. > > And I might be just finding another XML-SPY xpath bug :-) do you guys see it > returning 3 text nodes ? > > Garland > > PS: You have the dreaded file:// preapended so following my Master-Jedi > (Master-Jeni) > advice I'd say that it returns "invalid xpath expression" :-) > > ----- Original Message ----- > From: Dare Obasanjo <dareo@m...> > To: <xml-dev@l...> > Sent: Saturday, July 20, 2002 3:19 PM > Subject: Question for the XPath and DOM folks > > > > Given the following XML in a DOM document > > > > <foo> > > bar > > <![CDATA[ > > baz > > ]]> > > quux > > </foo> > > > > and the following XPath > > > > file://text() > > > > what should be the resulting DOM nodes and why? I can think of two answers > but they both have problems. > > > > PS: Why is http://www.w3.org/TR/2002/WD-DOM-Level-3-XPath-20020712/ > returning a 404 when it is linked from http://www.w3.org/DOM/ ? > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.373 / Virus Database: 208 - Release Date: 7/4/02 > > > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.373 / Virus Database: 208 - Release Date: 7/4/02
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








