Results 1 to 2 of 2

Thread: [RESOLVED] XMLStreamReader problem in parsing an XML

  1. #1

    Thread Starter
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Resolved [RESOLVED] XMLStreamReader problem in parsing an XML

    Hi All,

    I have a XMLStreamReader setup with com.ctc.wstx.stax.WstxInputFactory

    the problematic XML I have has this form
    Code:
    <parent>
     TEXT
     <child1 value="A VALUE" />
     <child2 value="SOME VALUE" />
    </parent>
    When I am at the parent event, and try to get "TEXT" using the reader.getElementText()

    I get an error saying that there is no text but a Start event instead.

    Are there any ways of extracting TEXT value? without having to go to the next event which is child1?

  2. #2

    Thread Starter
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: XMLStreamReader problem in parsing an XML

    Ah found it.

    I just need to check if the Event = XMLStreamConstants.CHARACTERS

    then use getText().


Posting Permissions

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



Click Here to Expand Forum to Full Width