Uploaded image for project: 'JaxMe'
  1. JaxMe
  2. JAXME-45

Namespace prefix is not included after first sibling

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • current (nightly)
    • None
    • None
    • None
    • Windows XP Pro SP 2
      JaxMe 0.3.1
      JDK 1.4.2 04

    Description

      Two schemas car.xsd and engine.xsd are defined with two different targetNamespaces.
      car.xsd imports engine.xsd and defines some elements. The elements are defined either in car.xsd or in engine.xsd.

      Car.xsd is compiled using the buildCarAnt.xml file.
      The generated classes are used in the CarTester.java program.

      The result of CarTester.java is as follows

      <car:car xmlns:car="http://car.aflac.com">
      <car:engine>
      <engine:cylinderCount xmlns:engine="http://engine.aflac.com">6</engine:cylinderCount>
      <engine:cylinder>
      <engine:diameter>12.44</engine:diameter>
      <engine:volume>750.45</engine:volume>
      <engine:valveCount>32</engine:valveCount>
      </engine:cylinder>
      <engine:material>
      <engine:name>Al</engine:name>
      <engine:percentage>90.14</engine:percentage>
      </engine:material>
      </car:engine>
      <car:body>
      <car:style>Coupe</car:style>
      <car:weight>3454.54</car:weight>
      <car:doorCount>2</car:doorCount>
      </car:body>
      </car:car>
      Time to unmarshall it
      [Fatal Error] :4:22: The prefix "engine" for element "engine:cylinder" is not bound.
      javax.xml.bind.UnmarshalException: The prefix "engine" for element "engine:cylinder" is not bound.
      at org.apache.ws.jaxme.impl.JMUnmarshallerImpl.unmarshal(JMUnmarshallerImpl.java:103)
      at org.apache.ws.jaxme.impl.JMUnmarshallerImpl.unmarshal(JMUnmarshallerImpl.java:85)
      at com.aflac.quote.client.simple.CarTester.main(CarTester.java:73)
      Caused by:
      org.xml.sax.SAXParseException: The prefix "engine" for element "engine:cylinder" is not bound.
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.ws.jaxme.impl.JMUnmarshallerImpl.unmarshal(JMUnmarshallerImpl.java:98)
      at org.apache.ws.jaxme.impl.JMUnmarshallerImpl.unmarshal(JMUnmarshallerImpl.java:85)
      at com.aflac.quote.client.simple.CarTester.main(CarTester.java:73)
      --------------------------------------------------------------------------

      <engine:cylinder> and <engine:material> tags are missing the attribute

      xmlns:engine="http://engine.aflac.com"

      I mark this as Blocker because my client cannot unmarshall the XML and I cannot find a workaround.

      Attachments

        1. buildCarAnt.xml
          1 kB
          Dogan Atay
        2. car.xsd
          1 kB
          Dogan Atay
        3. engine.xsd
          0.9 kB
          Dogan Atay
        4. CarTester.java
          2 kB
          Dogan Atay
        5. jaxme-45.patch
          8 kB
          Jochen Wiedmann
        6. jaxme-45-0.3.patch
          10 kB
          Jochen Wiedmann

        Activity

          People

            Unassigned Unassigned
            dardanel Dogan Atay
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: