Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2829

W3CDOMStreamReader is not compatible with wstx XMLEventReader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.8
    • 2.2.9
    • Core
    • None
    • Mule 2.2.6-snapshot in proxy mode, and WS-Security (wss4j)
      WSTX 4.0.8

    • Novice

    Description

      If you create an XMLEventReader from a W3CDOMStreamReader (with the woodstox library), it will fail because XMLEventAllocator doesnt accept Attribute XMLEvent :

      Caused by: com.ctc.wstx.exc.WstxException: Internal error: should not get [13]
      at com.ctc.wstx.evt.DefaultEventAllocator.allocate(DefaultEventAllocator.java:256)
      at org.codehaus.stax2.ri.Stax2EventReaderImpl.createNextEvent(Stax2EventReaderImpl.java:411)
      at org.codehaus.stax2.ri.Stax2EventReaderImpl.nextEvent(Stax2EventReaderImpl.java:255)

      Here is the comment in wstx source code :

      ------------8<-----------8<-----------8<-----------8<-----------8<------------
      /* Following 2 types should never get in here; they are directly

      • handled by the reader, and can only be accessed via start
      • element.
        */
        case NAMESPACE:
        case ATTRIBUTE:
        throw new WstxException("Internal error: should not get "
        +ErrorConsts.tokenTypeDesc(r.getEventType()));
        ------------8<-----------8<-----------8<-----------8<-----------8<------------

      To create a XMLStreamReader from a DOM Document or Node, i recommand to simply use XMLInputFactory.createStreamReader(source), where source is a DOMSource.

      I think it's better to rely on stax implementation to create a StreamReader from a DOM Node.

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            bugsan sebastien chatel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: