1. UIMA
  2. UIMA-1817

xml namespace handling in XmiCasDocSerializer / NPE with Saxon in classpath


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.1SDK
    • Component/s: Core Java Framework
    • Labels:
    • Environment:

      Java 1.6.0_20, Saxon9 jars on the classpath


      While experimenting with UIMA I observed a problem similar to the one already posted here: http://tinyurl.com/32spzv9. Since removing Saxon from the classpath was not an option, I found the problem to be the way namespaces are handled in org.apache.uima.cas.impl.XmiCasSerializer$XmiCasDocSerializer.

      First of all, the addAttribute/3 method was incorrectly passing null as uri and localName parameters. According to the javadoc, these must at least be empty strings. I added a hack to extract the localName from the qName, if available.

      Second, the method computeNamespaceDeclarationAttrs/1 only added namespaces as attributes, which are not honored by Saxon. I think this is correct, as the SAX2 standard states that namespaces must be declared via startPrefixMapping/2, so I added that, as well.

      Attached you find a patch with changes which work for me (and seem to solve the problem).


        Marshall Schor made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Adam Lally [ alally ]
        Marshall Schor made changes -
        Fix Version/s 2.3.1SDK [ 12315344 ]
        Fix Version/s 2.3.1 [ 12314751 ]
        Marshall Schor made changes -
        Fix Version/s 2.3.1 [ 12314751 ]
        Adam Lally made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Martin Schaffoener made changes -
        Field Original Value New Value
        Attachment xmicasserializer-namespaces.patch [ 12447802 ]
        Martin Schaffoener created issue -


          • Assignee:
            Adam Lally
            Martin Schaffoener
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: