472,782 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 software developers and data experts.

Validating XML file using multiple Schema files.

Hello all,

My xml and schema file header are as follows.

1) cisGlobals.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.talgov.com/cisGlobals"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cisGlobals="http://www.talgov.com/cisGlobals"
elementFormDefault="unqualified">
<!-- all content -->
</xsd:schema>

2) accountInformationUpdate.xsd
<xs:schema elementFormDefault="unqualified"
attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cisGlobals="http://www.talgov.com/cisGlobals">
<xs:import namespace="http://www.talgov.com/cisGlobals"
schemaLocation="cisGlobals.xsd"/>
<xs:element name="AccountUpdate">
<!-- all content -->
</xs:element>
</xs:schema>

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="http://www.talgov.com/cisGlobals"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.talgov.com/cisGlobals
accountInformationUpdate.xsd">
<!-- all content -->
</AccountUpdate>

Here I am using the namespace of http://www.talgov.com/cisGlobals 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.

murali.
Jul 20 '05 #1
2 3782
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
follows:

<AccountUpdate xmlns:cisGlobals="http://www.talgov.com/cisGlobals"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="accountInformationU pdate.xsd">
<!-- all content -->
</AccountUpdate>

Hope this helps,

ht
--
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: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Jul 20 '05 #2
Thank you Henry, that helped.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

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

Similar topics

4
by: billcoumbe | last post by:
any recommendations? I'm looking for something that will just run from the unix command line to validate large (20-50Mb) XML files against an XML DTD. Ideally something that is actively...
0
by: Aaron P Frenger | last post by:
Hello All, I have a very large XML file that I would like to split up into a few smaller files, but still use only one schema. I am using Xerces C++ libraries. My idea is to have one schema...
4
by: bibsoconner | last post by:
Hi, I hope someone can please help me. I'm having a lot of trouble with schema files in .NET. I have produced a very simple example that uses "include" to include other schema files. It all...
1
by: Wallace | last post by:
Hi all, I have a problem on validating a xml fragment using a single namespace schema which spread across multiple schema files using include in the master schema file. No matter how I change...
0
by: wolf_y | last post by:
I'm a newbie to XML and primarily program in SAS, so even though I've consulted documentation, I can't translate into language I understand. I hope I can explain the problem clearly. The project...
1
by: Chris Lieb | last post by:
I have an XML Schema file that I know is correct becuase I currently use it in a VB6 program to validate XML documents. Also, if I load an XML file into VS2005 that is not valid against this...
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
3
by: vhrao | last post by:
I am trying to validate a xml file with two schema files cust.xsd and cust1.xsd. The schema file cust.xsd allows addition of elements from another schema cust1.xsd by using xs:any wildcard. ...
3
by: jh3an | last post by:
Please give me your advice! I made two files according to xml book, but when validating these two files, it gives me an error that I totally don't understand. Is there a problem in these...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.