Using xmlvalidatingreader

posted by | Leave a comment

SOM is indispensable for a certain class of application, like a schema editor, where it needs to construct the schema in memory and check the schema's validity according to the WXS specification. The following is a simple customer schema, with a top-level Customer element that has two child elements, First Name and Last Name, and one attribute, Cust ID.

For our Customer schema, the Element Type of the Customer element is Xml Schema Complex Type, First Name element is Xml Schema Datatype, and Last Name element is Xml Schema Simple Type.The Content property of Xml Schema Simple Type denotes whether it is a simple type restriction, list, or union.// Create the simple type for the Last Name element Xml Schema Simple Type last Name Type = new Xml Schema Simple Type(); last Name Type. Content = last Name Restriction; // Associate the elements/attributes with their types first Name Elem.In the customer schema the First Name element's type is the built-in type "string".The Last Name element's type is a named simple type that is a restriction of the built-in type "string", with a max Length facet value of 20.

Leave a Reply

what does absolute dating