iqpc canada xml 2001: how to develop syntax and xml schema
TRANSCRIPT
![Page 1: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/1.jpg)
How to develop Syntax and XML Schema
Ted LeungChairman, ASF XML PMC
Principal, Sauria Associates, [email protected]
![Page 2: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/2.jpg)
Thank You
n ASFn Xerces-J-Devn Xerces-J-User
![Page 3: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/3.jpg)
Outlinen Overviewn xml.apache.org projectn Business / Technical motivation for XML
Scheman Coverage of Key XML Schema Featuresn Alternative Schema Languages
![Page 4: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/4.jpg)
Apache Software Foundationn Non-profit foundation
n volunteers
n Open Source Softwaren Apache License
n Not viral like GPLn Commercial Use is fine
n Projectsn Web Servern jakarta.apache.org
n JSP, Servlets, Ant, Struts, Server Frameworks
n xml.apache.org
![Page 5: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/5.jpg)
xml.apache.orgn Part of the Apache Software Foundationn Open Source XML processing
componentsn XML Parser [Xerces] (Java, C++, Perl) n XSLT processor [Xalan] (Java, C++)n XSL Formatting Objects [FOP]n SVG [Batik]n Cocoonn SOAP [Apache-SOAP / Axis]
![Page 6: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/6.jpg)
Business Motivationn XML is a language of agreementsn We needed a way to specify those
agreements in more detail – raises the level of discourse between applications
n We needed a way for machines to be able to do more with those agreements
![Page 7: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/7.jpg)
Technical Motivationn Three major needs leading up to XML
Scheman Strong data typing of element content and
attributes – push more validation into the XML infrastructure
n Integration of namespaces into grammarsn Use of XML syntax to describe the
grammar
![Page 8: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/8.jpg)
When would you use Schema?n You have rich data types [typing]n You need open content models
[wildcards]n You need to combine data from multiple
organzations [namespaces]n You are mapping from database
[uniqueness]
![Page 9: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/9.jpg)
Example Schema Applicationsn SOAP / WSDLn XSLT 2n XFormsn Many more to come
![Page 10: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/10.jpg)
XML Schema Specificationn W3C Recommendation as of 5/2/2001n Three documents:
n XML Schema Part 0: Primern XML Schema Part 1: Structuresn XML Schema Part 2: Datatypes
n Support in Xerces-J 1.4+
![Page 11: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/11.jpg)
Type System Design Featuresn Elements and attributes have explicit
typesn Types can be defined independentlyn Definitions
n Globaln Local/Anonymous
![Page 12: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/12.jpg)
Two kinds of typesn Simple types
n describe character data
n Complex typesn Can have attributesn Can have content models (elements)
![Page 13: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/13.jpg)
Example of simple type
<schema xmlns='http://www.w3.org/2001/XMLSchema'>
<element name='withdraw' type="integer“/>
</schema>
![Page 14: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/14.jpg)
Simple typesn Lexical Spacen Value Spacen Facetsn Primitive built-in types
n XML 1.0 typesn String, boolean, numbers, dates, times
![Page 15: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/15.jpg)
Creating new simple typesn Restriction
n <schema xmlns='http://www.w3.org/2001/XMLSchema'><element name='withdraw'><simpleType><restriction base='integer'><minInclusive value="0"/>
</restriction></simpleType></element></schema>
n Some built in types are restrictions of primitive types
![Page 16: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/16.jpg)
Facetsn Numeric range restriction
n Miniumum and maximumn Inclusive / exclusive
n Enumerationn Explicit enumeration
n Pattern – regular expressionsn Constrains strings
![Page 17: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/17.jpg)
Atomic vs non-Atomic typesn Atomic Typesn List
n <schema xmlns='http://www.w3.org/2001/XMLSchema'><element name='friends'><simpleType><list itemType='string'/></simpleType></element></schema>
n Union
![Page 18: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/18.jpg)
Example of complex type<schema xmlns='http://www.w3.org/2001/XMLSchema'><element name='withdraw'><complexType><simpleContent>
<extension base='integer'><attribute name='currency‘ type='string'
default='us'/></extension>
</simpleContent></complexType>
</element></schema>
![Page 19: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/19.jpg)
Complex typesn Carry attributesn Can have child element contentn Can be derived from simple types
![Page 20: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/20.jpg)
Content Modelsn Complex types have content models to
describe nested elements, etc.n Content Model types
n SimpleContent – just contentn element only contentn ComplexContent – type derivationn Mixed Content – elements and contentn Empty content
![Page 21: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/21.jpg)
Element Only Contentn <schema
xmlns=‘http://www.w3.org/2001/XMLSchema’><complexType name=‘person’><sequence><element name=‘name’ type=‘string’/><element name=‘age’ type=‘positiveInteger’>
</sequence></complexType></schema>
![Page 22: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/22.jpg)
Compositorsn Three compositors
n <sequence>n <choice>n <all>
![Page 23: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/23.jpg)
Mixed Contentn Stricter than XML 1.0 – order and
number of child elements countsn Attribute on complexType or
complexContent
![Page 24: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/24.jpg)
Example of Mixed Content<schema xmlns='http://www.w3.org/2001/XMLSchema'><element name='boilerplate'><complexType mixed='true'> <all>
<element name='heading' type='string'/><element name='version' type='decimal'/><element name='email' type='string'/>
</all></complexType>
</element></schema>
![Page 25: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/25.jpg)
Empty Content<schemaxmlns='http://www.w3.org/2001/XMLSchema' ><complexType name=‘void’><attribute name=‘size’ type=‘integer’/></complexType></schema>
![Page 26: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/26.jpg)
minOccurs/maxOccursn How do I specify how many times an element
occurs?
<schemaxmlns='http://www.w3.org/2001/XMLSchema' ><complexType name=‘friend’><element name=‘lastName’ type=‘string’/><element name=‘firstName’ type=‘string’/></complexType><element name=‘friends’><sequence><element name=‘friend’ minOccurs=‘0’
maxOccurs=‘unbounded’/></sequence>
</schema>
![Page 27: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/27.jpg)
Attributesn Use any simple type
<attribute name=‘delayed’ type=‘boolean’use=‘optional’ default=‘false’/>
<attribute name=‘ranking’type=‘positiveInteger’use=‘required’/>
![Page 28: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/28.jpg)
ComplexType Extensionn Add to end of type
<schema xmlns='http://www.w3.org/2001/XMLSchema'><complexType name='personType'><sequence><element name='name' type='string'/><element name='father' type='string'/></sequence></complexType>
![Page 29: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/29.jpg)
ComplexType Extension<complexType name='parentType'><complexContent><extension base='personType'>
<sequence><element name='child' type='string'/></sequence>
</extension></complexContent>
</complexType><element name='person' type='personType'/><element name='parent' type='parentType'/> </schema>
![Page 30: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/30.jpg)
ComplexType Restriction 1n Must state restriction
<schema xmlns='http://www.w3.org/2001/XMLSchema'><complexType name='personType'><sequence><element name='name' type='string'/><element name='father' type='string'/></sequence>
</complexType>
![Page 31: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/31.jpg)
ComplexType Restriction 2<complexType name='orphanType'><complexContent><restriction base='personType'><sequence><element name='name' type='string'/></sequence></restriction></complexContent>
</complexType>
<element name='person' type='personType'/><element name='orphan' type='orphanType'/> </schema>
![Page 32: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/32.jpg)
Modularity constructsn <group>
n For Content Models
n <attributeGroup>n For attributes
![Page 33: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/33.jpg)
Modularity Example<schema xmlns='http://www.w3.org/2001/XMLSchema'><group name='phoneNumber'><sequence><element name='areaCode' type='positiveInteger'/><element name='number' type='string'/> </sequence>
</group><attributeGroup name='callingAttributes'><attribute name='callingCard' type='string'/>
</attributeGroup><element name='ISP'><complexType><group ref='phoneNumber'/><attributeGroup ref='callingAttributes'/></complexType>
</element></schema>
![Page 34: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/34.jpg)
Modularity vs inheritancen Kohsuke Kawaguchin Model groups simulate inheritance,
since they nestn Restriction forces you to write it all out,
so this is a model group as welln Checking model groups is much easier
than checking inheritance
![Page 35: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/35.jpg)
Includen For physical modularity of a scheman Definitions in the same target
namespacen <include
schemaLocation=‘http://www.schemas.com/fragment.xsd’/>
![Page 36: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/36.jpg)
Target Namespacesn To put a set of definitions into a
namespace…
<schema xmlns='http://www.w3.org/2001/XMLSchema'targetNamespace='http://www.sauria.com/Schemas/Tutorial/target'>
<element name='withdraw' type="integer“/></schema>
![Page 37: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/37.jpg)
Import n Mix types from different namespacesn Simple types can be used
n Must be global
n Complex types can be usedn Named, global types only
n Import element must appear first in schema
n Can also import and redefine imported items
![Page 38: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/38.jpg)
Import Example 1<schema
xmlns='http://www.w3.org/2001/XMLSchemaxmlns:beers='http://www.sauria.com/Schemas/Tutorial/importee'targetNamespace='http://www.sauria.com/Schemas/Tutorial/importee‘elementFormDefault=‘qualified’><complexType name='importedBeer'><sequence><element name='color' type='string'/><element name='alcohol' type='decimal'/></sequence>
</complexType></schema>
![Page 39: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/39.jpg)
Import Example 2<schema
xmlns='http://www.w3.org/2001/XMLSchema‘xmlns:importedBeerSchema='http://www.sauria.com/Schemas/Tutorial/importee‘targetNamespace='http://www.sauria.com/Schemas/Tutorial/importer‘elementFormDefault=‘qualified’>
<import namespace='http://www.sauria.com/Schemas/Tutorial/importee‘ schemaLocation='importee.xsd'/>
<element name='beer‘type='importedBeerSchema:importedBeer'/>
</schema>
![Page 40: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/40.jpg)
XML Schema Instance NSn XML Schema Instance Namespace
n URI is http://www.w3.org/2001/XMLSchema-instance
n Prefix is xsin type
n Force an element to be associated with a particular type
n <person xsi:type=‘parent’/>
n niln For values that can be nil/null, specify the nil
value.
![Page 41: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/41.jpg)
xsi:nil Example<schema xmlns='http://www.w3.org/2001/XMLSchema'><complexType name='personType'><sequence><element name='name' type='string'/><element name='father' type='string'/></sequence>
</complexType><element name='person' type='personType' nillable='true'/>
</schema>
<personxmlns:xsi=‘http://www.w3.org/2001/XMLSchema-instance’xsi:noNamespaceSchemaLocation='nil.xsd' xsi:nil='true'/>
![Page 42: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/42.jpg)
Wildcardsn How do I leave a schema open for
extension?n “Any element from namespace x,y or z”n “Any element from a namespace
besides this one”n “Any element from a schema in no
namespace”n “Any element from any namespace”n Similarly for attributes
![Page 43: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/43.jpg)
Wildcard Example 1<schema xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:ann='http://www.sauria.com/Schemas/Tutorial/annonate'targetNamespace='http://www.sauria.com/Schemas/Tutorial/annonate‘elementFormDefault=‘qualified’>
<complexType name='annotated'><sequence><element name='partName' type='string'/><element name='partNo' type='integer'/><element name='annotation' type='ann:annotation'/>
</sequence></complexType>
![Page 44: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/44.jpg)
Wildcard Example 2<complexType name='annotation'><sequence><any namespace='http://www.w3.org/1999/xhtml' processContents='lax'/></sequence></complexType>
<element name='part' type='ann:annotated'/></schema>
![Page 45: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/45.jpg)
Annotationn A standard way to document schemasn <documentation> – for humansn <appinfo> – for programsn <annotation>
<documentation>text here</documentation><appinfo><rdf-loc>http://www.schemas.com/rdf</rdf-loc></appinfo></annotation>
![Page 46: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/46.jpg)
Uniquenessn “I want to ensure that the value of an
element <foo> is unique”n In what scope? There may be two
elements named <foo>, each children of two different elements
n Specify the scope using XPath
![Page 47: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/47.jpg)
Unique Example 1<schema xmlns='http://www.w3.org/2001/XMLSchema'><complexType name='bookType'><sequence><element name='title' type='string'/><element name='ISBN' type='string'/></sequence>
</complexType>
<element name='books'><complexType><sequence><element name='book' type='bookType'
maxOccurs='unbounded'/></sequence></complexType>
</element>
![Page 48: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/48.jpg)
Unique Example 2<unique name='isbn'><selector xpath='books/book'/><field xpath='ISBN'/>
</unique></schema>
![Page 49: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/49.jpg)
Keys<schema xmlns='http://www.w3.org/2001/XMLSchema'><complexType name='bookType'><sequence><element name='title' type='string'/><element name='ISBN' type='string'/></sequence>
</complexType>
<complexType name='cardCatalog'><sequence><element name='cardNumber' type='string'/></sequence>
</complexType>
![Page 50: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/50.jpg)
Keys Example 1<element name='books'><complexType><sequence>
<element name='book' type='bookType' maxOccurs='unbounded'/>
<element name='catalogCard'type='cardCatalog' maxOccurs='unbounded'/></sequence></complexType>
</element>
![Page 51: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/51.jpg)
Keys Example 2<unique name='isbn'>
<selector xpath='books/book'/><field xpath='ISBN'/>
</unique>
<key name='card'><selector xpath='books/book'/><field xpath='ISBN'/>
</key>
<keyref name='cardRef‘ refer=‘card’><selector xpath='books/catalogCard'/><field xpath='cardNumber'/>
</keyref></schema>
![Page 52: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/52.jpg)
Referencing a scheman <?xml version="1.0" encoding="UTF-8"?>
<withdrawxmlns:xsi=‘http://www.w3.org/2001/XMLSchema-instance’xsi:noNamespaceSchemaLocation='simple.xsd'>25</withdraw>
n <?xml version="1.0" encoding="UTF-8"?><bank:withdrawxmlns=‘http://www.schemas.com/bank’xmlns:xsi=‘http://www.w3.org/2001/XMLSchema-instance’xsi:schemaLocation=‘http://www.schemas.com/bank simple.xsd'>25</bank:withdraw>
![Page 53: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/53.jpg)
Tool supportn Xerces-J [ REC ]n XSV [ REC ]n Oracle XML Parser [ PR ]n MSXML 4.0 [ PR ]
![Page 54: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/54.jpg)
Cool Tool Tricksn Use XSLT on your Scheman Data Binding
![Page 55: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/55.jpg)
Alternatives to XML Scheman Some people feel XML Schema is too
complicatedn Relax => TREX => Relax NG
n Relax (Murata Makoto)n Relax Verifier
n TREX (James Clark)n JTREX
n Relax NG (OASIS)n Jing
![Page 56: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/56.jpg)
Relax NGn Uses XML Instance Syntaxn Supports namespacesn Much simpler than XML Scheman More orthogonal than XML Scheman Can use XML Schema datatypesn Doesn’t support uniqueness, inheritance
![Page 57: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/57.jpg)
Relax NG Examplen <element name=‘book’ dataTypeLibrary=‘…’>
<element name=‘title’><data type=‘string’>
</element><element name=‘quantity’><data type=‘integer’>
</element></element>
<element name=‘books’><oneOrMore><ref name=‘book’/>
</oneOrMore></element>
![Page 58: IQPC Canada XML 2001: How to develop Syntax and XML Schema](https://reader036.vdocuments.site/reader036/viewer/2022081400/55557931b4c9058a5a8b4f70/html5/thumbnails/58.jpg)
Thank You!n http://xml.apache.orgn [email protected]