1 / 11

Overview of XML Schema

Overview of XML Schema. Greg Alvord Senior Data Architect, RealEC Chairman Architecture Committee. Agenda. Motivation W3C Schema. Motivation For Schema. Why Did MISMO switch from DTD to Schema? W3C Schema did not exist when 2.X Started First goal of V3 was to use schema

corina
Download Presentation

Overview of XML Schema

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Overview of XML Schema Greg Alvord Senior Data Architect, RealEC Chairman Architecture Committee

  2. Agenda • Motivation • W3C Schema

  3. Motivation For Schema • Why Did MISMO switch from DTD to Schema? • W3C Schema did not exist when 2.X Started • First goal of V3 was to use schema • DTD does not have data typing • Most Development tools use schema

  4. DTD does not have data typing • V2 Approach. • Date is a string • Implementation Guide states format • Many developers never saw the IG Poorly formed date data huge drain on productivity. • V3 Approach • Xsd:date data type format same as V2 recommendation. (ISO 8601) • Test by schema validation

  5. Motivation For Schema • Why Should Developers Understand Schema? • Schema is your specifications • Structure • Data Types • Documentation • If your code produces XML • Test your output with schema • If your code accepts XML • Require schema valid input. • Schema validate input • Development • Testing

  6. A Few Best Practices • NEVER make or consume XML as string. • Better to use an XML object in whatever library you are using. • XML Objects usually have a serialized string property. • Best to use data model object and serialize or de-serialize to XML. • Use .NET XSD.exe to read schema write object model. • Use other similar tools in other platforms.

  7. MISMO use of Schema • XSD Extension on published Schema files • xsd: prefix in schema files. • Most data in xsd:element • Security attributes • Connecting attributes • Other attributes. • XML Encryption • XML Signature

  8. MISMO use of Schema • Namespace used • Root file MISMO_3.2.0_B290.xsd <xsd:schemaxmlns="http://www.mismo.org/residential/2009/schemas" targetNamespace=http://www.mismo.org/residential/2009/schemas • Chameleon – xsd:include files • No target namespace • No declared namespace

  9. Namespace • Why does it look like a URL? • URL is kind of URI • http: Means we could, but have not yet, make a page available. • Why does it contain 2009? • Change Namespace with release • Fixed Namespace (X)

  10. MISMO use of Schema • Some data in xsd:attributes • //LOANS/LOAN/@SequenceNumber • //LOANS/LOAN/@LoanRoleType • SubjectLoan – The loan that is the object of the transaction, upon which the receiving business partner will take some action. • RelatedLoan – A loan linked to the subject loan by virtue of being collateralized by the same property. Examples include the loan being refinanced, or a HELOC or other subordinate lien collateralized by the same property as the subject loan.

  11. Sequence And Choice Group • xsd:sequence • Defines order of element children • Order counts • Lexicographically ordered list • Lexicographical order is called “Dictionary order” Capitalizations and white space is ignored. “_” is treated like a space. • xsd:choice • Defines exclusive choice • Comes before other elements

More Related