473,598 Members | 3,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:cisGlobal s="http://www.talgov.com/cisGlobals"
elementFormDefa ult="unqualifie d">
<!-- all content -->
</xsd:schema>

2) accountInformat ionUpdate.xsd
<xs:schema elementFormDefa ult="unqualifie d"
attributeFormDe fault="unqualif ied"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cisGlobal s="http://www.talgov.com/cisGlobals">
<xs:import namespace="http ://www.talgov.com/cisGlobals"
schemaLocation= "cisGlobals.xsd "/>
<xs:element name="AccountUp date">
<!-- 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
<AccountUpdat e xmlns:cisGlobal s="http://www.talgov.com/cisGlobals"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://www.talgov.com/cisGlobals
accountInformat ionUpdate.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 3861
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:

<AccountUpdat e xmlns:cisGlobal s="http://www.talgov.com/cisGlobals"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "accountInforma tionUpdate.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
3083
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 supported and has good documentation! If there's nothing suitable for Solaris a command line program for Windows might do - currently using XMetaL/XMLSpy parsers which aren't really suited to large files.
0
1202
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 specified in the main file. At certain points in the schema I would add a choice element that would either have a tag that specifies an external file or a tree of tags. Once the main xml file is loaded I would search for any instances where the
4
2282
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 works with SPY, but when I pick "Validate Schema" from the .NET 2003 menu, it fails with message: "Type XType is not declared." As I hinted at in my subject line, I suspect that it has to do with including another schema multiple times.
1
2296
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 the xml fragment (to include default namespace xmlns='urn:xxx:yy' and any other namespace it may have), I still get the same error. 'urn:xxx:yy:Header' element is not declared. An error occurred at , (1, 2).
0
1434
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 I'm currently on starts with XML files (say, 10 as an example) that, after validation, are reconfigured via SAS for Teradata loading. Since we're in development, the location of needed schemas isn't fixed, often moving as phases are completed...
1
2874
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 schema, I get XML errors (blue squigglies) in a few places, which indicates to me that I should get validation errors while validating through code. When I try to validate an invalid document, I never get any validation errors. I have tried many...
5
4946
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
3232
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. cust.xsd - schema <?xml version="1.0" encoding="utf-8" ?> <xs:schema targetNamespace="urn:xmlns:sysapex-com:customer" elementFormDefault="qualified" xmlns="urn:xmlns:sysapex-com:customer" xmlns:mstns="urn:xmlns:sysapex-com:customer"
3
3618
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 codes? I checked xml and schema files through these following sites: http://tools.decisionsoft.com/schemaValidate/
0
7991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8265
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6719
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5850
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3898
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.