Actually I'm implementing something and know one solution, but want to implement the

Discussion in 'XML' started by Shraddha Kapse, May 5, 2009.

  1. Shraddha Kapse

    Shraddha Kapse

    Joined:
    May 5, 2009
    Messages:
    1
    I have to implement SAX parsing on one xml. In SAX parsing, parser reads XML line by line. So it can look ahead. Now here is my XML structure(Note: Capital letters represent "ELEMENT" and small letters represent some value or attribute).

    <xml>
    <ELEMENT_A_COMPLEX>
    <ELEMENT_B_STR>abc</ELEMENT_B_STR>
    <ELEMENT_C_STR>abc</ELEMENT_C_STR>
    <ELEMENT_D_COMPLEX>
    <ELEMENT_B_STR>abc</ELEMENT_B_STR>
    <ELEMENT_C_STR>abc</ELEMENT_C_STR>
    <ELEMENT_A_COMPLEX>.......</ELEMENT_A_COMPLEX>
    <ELEMENT_A_COMPLEX>.......</ELEMENT_A_COMPLEX>
    <ELEMENT_D_COMPLEX>........</ELEMENT_D_COMPLEX>
    </ELEMENT_D_COMPLEX>
    </ELEMENT_A_COMPLEX>
    </xml>

    as you can see A and D are complex types. I have Classes for them. But they can contain object of type A,D again. So this will be nested tree depending upon XML. Now I want to create a general code which process this xml and create necessary tree with SAX implementation. Right now i'm maintaining an object which contains this,parent and child object and using Reflection API. Is there any better way to implement. Please suggest.
     
    Shraddha Kapse, May 5, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Gagliardi
    Replies:
    1
    Views:
    106
    Ulrich Eckhardt
    May 28, 2013
  2. Andrew Berg
    Replies:
    0
    Views:
    103
    Andrew Berg
    May 26, 2013
  3. Andrew Berg
    Replies:
    0
    Views:
    90
    Andrew Berg
    May 26, 2013
  4. Mark Lawrence
    Replies:
    0
    Views:
    95
    Mark Lawrence
    May 26, 2013
  5. Mark Lawrence
    Replies:
    0
    Views:
    83
    Mark Lawrence
    May 26, 2013
Loading...

Share This Page