473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

XmlValidatingReader gives errors from inline schema

Hi there,

I do have a dataset which I use to write a XML file with inline
schema. A second
application should use a XmlvalidatingReader to read the xml file
again.

Now I get errors like: The
'http://tempuri.org/LicenceFile.xsd:LicenceData' element is not
declared.

I'm a bit surprised since it is the inline schema and xml that was
generated by the WriteXml method of the dataset and I didn't change
anything there. I would have expected that schema and xml data do
match when they are created by the dataset method. Did I miss
something ?

below is the xml file with the inline schema:

<?xml version="1.0" standalone="yes"?>
<LicenceFile xmlns="http://tempuri.org/LicenceFile.xsd">
<xs:schema id="LicenceFile"
targetNamespace="http://tempuri.org/LicenceFile.xsd"
xmlns:mstns="http://tempuri.org/LicenceFile.xsd"
xmlns="http://tempuri.org/LicenceFile.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="LicenceFile" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="LicenceData">
<xs:complexType>
<xs:sequence>
<xs:element name="X1" type="xs:string" />
<xs:element name="X2" type="xs:string" />
<xs:element name="X3" type="xs:string" />
<xs:element name="X4" type="xs:string" />
<xs:element name="X5" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<LicenceData>
<X1>038XXXXX0B1</X1>
<X2>69712-XXX-XXXXXX-XXXXX</X2>
<X3>Microsoft(R) Windows(R) Server 2003, Standard Edition</X3>
<X4>3790</X4>
<X5>79XXX60</X5>
</LicenceData>
</LicenceFile>
Nov 12 '05 #1
1 1575
The validating reader "sees" the LicenceFile element before it reads the
inline schema, since it can not validate that element, it would not properly
validate its content i..e LicenceData
"Andreas Palm" <ap***@hotmail.com> wrote in message
news:d0**************************@posting.google.c om...
Hi there,

I do have a dataset which I use to write a XML file with inline
schema. A second
application should use a XmlvalidatingReader to read the xml file
again.

Now I get errors like: The
'http://tempuri.org/LicenceFile.xsd:LicenceData' element is not
declared.

I'm a bit surprised since it is the inline schema and xml that was
generated by the WriteXml method of the dataset and I didn't change
anything there. I would have expected that schema and xml data do
match when they are created by the dataset method. Did I miss
something ?

below is the xml file with the inline schema:

<?xml version="1.0" standalone="yes"?>
<LicenceFile xmlns="http://tempuri.org/LicenceFile.xsd">
<xs:schema id="LicenceFile"
targetNamespace="http://tempuri.org/LicenceFile.xsd"
xmlns:mstns="http://tempuri.org/LicenceFile.xsd"
xmlns="http://tempuri.org/LicenceFile.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="LicenceFile" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="LicenceData">
<xs:complexType>
<xs:sequence>
<xs:element name="X1" type="xs:string" />
<xs:element name="X2" type="xs:string" />
<xs:element name="X3" type="xs:string" />
<xs:element name="X4" type="xs:string" />
<xs:element name="X5" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<LicenceData>
<X1>038XXXXX0B1</X1>
<X2>69712-XXX-XXXXXX-XXXXX</X2>
<X3>Microsoft(R) Windows(R) Server 2003, Standard Edition</X3>
<X4>3790</X4>
<X5>79XXX60</X5>
</LicenceData>
</LicenceFile>

Nov 12 '05 #2

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

Similar topics

2
by: MT | last post by:
Hi, I am currently validating an XML file against a Schema using XMLValidatingReader. The schema actually contains ranges for particular elements and I have been using it to detect range errors...
2
by: Ed Bacon | last post by:
I am a bit puzzled about the differences between XmlTextReader and XmlValidatingReader. I have been able to successfully load a DataSet object from and XML file via the text reader. However,...
1
by: Dmitry Martynov | last post by:
Hi I have a question whether XmlValidatingReader doesn't check keyref constrain (the same with key constraint) or I do smth wrong. I have the following schema <?xml version="1.0"...
3
by: Nuevo Registrado | last post by:
All, I am having a tough time figuring out how to code a simple app to read an xml file and an xsd file and validate the xml file using the xsd without using a namespace for the schema. Help?...
9
by: jason | last post by:
how do you use the XmlValidatingReader to validate an XML document that is passed into the XmlValidatingReader constructor? it looks like the normal process is to use an underlying reader, as...
5
by: Geoff | last post by:
I am using an XMLValidatingReader to validate an XML file received via a web service. I want to verify that the incoming file matches the XML schema. When testing the validation routine, the...
1
by: Bernhard Felkel | last post by:
I have troubles validating XML files with key/keyref constraints. HereĀ“s my schema: <?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"...
1
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST> xml file 2
12
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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...

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.