Hi All,

I'm using the StaxDriver to gain support of namespaces in Xstream.  Really, I 
care that it ignores them when unmarshalling xml.  Anyhow, when unmarshalling 
XML using the StaxDriver / StaxReader I discovered it ignored CDATA tags.  Upon 
investigation I tracked down the issue to the following method on the 
StaxReader:

protected int pullNextEvent() {
       try {
           switch(in.next()) {
               case XMLStreamConstants.START_DOCUMENT:
               case XMLStreamConstants.START_ELEMENT:
                   return START_NODE;
               case XMLStreamConstants.END_DOCUMENT:
               case XMLStreamConstants.END_ELEMENT:
                   return END_NODE;
               case XMLStreamConstants.CHARACTERS:
                   return TEXT;
               case XMLStreamConstants.COMMENT:
                   return COMMENT;
               default:
                   return OTHER;
           }
       } catch (XMLStreamException e) {
           throw new StreamException(e);
       }
   }

The easy fix is to add "case XMLStreamConstants.CDATA" to also return "TEXT".  
Due to the constructor of the StaxReader calling moveDown() I am unable to 
Override the "pullNextEvent()" method to solve this on my own.

I attempted to create a JIRA ticket for this issue but was unable to request an 
account.

Please let me know if there is an alternative Driver to use that will allow me 
to ignore/drop namespaces while unmarshalling that also supports unmarshalling 
and marshaling CDATA.

Thanks,
Keith C Wire
[email protected]<mailto:[email protected]>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to