Results 1 to 2 of 2
  1. #1
    indus is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default Finding the Xpath of xml document with index

    Hi!
    I'm a newbie poster.
    I'm working with java and xml. I want to find the path of an xml document with index. In this xml,
    <folks>
    <person>
    <name>fgfg</name>
    <phone>999555-8888</phone>
    <email>b@xyz.net</email>
    </person>
    <person>
    <name>saran</name>
    <name>SM</name>
    <phone>213545697</phone>
    <email>indu@abc.com</email>
    </person>
    </folks>

    I have to find the unique xpath for an xml file so that i can insert any new node into the exact path.
    So, if the xpath is with some index such as,
    /folks[0]
    /folks[0]/person[0]
    /folks[0]/person[0]/name[0]
    /folks[0]/person[0]/phone[0]
    /folks[0]/person[0]/email[0]
    /folks[0]/person[1]
    /folks[0]/person[1]/name[0]
    /folks[0]/person[1]/name[1]
    /folks[0]/person[1]/phone[0]
    /folks[0]/person[1]/email[0]

    Can anyone suggest an idea for it?

    Thanks in advance.
    Last edited by indus; 02-04-2010 at 08:47 AM.

  2. #2
    indus is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default

    hi!
    I have found the xpath with index and solve this issue.

Similar Threads

  1. XPATH - Print xml document
    By luca.santaniello in forum New To Java
    Replies: 0
    Last Post: 12-17-2009, 11:46 AM
  2. Validate document starting at xpath
    By sarcasteak in forum Advanced Java
    Replies: 1
    Last Post: 04-16-2009, 02:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •