Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: cannot validate xml with remote schema

From: George Cristian Bina <george@---------.--->
To: SINGH Navpreet <Navpreet.SINGH@-----.--->
Date: 9/14/2007 9:08:00 PM
One schema defines the elements in no namespace and the other in the 
http://a995760/pub/Resources/Validation namespace. In any case the local 
elements are in no namespace thus the remote schema validates something 
like:

<?xml version="1.0" encoding="UTF-8"?>
<loadInstructions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://a995760/pub/Resources/Validation"
    xsi:schemaLocation="http://a995760/pub/Resources/Validation
    test.xsd">
    <test xmlns="">test</test>
    <test1 xmlns="">3</test1>
</loadInstructions>

To have the local elements in the remote schema defined in the same 
namespace as the global element you need something like below:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   targetNamespace="http://a995760/pub/Resources/Validation"
   elementFormDefault="qualified">
   <xs:element name="loadInstructions">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="test"
           type="xs:string"/>
         <xs:element name="test1"
           type="xs:integer"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>
</xs:schema>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com

From studt@f... Fri Sep 14 23:42:55 2007
Received: from wigg


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent