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

XmlValidatingReader gives errors from inline schema

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.