Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2273

Namespace problem when serializing from JAXB 2.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Invalid
    • 2.7
    • None
    • Serialization, Xalan
    • None
    • Windows XP Pro
      java version "1.5.0_06"
      JAXB 2.0 EA3
      Xerces 2.7.1
      Xalan 2.7.0 and trunk

    Description

      The marshalling of a JAXB object created by the parsing of XML data with the Xerces parser
      gives two differents results if the classpath contains only xerces.jar or if it contains xerces.jar, xalan.jar and serializer.jar.

      1) Classpath with xerces only :
      [java] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      [java] <dataDetail xmlns="http://my.namespace.com/a" name="datadetail-001">
      [java] <data id="data-001">
      [java] <n:test xmlns:n="http://my.namespace.com/n">data</n:test>
      [java] </data>
      [java] <data id="data-002">
      [java] <n:test xmlns:n="http://my.namespace.com/n">data</n:test>
      [java] </data>
      [java] </dataDetail>

      2) Classpath with xerces, xalan and serializer :
      [java] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      [java] <dataDetail xmlns="http://my.namespace.com/a" name="datadetail-001">
      [java] <data id="data-001">
      [java] <n:test xmlns:n="http://my.namespace.com/n">data</n:test>
      [java] </data>
      [java] <data id="data-002">
      [java] <test xmlns:ns2="http://my.namespace.com/a" xmlns="" xmlns:n="http://my.namespace.com/n">data</test>
      [java] </data>
      [java] </dataDetail>

      I've make test with the released and with the trunk versions of Xalan.

      First, I had posted this bug on the JAXB issue tracker but the JAXB team investigations indicated that the problem came from Xalan.

      I've a full test case that you could run with ANT. I will try to attach it.

      Attachments

        1. jaxb-test.zip
          8.13 MB
          Golgoth 14

        Activity

          People

            Unassigned Unassigned
            golgoth14 Golgoth 14
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: