Jump to content

xpath question


manishi

Recommended Posts


What XPath expression will find all page elements that contain child page elements within the following XML fragment? <site> <page id="000"/> <page id="001"> <page id="001_000"> <link target="003_000"/> </page> <page id="001_001"/> </page> <page id="002"/> <page id="003"> <page id="003_000"/> <page id="003_001"/> </page></site> A.//page/page B.//page/@page C.//page[count(*) > 0] D.//page


I was thinking of answer "D".just based on theory.Please confirm which is the correct answer.Also if anybody knows how to test these then please let me know.

Link to comment
Share on other sites

You can test XPath expressions by simply creating an XSLT file to style the XML and use the XPath expression in a value-of. How to do that? Normally, I would have offered code, but for your quiz's sake... read.

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
×
×
  • Create New...