Announcement Announcement Module
Collapse
No announcement yet.
JAXB Problem: Same element name, different namespace Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JAXB Problem: Same element name, different namespace

    Hi all,

    I have two versions of the same element, with same element name and different namespace.

    Following is the snippet of the XML schema

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema attributeFormDefault="unqualified"
            elementFormDefault="qualified"
    	targetNamespace="http://new.domain.com/schema/job/v1_0"
    	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    	xmlns:tns="http://new.domain.com/schema/job/v1_0"
    >
    	
    <xsd:element name="JobDetails">
    	<xsd:complexType>
    		<xsd:sequence>
            	      <xsd:element name="jobName" type="xsd:string" />
    		</xsd:sequence>
    	</xsd:complexType>
    </xsd:element>
    
    </xsd:schema>
    JAXB is not generating the @XMLType.namespace annotation.

    Can you anyone let me know what I am doing wrong?

    P.S.: I know this is not the right forum, but I have pretty much exhausted all other avenues. Thanks.

  • #2
    simply add the argument -npa to XJC and you should see the namespace appearing.

    Comment

    Working...
    X