Jump to content

selectnodes


jojay
 Share

Recommended Posts

Hi,I am in the learning process and I am not able to apply two elements as below:

<script type=text/vbscript>set xmlDoc=CreateObject("Microsoft.XMLDOM")xmlDoc.async="false"xmlDoc.load("books.xml")set nodes=xmlDoc.selectNodes[B]("/bookstore/book[price>35]/price|/book/title")[/B]for each x in nodes  document.write("<xmp>")  document.write(x.xml)  document.write("</xmp>")next</SCRIPT>

Can someone please tell how I will do this? thanks.

Link to comment
Share on other sites

Hi Jojay,What are you trying to return? If you want to return the price and title you can use the following XPath:/bookstore/book[price>35]/(price | title)The result is something like this:<title lang="en">XQuery Kick Start</title><price>50.00</price><title lang="en">Learning XML</title><price>40.00</price>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...