List Info

Thread: XML doc validation against multiple XSD's




XML doc validation against multiple XSD's
user name
2007-04-02 03:25:05

Hi All,

           ; Sorry for the incomplete question.

           ;

           ; I am using libxml 2.2-6 version.

 

           ; I also want to know how to validate xml against multiple XSD’s (one XSD has the reference of other XSD’s).

           ; Following is the sample XSD which contains reference to other XSD’s:

           ;

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>

 &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; <xs:schema xmlns:ts="urn:ietf:paramsml:ns:pidf:timed-status"

 &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; xmlns:pidf="urn:ietf:paramsml:ns:pidf"

 &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; xmlnss="http://www.w3.org/2001/XMLSchema&quot;

 &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; targetNamespace=";urn:ietf:paramsml:ns:pidf:timed-status"

 &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; elementFormDefault=&quot;qualified" attributeFormDefault=&quot;unqualified"&gt;

<xs:import namespace="urn:ietf:paramsml:ns:pidf"/>

 &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; <xs:annotation>

 &nbsp; &nbsp; &nbsp;   &nbsp;  <xs:documentation&gt;

 &nbsp; &nbsp; &nbsp; &nbsp;    Describes timed-status tuple extensions for PIDF.

 &nbsp; &nbsp; &nbsp;   &nbsp;  </xs:documentation>

 &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; </xs:annotation>;

 &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; <xs:element name="timed-status&quot; type=";ts:timed-status"/>

 &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; <xs:complexType name="timed-status">

 &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; <xs:sequence>

 &nbsp; &nbsp; &nbsp;   &nbsp;   <xs:element name=";basic"; type=";pidf:basic" minOccurs=&quot;0"/&gt;

 &nbsp; &nbsp; &nbsp;   &nbsp;   <xs:element name=";note" type=&quot;pidf:note" minOccurs="0&quot;/>

 &nbsp; &nbsp; &nbsp;   &nbsp;   <xs:any namespace="##other" processContents="lax" minOccurs="0&quot;

 &nbsp; &nbsp; &nbsp; &nbsp;     maxOccurs=";unbounded&quot;/>

 &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; </xs:sequence>

 &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; <xs:attribute name="from" type=";xs:dateTime" use="required"/>

 &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; <xs:attribute name="until" type=";xs:dateTime"/>;

 &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; </xs:complexType&gt;

 &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; </xs:schema>

 

 

 &nbsp; &nbsp; &nbsp; &nbsp;   ; Thanks in Advance for your help.

 

Thanks & Regards,

Sai Reddy


From: Sai Thatikonda, TLS-Chennai
Sent: Monday, April 02, 2007 1:47 PM
To: 'xmlgnome.org'
Subject: XML doc validation against multiple XSD's

 

Hi All,

 &nbsp; &nbsp; &nbsp; &nbsp;   ;

 &nbsp; &nbsp; &nbsp; &nbsp;   ; I am getting the following errors while validating the xml against the XSD

 &nbsp; &nbsp; &nbsp; &nbsp;   ;  &nbsp; &nbsp;   ; &nbsp; &nbsp; “;Unable to lookup type ID:http://www.w3.org/2001/XMLSchema”

 &nbsp; &nbsp; &nbsp; &nbsp;   ; and  XSD is as follows

 &nbsp; &nbsp; &nbsp; &nbsp;   ;  &nbsp; &nbsp;   ; &nbsp; &nbsp; <?xml version=&quot;1.0"; encoding=&quot;UTF-8&quot;?>

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  &nbsp; <xs:schema targetNamespace=";urn:ietf:paramsml:ns:pidf"

 &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  xmlns:tns=&quot;urn:ietf:paramsml:ns:pidf"

 &nbsp; &nbsp; &nbsp;  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;   xmlnss="http://www.w3.org/2001/XMLSchema&quot;

 &nbsp; &nbsp; &nbsp;  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;   elementFormDefault="qualified&quot;

 &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  attributeFormDefault=&quot;unqualified">

 

 &nbsp; &nbsp;    ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; <!-- This import brings in the XML language attribute xml:lang-->

 &nbsp; &nbsp;    ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; <xs:import namespace="http://www.w3.org/XML/1998/namespace&quot;

 &nbsp; &nbsp;    ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  schemaLocation="http://www.w3.org/2001/xml.xsd&quot;/>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; 

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  ----------------------------

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  --------------------------------

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   

Thanks & Regards,

Sai Reddy

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )