By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,909 Members | 2,008 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,909 IT Pros & Developers. It's quick & easy.

Validating XML file using multiple Schema files.

P: n/a
Hello all,

My xml and schema file header are as follows.

1) cisGlobals.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace=""
<!-- all content -->

2) accountInformationUpdate.xsd
<xs:schema elementFormDefault="unqualified"
<xs:import namespace=""
<xs:element name="AccountUpdate">
<!-- all content -->

There is no default namespace defined in this schema file, but this is
importing from a schema file which has a target namespace. what would
be the namespace of this schema file.

3) cis.xml
<AccountUpdate xmlns:cisGlobals=""
<!-- all content -->

Here I am using the namespace of this
is the target namespace used in first schema file. How would the
AccountUpdate and rest of the tags would be referred as.

When I try to validate the above files using MSXML4 or .Net XML class
library they fail to validate. But XML SPY validates these files
without any errors. Any ideas?

Thank you for all your help.

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Your second schema document defines names in no namespace. There is
not inheritance of target namespaces from imported schemas. So MSXML
is correct to give an error - the document your xsi:schemaLoc points
to for the cisGlobals namespace is not in fact for that namespace.

One way you could correct this is to change your instance document as

<AccountUpdate xmlns:cisGlobals=""
xsi:noNamespaceSchemaLocation="accountInformationU pdate.xsd">
<!-- all content -->

Hope this helps,

Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail:
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Jul 20 '05 #2

P: n/a
Thank you Henry, that helped.

*** Sent via Devdex ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.