Parsing XML with XPath in Java

Posted by Mg on Stack Overflow See other posts from Stack Overflow or by Mg
Published on 2008-12-04T14:38:28Z Indexed on 2010/05/12 11:24 UTC
Read the original article Hit count: 143

Filed under:
|
|

I have a XML with a structure similar to this:

<category>
   <subCategoryList>
      <category>

      </category>
      <category>
         <!--and so on -->
      </category>
   </subCategoryList>
</category>

I have a Category class that has a subcategory list (List<Category>). I'm trying to parse this XML file with XPath, but I can't get the child categories of a category.

How can I do this with XPath? is there a better way to do this?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about java

Related posts about Xml