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

x
  • 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">
   <Weight>5.50</Weight>
   <DimensionalWeight>7.192</DimensionalWeight>
   </Weights>

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

http://support.microsoft.com/kb/318504
0

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