473,503 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help-Error validating multiple documents

Hello. I've got a total of 5 schemas. They are:

1 - 1.xsd - a description of a city
2 - 2.xsd - a description of a town
3 - CityHall.xsd - a description of a cityhall-meant to be part of a
document based on 1.xsd in "user area".
4 - TownHall.xsd - a description of a townhall-meant to be part of a
document based on 2.xsd in "user area".
5 - testmultischema.xsd - a document which combines in a batch instances
of cities and towns based upon 1.xsd and 2.xsd.

I get the following xml validation error:

ERROR: The 'http://adamExt.org:TownHall' element is not declared. An
error occur
red at file:///c:/adamtestschema/testmultischema.xml, (21, 4).

in a testmultischema doc that contains both an instance of city and
town. However, if I only have one instance of either in the testmulti
doc, it validates perfectly.

Thanks in advance.

1.xsd
-----

<xsd:schema targetNamespace="http://adam.org"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://adam.org"
elementFormDefault="qualified">
<xsd:element name="City" type="CityType"/>
<xsd:complexType name="CityType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="UserAreaCity" type="UserAreaCityType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="UserAreaCityType">
<xsd:sequence minOccurs="0">
<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

2.xsd
------

<xsd:schema targetNamespace="http://adam.org"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://adam.org"
elementFormDefault="qualified">
<xsd:element name="Village" type="VillageType"/>
<xsd:complexType name="VillageType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="UserAreaTown" type="UserAreaTownType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="UserAreaTownType">
<xsd:sequence minOccurs="0">
<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

testmultischema.xsd
-------------------
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://localhost/adamMulti.org"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://localhost/adamMulti.org"
xmlns:h="http://adam.org"
elementFormDefault="qualified" id="Multiple">
<xs:import namespace="http://adam.org"
schemaLocation="http://localhost/adamtestschema/1.xsd" />
<xs:import namespace="http://adam.org"
schemaLocation="http://localhost/adamtestschema/2.xsd" />
<xs:complexType name="MessageType">
<xs:sequence>
<xs:element name="Id" type="xs:integer" />
<xs:choice>
<xs:element ref="h:City" />
<xs:element ref="h:Village" />
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="MessagesType">
<xs:sequence>
<xs:element name="Message" type="MessageType" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="MultipleType">
<xs:sequence>
<xs:element name="Messages" type="MessagesType" minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:element name="Multiple" type="MultipleType" />
</xs:schema>

instance of testmultischema which fails validation
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Multiple xmlns="http://localhost/adamMulti.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://localhost/adamMulti.org
http://localhost/adamtestschema/testmultischema.xsd">
<Messages>
<Message>
<Id>1</Id>
<City xmlns="http://adam.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://adam.org
http://localhost/adamtestschema/1.xsd">
<name>New York</name>
<UserAreaCity>
<CityHall xsi:schemaLocation="http://adamExt.org
http://localhost/adamtestschema/CityHall.xsd"
xmlns="http://adamExt.org">
City Hall Building
</CityHall>
</UserAreaCity>
</City>
</Message>
<Message>
<Id>2</Id>
<Village xmlns="http://adam.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://adam.org
http://localhost/adamtestschema/2.xsd">
<name>Ramapo</name>
<UserAreaTown>
<TownHall xsi:schemaLocation="http://adamExt.org
http://localhost/adamtestschema/TownHall.xsd"
xmlns="http://adamExt.org">
Town Hall Building
</TownHall>
</UserAreaTown>
</Village>
</Message>
</Messages>
</Multiple>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
0 1267

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
6485
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
9
4374
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
4
3321
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
2
6372
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
7
5343
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
5
3249
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
8
3206
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
10
3327
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
6111
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
2848
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.