tags:

views:

17

answers:

1

I am using Stax Implementation SJSXP1.0. As such it has been working great but facing a wierd issue now.

The XML being parsed contain malformded HTML snippets as values of some of the tags. These values are enclosed in CDATA section as we expected CDATA not to be parsed by the parser (as was the case for us with DOM parser which we used sometime back). But when we use STax, parser.next() method fails as following javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1374,10] Message: The end-tag for element type "col" must end with a '>' delimiter

Is there a way for me to tell the parser to ignore CDATA tags completely and just read them as values

A: 

I think there is no possibility to change parser behavior in that way, cause XML format itself is embedded in the parser and you cannot do anything with that. But this doesn't preclude you from catching the exception and making some logic around it.

gasan