Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: newbie :eof xpath ancestors syntax with typo corrections newbie :eof xpath ancestors ( parent) syntax ?To: NULL Date: 8/1/2004 7:09:00 PM Im sure this easy but Im not sure ! I want to select nodes from an XML (RDF) but probably understand the syntax for including the containing elements 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 dump it 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 what this refers to ? ******** 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> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
