|
|
|
|
XML Validation error - Schema validation with xsi:type ignoring Namespace
Posted:
Nov 4, 2009 2:59 AM
|
|
|
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.
|
|