I am getting the following error and none of the reasons listed is true. Any clues? I am using xerces 2.0.2.
Thanks in advance
Eva
org.xml.sax.SAXException: Error:schema_reference.4:
Failed to readschema document 'd:\dev\bmsrc\packages\validate.xsd',
because 1) could not find the document;
2) the document could not be read;
3) the root element of the document is not <xsd:schema>.
Attached is my test case:
Validate.java
BMDefaultHandler.java
validate.xml
validate.xsd (the rest of my xsd files are large so I am not attaching
them)
Validate.java
Description: JavaScript source
BMDefaultHandler.java
Description: JavaScript source
<?xml version="1.0" encoding="UTF-8"?> <soapns:Envelope xmlns:soapns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:test="http://globalimaging.com/xml-namespace/" xmlns="http://globalimaging.com/xml-namespace/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapns:Body> <test:GWSMapRequestMessage xmlns="" xmlns:test="http://globalimaging.com/xml-namespace/"> <GWSMapRequest> <Security> <UserID>mmartin</UserID> <Password>martini</Password> <Account>Ires</Account> </Security> <Request> <Type>GetMap</Type> <BBox> <minX>-101.94191920264</minX> <minY>34.965482006022</minY> <maxX>-101.929041072161</maxX> <maxY>34.9740674263442</maxY> </BBox> <SRS>WGS84</SRS> <Width>1024</Width> <Height>1024</Height> <Products> <Product> <ProdID>100004</ProdID> <WhereClause>xyz</WhereClause> </Product> <Product> <ProdID>100000</ProdID> <WhereClause>xyz</WhereClause> </Product> </Products> <Sytles> <StyleName>Text</StyleName> </Sytles> <OverlapBehaviors>AVERAGE</OverlapBehaviors> <Format>JPG</Format> <BGColor>0x000000</BGColor> <Transparent>false</Transparent> <Quality>MEDIUM</Quality> <Outline_Images>false</Outline_Images> <Config>xyz</Config> <RequestID>IresMapReqId-5.5</RequestID> </Request> </GWSMapRequest> </test:GWSMapRequestMessage> </soapns:Body> </soapns:Envelope>
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://schemas.xmlsoap.org/soap/envelope/" xmlns:test="http://globalimaging.com/xml-namespace/" xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xsd:import namespace="http://globalimaging.com/xml-namespace/" schemaLocation="test.xsd"/> <!-- Envelope, header and body --> <xsd:complexType name="GWSBody"/> <xsd:element name="Envelope" type="tns:Envelope"/> <xsd:complexType name="Envelope"> <xsd:sequence> <xsd:element ref="tns:Header" minOccurs="0"/> <xsd:element ref="tns:Body"/> <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:anyAttribute namespace="##other" processContents="lax"/> </xsd:complexType> <xsd:element name="Header" type="tns:Header"/> <xsd:complexType name="Header"> <xsd:sequence> <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:anyAttribute namespace="##other" processContents="lax"/> </xsd:complexType> <xsd:element name="Body" type="tns:Body"/> <xsd:complexType name="Body"> <xsd:choice> <xsd:element ref="test:GWSMapRequestMessage"/> <xsd:element ref="test:GWSResponse"/> </xsd:choice> <xsd:anyAttribute namespace="##any" processContents="lax"> <xsd:annotation> <xsd:documentation> Prose in the spec does not specify that attributes are allowed on the Body element </xsd:documentation> </xsd:annotation> </xsd:anyAttribute> <!-- we replace the standard SOAP body definition: <xsd:sequence> <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" /> </xsd:sequence> with this: --> </xsd:complexType> <!-- Global Attributes. The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. --> <xsd:attribute name="mustUnderstand" default="0"> <xsd:simpleType> <xsd:restriction base="xsd:boolean"> <xsd:pattern value="0|1"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="actor" type="xsd:anyURI"/> <xsd:simpleType name="encodingStyle"> <xsd:annotation> <xsd:documentation> 'encodingStyle' indicates any canonicalization conventions followed in the contents of the containing element. For example, the value 'http://schemas.xmlsoap.org/soap/encoding/' indicates the pattern described in SOAP specification </xsd:documentation> </xsd:annotation> <xsd:list itemType="xsd:anyURI"/> </xsd:simpleType> <xsd:attributeGroup name="encodingStyle"> <xsd:attribute name="encodingStyle" type="tns:encodingStyle"/> </xsd:attributeGroup> <xsd:complexType name="Fault" final="extension"> <xsd:annotation> <xsd:documentation> Fault reporting structure </xsd:documentation> </xsd:annotation> <xsd:sequence> <xsd:element name="faultcode" type="xsd:QName"/> <xsd:element name="faultstring" type="xsd:string"/> <xsd:element name="faultactor" type="xsd:anyURI" minOccurs="0"/> <xsd:element name="detail" type="tns:detail" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="detail"> <xsd:sequence> <xsd:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:anyAttribute namespace="##any" processContents="lax"/> </xsd:complexType> </xsd:schema>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
