1 / 9

XML Schema for WIRED

Mark Dönszelmann, Applications for Physics and Infrastructure, IT, CERN XML Detector Description Workshop CERN, 14 April, 2000. XML Schema for WIRED. Contents. XML Schema Features Tools XML-Data Binding Current Status and Implementation. Features (basic). A better DTD, written in XML

Download Presentation

XML Schema for WIRED

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. Mark Dönszelmann, Applications for Physics and Infrastructure, IT, CERN XML Detector Description Workshop CERN, 14 April, 2000 XML Schema for WIRED

  2. Contents • XML Schema Features • Tools • XML-Data Binding • Current Status and Implementation Mark Dönszelmann, CERN/IT Applications for Physics and Infrastructure Group

  3. Features (basic) • A better DTD, written in XML • There is both a DTD and an XSD (recursive) for XML Schema • Basic Concepts • Types • simpleType: boolean, float, double, string, enumeration, ... • complexType: may contain primitives and other elements • reuse simpleType and complexType to type elements and attributes • Annotations, Versions and Comments • Groups of elements or attributes • one of many • all, in order Mark Dönszelmann, CERN/IT Applications for Physics and Infrastructure Group

  4. Features (advanced) • Advanced Concepts • Organization • Schema inclusion • Import of types (from other schema) • Schema location • Types • Cardinality on elements and attributes • Derived Types (Inheritance) • by extension • by restriction • Equivalence of types • Abstract Elements • Other • Uniqueness of elements or attributes • Keys and references Mark Dönszelmann, CERN/IT Applications for Physics and Infrastructure Group

  5. Tools • Any XML Editor will be able to edit XML Schema • IBM Visual XML Tools provide a DTD->Schema converter (as a first start) • Same toolset currently has DTD visualization tools, which may migrate to XML Schema • Same toolset can convert DTD in set of Java Classes (see next slide) Mark Dönszelmann, CERN/IT Applications for Physics and Infrastructure Group

  6. XML-Data Binding • Today using DTD / Schema: • Define a DTD / Schema • Write/generate XML • Use a SAX or DOM parser • Write a set of Classes for your model • SAX: Write code to handle elements and attributes and build objects • DOM: Write code to browse tree and build objects • Sun proposes XML-Data Binding Facility (July 1999) • Java Beans Persistency proposed recently Mark Dönszelmann, CERN/IT Applications for Physics and Infrastructure Group

  7. XML-Data Binding • Schema Compiler • Compiles XML Schemas into a set of Classes • Marshalling Framework • Internally uses SAX/DOM parser • Unmarshals a set XML documents into a set of objects • Marshals a set of objects into a set of XML documents XML Schema Compile Java Classes DefinedBy InstanceOf Unmarshal Java Objects XML Documents Marshal Mark Dönszelmann, CERN/IT Applications for Physics and Infrastructure Group

  8. Current Status and Implementation • XML Schema Standard (Datatypes and Structures) • Defined at the World Wide Web Consortium • Proposed Recommendation, since Dec 1999 • Most recent public draft: 25 Feb 2000 • XML Schema Implementation • Xerces-j 1.0.3 (xml4j, java version) • implements the latest standard • some exceptions: • Unique, key and key ref no supported • limitations on Inheritance • elements, types, … in same namespace • Xerces-c 1.1.0 (xml4c, c++ version) • does NOT yet implement XML Schema Mark Dönszelmann, CERN/IT Applications for Physics and Infrastructure Group

  9. Conclusions • WIRED is based on: • It’s own Loader • One namespace for all the elements • Multiple DTD’s, with some tricks to load them • Our own key keyref implementation • A small pre-SAX Parser • XML Schema will provide WIRED with: • Separate namespaces • Multiple XSD’s, which load properly • Type checking on all the input • A standard key keyref implementation • XML-Data Binding should: • Get rid of the parser and loader • Replace those with a generic one Mark Dönszelmann, CERN/IT Applications for Physics and Infrastructure Group

More Related