Jump to content
Sign in to follow this  
vishwa.m

XPath for non-root xml

Recommended Posts

Hi,I am very new to this forum. I started learning XPath queries.Can anyone please assist me on how to get elements from an xml which doesn't have a root element. For example:

The xml:

<book id="bk101">
<author>Gambardella, Matthew</author>
<description>with XML.</description>
</book>
<book id="bk201">
<author>Gambardella, Matthew</author>
<description>with XML.</description>
</book>
<book id="bk301">
<author>Gambardella, Matthew</author>
<description>with XML.</description>
</book>
Now I want to get a book element where the book id is bk101.
Thanks in advance,
Vishwanath

Thanks,Vishwanath

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...