I am both producing and parsing an xml document that needs to be validated against a schema. I wanted some consumers of the document
to have the option of not performing a validation, so I left the nodes in the instance unqualified. An example of the document is
below:
<?xml version="1.0" encoding="utf-8" ?>
<filingreceipt xmlns="http://www.disclosureusa.org/filingreceipt.xsd">
<cpofilingnumber>TX2004043037501</cpofilingnumber>
<receiptdate>2004-05-01T16:54:21</receiptdate>
<zipfilebytes>95137</zipfilebytes>
<recipientcode>mactx</recipientcode>
</filingreceipt>
When the xmlns attribute is included in the document, I am able to use the XmlValidatingReader to validate the document. However,
parsing the document fails because the parser is looking for the prefix in the unqualified nodes, and I don't have a prefix to pass
to SelectSingleNode. I don't want to qualify the nodes in the document to keep the document simple, and make validating optional. If
I remove the xmlns attribute, XmlValidatingReader refuses to validate the document.
I want to both validate and be able to parse this document, and don't know how to get both the validator and the parser to
cooperate.