XML Schema and RELAX NG
                Element Comparison
                                      Michael Fitzgerald
      ...
xs:maxExclusive                               rng:param
    xs:maxInclusive                               rng:param
    xs...
RELAX NG Unique Elements
The following tables lists RELAX NG elements for which there is no equivalent or similar XML Sche...
Upcoming SlideShare
Loading in …5
×

XML Schema and RELAX NG Element Comparison

1,616 views

Published on

This document briefly compares XML Schema's 42 elements with RELAX NG's 28 elements. In the table that follows, the first column lists all the XML Schema elements while the second column lists any RELAX NG elements that have a one-to-one relationship, a comparable purpose, or only a roughly similar purpose to XML Schema elements. Elements unique to each language are also listed in separate tables.

Published in: Technology
  • Be the first to comment

XML Schema and RELAX NG Element Comparison

  1. 1. XML Schema and RELAX NG Element Comparison Michael Fitzgerald http://www.overduebooks.net This document briefly compares XML Schema’s 42 elements with RELAX NG’s 28 elements. In the table that follows, the first column lists all the XML Schema elements while the second column lists any RELAX NG elements that have a one-to-one relationship, a comparable purpose, or only a roughly similar purpose to XML Schema elements. Elements unique to each language are also listed in separate tables below. The prefixes in the tables, xs:, rng:, and a:, are associated with the following namespaces: • xs: with http://www.w3.org/2001/XMLSchema • rng: with http://relaxng.org/ns/structure/1.0 • a: with http://relaxng.org/ns/compatibility/annotations/1.0 XML Schema Element RELAX NG Element xs:all rng:interleave, rng:optional xs:annotation a:documentation xs:any rng:anyName, rng:nsName xs:anyAttribute rng:anyName, rng:nsName xs:appInfo a:documentation xs:attribute rng:attribute xs:attributeGroup rng:define xs:choice rng:choice xs:complexContent xs:complexType rng:element, rng:define, rng:ref xs:documentation a:documentation xs:element rng:element xs:enumeration rng:choice, rng:value xs:extension rng:param xs:field xs:fractionDigits rng:param xs:group rng:group, rng:div xs:import rng:externalRef, rng:parentRef xs:include rng:include, rng:externalRef xs:key xs:keyref xs:length rng:param xs:list rng:list 1
  2. 2. xs:maxExclusive rng:param xs:maxInclusive rng:param xs:maxLength rng:param xs:minExclusive rng:param xs:minInclusive rng:param xs:minLength rng:param xs:notation xs:pattern rng:param xs:redefine rng:include, rng:define xs:restriction rng:except, rng:notAllowed xs:schema rng:grammar xs:selector xs:sequence xs:simpleContent xs:simpleType xs:totalDigits rng:param xs:union rng:list xs:unique xs:whiteSpace rng:param XML Schema Unique Elements The following table lists XML Schema elements for which there is no similar or equivalent RELAX NG element (first column) followed by an explanation why (second column). XML Schema Element Explanation xs:complexContent Not necessary in RELAX NG syntax xs:field RELAX NG does not implement keys xs:key RELAX NG does not implement keys xs:keyref RELAX NG does not implement keys xs:notation RELAX NG does not directly support notations xs:selector RELAX NG does not implement keys xs:sequence Not necessary in RELAX NG syntax xs:simpleContent Not necessary in RELAX NG syntax xs:simpleType RELAX NG uses external datatype libraries; types are external xs:unique RELAX NG does not implement keys 2
  3. 3. RELAX NG Unique Elements The following tables lists RELAX NG elements for which there is no equivalent or similar XML Schema element (first column) followed by an explanation why (second column). RELAX NG Element Explanation rng:data Uses the xs:type attribute rng:empty Uses the xs:complexType element rng:interleave XML Schema requires deterministic content models rng:mixed Uses with xs:mixed attribute Achieved with xs:minOccurs="1" and rng:oneOrMore xs:maxOccurs="unbounded" Achieved with xs:minOccurs="0" and rng:optional xs:maxOccurs="1" rng:param Uses facet elements (xs:maxLength, xs:minLength, etc. rng:ref Achieved with the xs:ref attribute rng:start Uses global xs:element declaration rng:text Achieved with xs:type="xsd:string" attribute rng:value Achieved with xs:value attribute Achieved with xs:minOccurs="0" and rng:zeroOrMore xs:maxOccurs="unbounded" 3

×