Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can implement the <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.ixmlserializable.aspx" rel="nofollow"><code>IXmlSerializable</code> interface</a> and in the <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.ixmlserializable.readxml.aspx" rel="nofollow"><code>ReadXml</code> method</a> implementation, check for the specific elements that you require, throwing exceptions when you don't find them (or setting whatever notification you need to).</p> <p>If you want to use a schema for validation (to use the <a href="http://www.w3.org/TR/xmlschema-0/#ref6" rel="nofollow"><code>minOccurs</code> and <code>maxOccurs</code> schema attributes</a>, for example), then you can configure the <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmltextreader.aspx" rel="nofollow"><code>XmlReader</code></a> instance to validate against the schema by setting the <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.schemas.aspx" rel="nofollow"><code>Schemas</code> property</a> on the <a href="http://msdn.microsoft.com/en-us/library/tyt9ka3c" rel="nofollow"><code>XmlReaderSettings</code> class</a> that you pass to the <a href="http://msdn.microsoft.com/en-us/library/ms162473.aspx" rel="nofollow"><code>Create</code> method</a> (note there are overloads of <code>Create</code> which take a <a href="http://msdn.microsoft.com/en-us/library/system.io.textreader.aspx" rel="nofollow"><code>TextReader</code></a>, etc.).</p>
 

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