Quantcast
Viewing all articles
Browse latest Browse all 2703

XML Schema Validation issues


Hi 

I need some help regarding XML Schema Validation. 

I am struck with XSD validation issues when I try to reference other schema in base schema.

I am getting the error message "src-resolve: Cannot resolve the name 'cmn:MasterNode' to a(n) 'type definition' component."

Stripped Version of Schema Design is listed below

1. Base Schema file (v21.xsd) references element "MasterNode" of the schema v2_refer.xsd . On validation of schema , gets the error message as listed above
<xs:schemaattributeFormDefault="unqualified"
elementFormDefault="qualified"
xmlns:cmn="file:///Users/tarun/schema/v2refer/v2_r efer" 
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="file:///Users/tarun/schema">

<xs:importnamespace="file:///Users/tarun/schema/v2 refer/v2_refer"schemaLocation="/Users/tarun/schema /v2refer/v2_refer.xsd"/>

<xs:elementname="TestMaster"type="cmn:MasterNode">&lt ;/xs:element>
<xs:elementname="ROOT">

<xs:complexType>
<xs:sequence>
<xs:elementname="NOD">
<xs:complexType>
<xs:sequence>
<xs:elementname="Nod"maxOccurs="10">

</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


2) Schema that is being referenced is defined below
<xs:schemaattributeFormDefault="unqualified"elemen tFormDefault="qualified" 
targetNamespace="file:///Users/tarun/schema/v2refe r/v2_refer"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cmn="file:///Users/tarun/schema/v2refer/v2_r efer"
>
  <xs:elementname="MasterNode">
    <xs:complexType>
      <xs:sequence>
        <xs:elementtype="xs:string"name="Tomcat"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

 
</xs:schema>

Any help will be highly appreciated.


Thanks,
Tarun

Viewing all articles
Browse latest Browse all 2703

Trending Articles