Note that there are some explanatory texts on larger screens.

plurals
  1. POCould not find schema information for the element
    primarykey
    data
    text
    <p>I am working on a concept <a href="http://www.irs.gov/efile/" rel="nofollow"><code>EFile</code></a></p> <p>I wrote the sample structure as per specified in the <code>PDF's</code> but i am unable to validate the <code>XML</code> data i am getting the following errors when i execute that <code>XML</code> file.</p> <pre><code>Could not find schema information for the element 'ReturnData'.Validation event Could not find schema information for the attribute 'documentCount'.Validation event Could not find schema information for the attribute 'http://www.w3.org/2001/XMLSchema-Instance:NamespaceSchemaLocation'.Validation event Could not find schema information for the element 'ContentLocation'.Document is invalid </code></pre> <p>Can any one help me on this in-order to resolve my issues.</p> <p>The sample <code>XML</code> is as follows</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ReturnData documentCount="" xsi:NamespaceSchemaLocation="D:\foldername\XML\XMLValidate\ReturnData941.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance"&gt; &lt;ContentLocation /&gt; &lt;/ReturnData&gt; </code></pre> <p>This is my code </p> <pre><code>public void MyValidationEventHandler(object sender, ValidationEventArgs args) { isValid = false; Response.Write("Validation event&lt;br/&gt;" + args.Message); } protected void Button1_Click(object sender, EventArgs e) { string strPath1 = Server.MapPath("test.xml"); XmlTextReader r = new XmlTextReader(strPath1); XmlValidatingReader v = new XmlValidatingReader(r); v.ValidationType = ValidationType.Schema; v.ValidationEventHandler += new ValidationEventHandler(MyValidationEventHandler); while (v.Read()) { // Can add code here to process the content. } v.Close(); // Check whether the document is valid or invalid. if (isValid) { Response.Write("Document is valid"); //Response.Redirect("Product.xml"); } else Response.Write("Document is invalid"); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload