[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

How to validate an XML Fragment against a Schema using the XMLReader

Using the XMLReader, can someone show me an example of validating an XML Fragment against an XML schema? I want to ensure that the value of this field is valid according the schema.  If this can be done, can you please demonstrate.

My Xml fragment that I want to validate.

   <Weights UOM="PG">

Portion of MYSchema.xsd
<xs:element name="Width">
<xs:documentation>5.9.8 (Ref H30)</xs:documentation>
<xs:restriction base="xs:decimal">
<xs:minExclusive value="0"/>
<xs:totalDigits value="8"/>
<xs:fractionDigits value="4"/>
1 Solution
Ken FayalCommented:
Here is EXACTLY how to do it.


Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now