XML Development

Moderators: None (Apply to moderate this forum)
Number of threads: 252
Number of posts: 451

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
XML Schema Validation issues Posted by agrotarun on 17 Dec 2012 at 2:46 AM

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_refer" 
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="file:///Users/tarun/schema">

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

<xs:elementname="TestMaster"type="cmn:MasterNode"></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"elementFormDefault="qualified" 
targetNamespace="file:///Users/tarun/schema/v2refer/v2_refer"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cmn="file:///Users/tarun/schema/v2refer/v2_refer"
>
  <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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.