A
Axe
Sorry about the crossposting but I think my question validly fits in both
categories and insight from experts would be extremely useful.
I populate a dataset from my database. I then create an XML file using the
dataset's WriteXml() method.
In a seperate application, I'd like to read that XML file back into a
dataset but before I do this I'd like to validate it to ensure that the
elements fit a predefined XSD schema.
I know I can use the XmlValidatingReader for this but my XML file references
no schema. The framework just created an XML file with a root element
(NewDataSet) with no attributes and then each table is a child element
(Table, Table1...), etc.
So my question is this....do I have to programatically add the namespace and
schema attributes to the root element or is there some way I can use
WriteXML() to include the related schema? I do not, however, wish to
include an inline schema since this does not validate properly as the schema
is a child element to the root element.
Bottom line: How can I use the XmlValidatingReader to validate an XML file
generated from a dataset's WriteXml method?
Axe
categories and insight from experts would be extremely useful.
I populate a dataset from my database. I then create an XML file using the
dataset's WriteXml() method.
In a seperate application, I'd like to read that XML file back into a
dataset but before I do this I'd like to validate it to ensure that the
elements fit a predefined XSD schema.
I know I can use the XmlValidatingReader for this but my XML file references
no schema. The framework just created an XML file with a root element
(NewDataSet) with no attributes and then each table is a child element
(Table, Table1...), etc.
So my question is this....do I have to programatically add the namespace and
schema attributes to the root element or is there some way I can use
WriteXML() to include the related schema? I do not, however, wish to
include an inline schema since this does not validate properly as the schema
is a child element to the root element.
Bottom line: How can I use the XmlValidatingReader to validate an XML file
generated from a dataset's WriteXml method?
Axe