XML Validation error - Schema validation with xsi:type ignoring Namespace

View: New views
1 Messages — Rating Filter:   Alert me  

XML Validation error - Schema validation with xsi:type ignoring Namespace

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have xsd which has extension point and the extended xsd defines the derived type.
Now I created the xml file which has the type as

<commProfile xsi:type="ext:ASMCommProfile">
          <commProfileType>ASM</commProfileType>
                  <ext:forkingPolicy>Sequential</ext:forkingPolicy>
                  <ext:origApplicationSet>Default Denever Origination</ext:origApplicationSet>
                  <ext:termApplicationSet>Default Denever Termination</ext:termApplicationSet>
                  <ext:userCommunity>Denever</ext:userCommunity>
                   <ext:subscriptionSet>subscriptionSet</ext:subscriptionSet>
 </commProfile>

and I have given xmlns:ext="http://xml.avaya.com/schema/import1" in the element root tag. But when I try to unmarshal the xml, it gives me following error

javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: UndeclaredPrefix: Cannot resolve 'ext:ASMCommProfile' as a QName: the prefix 'ext' is not declared.]

where as if I give namespace as part of the element commprofile tag
<commProfile xsi:type="ext:ASMCommProfile" xmlns:ext="http://xml.avaya.com/schema/import1">   the unmarshalling is successful with the validation.

There is a defect in the JAXB with id 665 (Schema validation with xsi:type ignoring Namespace contexts ) which is fixed in 2.2 EA release but I tried with the same and still I am getting the same error.

Any help/pointers will be great help.
[Message sent by forum member 'amit71077' (to_amitgupta@...)]

http://forums.java.net/jive/thread.jspa?messageID=370446

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...