Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


newbie :eof xpath ancestors ( parent) syntax ?

From: "rvj" <md@----------.--->
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>






transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent