0

Complete XML Schema:

<xs:schema>
 <xs:element name="Root">
  <xs:element name="Element0" type="xs:string" minOccurs="0" maxOccurs="1"/>
  <xs:element name="Element1" type="xs:string" minOccurs="0" maxOccurs="1"/>
  <xs:element name="Element2" type="xs:string" minOccurs="0" maxOccurs="1"/>
 </xs:element>
</xs:schema>

Subset Sample XML:

<Root>
 <Element1>Sample Text</Element1>
</Root>

How can i validate the sample XML against the provided schema?

  • Possible duplicate of [Validating xml nodes, not the entire document](http://stackoverflow.com/questions/715626/validating-xml-nodes-not-the-entire-document) – Keith Hall Jan 15 '16 at 07:04

1 Answers1

0

The System.Xml.Schema namespace contains the classes to validate XML using XSD.

See this instructions in MSDN:

https://msdn.microsoft.com/en-us/library/bb387037.aspx

Fratyx
  • 5,717
  • 1
  • 12
  • 22