Results 1 to 3 of 3

Thread: Parsing XML

  1. #1
    techie is offline Member
    Join Date
    Dec 2010
    Rep Power

    Default Parsing XML

    Hi All,

    I'm facing an issue while parsing the xml given below.


    In the above example, the Element1 node has text content 'Test1' followed by a child node Element2 and then text 'Test2'.

    I'm using SAX parser to parse the xml and obtain a node(HashNode) representation of the xml to regenerate the message later.
    The problem I'm facing is while setting the value for the Element1.
    the Element1 node takes only one value, so the value is getting replaced.

    I don't want to use DOM parser as it's a small xml file and there might be performance issues.

    Also, I want to make sure that the order of the nodes is not affected. i.e Test1 followed by Element2 and then Test2.

    Can anyone please guide me?

  2. #2
    rauff is offline Member
    Join Date
    May 2010
    Rep Power


    Try to use XPath component :)
    Check this tutorial in roseindia

  3. #3
    munish is offline Member
    Join Date
    Jul 2009
    Rep Power


    you can use dom xml parser there is no question of any performance issues it is best for small as well as for large xml files.
    Last edited by munish; 02-07-2011 at 10:07 AM.

Similar Threads

  1. Parsing
    By Matt Sakko in forum New To Java
    Replies: 14
    Last Post: 03-21-2009, 05:49 PM
  2. Xml Parsing
    By Nomad in forum XML
    Replies: 12
    Last Post: 02-22-2009, 12:19 PM
  3. xml parsing help
    By tankhardrive in forum XML
    Replies: 2
    Last Post: 02-12-2009, 12:45 AM
  4. xml parsing
    By gaurav65176 in forum XML
    Replies: 5
    Last Post: 11-12-2008, 12:07 PM
  5. Parsing URL
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-26-2007, 11:16 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