Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: newbie :eof xpath ancestors syntax with typo corrections >Thread Next - Re: newbie :eof xpath ancestors syntax with typo corrections Re: newbie :eof xpath ancestors syntax with typo correctionsTo: NULL Date: 8/1/2004 9:16:00 PM Have you set: pobjXMLDOC.setAttribute "SelectionLanguage", "XPath" on the document before trying the selectNodes()? I believe that MSXML4 defaults to the XPattern syntax making the XPath your are using invalid (doesn't support axes). Chris. "rvj" <md@r...> wrote in message news:Orwjo9$dEHA.4048@T...... Corrected Version : I want to select nodes from an XML file (RDF) but I dont understand the syntax for including the containing elements into the node set For example, if I use var nodes = xmldoc.selectNodes("//RDF:Description[@role:area='US']"); I get valid results for the US apart from the fact I havent generated any containing elements especially the root node so I assume I need something like var nodes = xmldoc.selectNodes("//RDF:Description[@role:area='US']/ancestor-or-self::*") ; or var nodes = xmldoc.selectNodes("//ancestor-or-self::RDF:Description[@role:area='US']"); and then simply dump the xml using for (i=0;i<nodes.length;i++ ) { Response.write(nodes.nextNode().xml) } but all my attempts generate token errors in my asp page Expected token 'eof' found ':'. Any ideas? ******** input file ******** <?xml version="1.0"?> <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:role="http://www.rolemodels.net/rdf#"> <RDF:Seq about="search:providers"> <RDF:li> <RDF:Description role:area="US" role:body="Excute" /> <RDF:Description role:area="US" role:body="Yahoo Corp" /> <RDF:Description role:area="UK" role:body="Yahoo Limited" /> </RDF:li> </RDF:Seq> </RDF:RDF> ************ required output ************* <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:role="http://www.rolemodels.net/rdf#"> <RDF:Seq about="search:providers"> <RDF:li> <RDF:Description role:area="US" role:body="Excute" /> <RDF:Description role:area="US" role:body="Yahoo Corp" /> </RDF:li> </RDF:Seq> </RDF:RDF> --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.732 / Virus Database: 486 - Release Date: 29/07/2004 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
