I am trying to validate XML with XSD. The XML has elements in two different namespaces:-
1-"http://schemas.xmlsoap.org/soap/envelope/"
2-urn:Hotel_Reserve
So in Schema I have defined elements Envelop, Header and Body in
"http://schemas.xmlsoap.org/soap/envelope/" namespace and targetNamespace and
imported another schema which is in "urn:Hotel_Reserve" namespace. Here it is:-
<xs:schema
xmlns="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:n1="urn:Hotel_Reserve"
targetNamespace="http://schemas.xmlsoap.org/soap/envelope/"
elementFormDefault="qualified">
<xs:import namespace="urn:Hotel_Reserve"
schemaLocation="BookingRequestBody.xsd"/>
<xs:element name="Envelope">
<xs:complexType>
<xs:sequence>
<xs:element name="Header">
<xs:complexType/>
</xs:element>
<xs:element name="Body">
<xs:complexType>
<xs:sequence>
<xs:element ref="n1S_HotelRes_RQ"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I am using JDK1.5. I am able to validate the XML in a standalone Java program. I suppose
here the Xerces parse is being used which is shipped with JDK itself in
com.sun.org.apache.xerces* package.
The problem is when the same code is deployed in JBoss 4.0.3SP1, I get following
exception:-
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name
'n1S_HotelRes_RQ' to a(n) 'element declaration' component.
It seems that when the code is deployed in JBoss, and the main XSD(which is mentioned
above) is loaded and parsed, the schema in the import section is not loaded. I have
checked the schema are present in the required place.
Any clue where I may be doing wrong?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211117#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...