SlideShare a Scribd company logo
1 of 24
Schema
 Schemas
specify the structure of an XML document
constraints on its content
 This is also the purpose of a DTD
schema does it better
syntax is XML
can use existing XML tools
Schema
 What you can't do with DTD's
constrain the #PCDATA e.g.
 a telephone number
 a price
 a single word
precisely constrain repetition
 up to three children on a family ticket
a precise selection of elements
 in any combination or permutation
Schema
 XML is a meta-language for defining tag
languages
 A schema is a formal specification (in
XML) of the grammar for one language
useful for validating content & interchange
 XML Schema is a language for writing the
specifications
Schemas
• Common Vocabularies
• Shared Applications
• Network effect
• Formal Sets of Rules
• Machine-based XML processing
• Not human-based document processing
• Building Contracts
• Core rules for a series of transactions
Schemas
• DTDs
• good at describing documents
• can't manage complex data structures
• syntax is not extensible
• available tools won't work
Schemas
 Schemas build on primitive types
integers, floating point, strings, dates
 Types can be based on other types
aggregations
specifications
restrictions
equivalences
 Distinction between types and elements
Schemas
 Schema building is very like
OO data design
E-R diagrams
 Schemas may be complex compared to
the documents
because humans 'intuitively understand' tag
names
Schema Standards
• XML Schema (current W3C standard)
• large, full-featured, unimplemented
• XML-Data
• early contender, supported by Microsoft
• reduced set of XML-Data is part of IE5.
• DCD
• joint creation of Microsoft and IBM
• simpler version of XML-Data
Schema Standards
• SOX
• XML structures via OO-inheritance
• Schematron
• uses XSLT for schemas
• DSD
• like Schematron with simpler XML syntax
• RELAX
• based on hedge automata theory
• much simpler than XML Schema
Schema
History
Schema Problems
 Legal implications of schemas as
contracts
Eskimo Snow and Scottish Rain:
Legal Considerations of Schema Design
 http://www.w3.org/TR/md-policy-design
syntactic operability with semantic fault
occurs because DTDs and schemas mix
 syntax
 semantics
Schema Problems
• W3C standard "XML Schemas"
• Too big, too complex
• XML 1.0 spec = 30 pages, Schemas >200
• Too much, too soon
• it isn't clear that many developers are sure
what to do with this enormous toolkit today.
• Competitors
Defining A Schema (IE5)
 Take an example XML document instance
<?xml version="1.0"?>
<pizzaOrder>
<when>18:04:30</when>
<cost>8.75</cost>
<pizza>Hot n Spicy</pizza>
</pizzaOrder>
Defining A Schema (IE5)
 First declare that it uses a schema
definition via the default namespace
<?xml version="1.0"?
xmlns="x-schema:pizzaOrderSchema.xml">
<pizzaOrder>
<when>18:04:30</when>
<cost>8.75</cost>
<pizza>Hot n Spicy</pizza>
</pizzaOrder>
Defining a Schema (IE5)
 Now create an outline schema
<Schema
xmlns="urn:schemas-microsoft-com:xml-data">
...
</Schema>
 ie an XML document from the schema
language namespace
Defining a Schema (IE5)
 First we declare the kinds of elements we
have
<Schema xmlns="urn:schemas-microsoft-com:xml-data">
<ElementType name="when"/>
<ElementType name="cost"/>
<ElementType name="pizza"/>
<ElementType name="pizzaOrder"/>
</Schema>
Defining a Schema (IE5)
 and specify allowable content
<Schema xmlns="urn:schemas-microsoft-com:xml-data">
<ElementType name="when" content="textOnly"/>
<ElementType name="cost" content="textOnly"/>
<ElementType name="pizza" content="textOnly"/>
<ElementType name="pizzaOrder" content="eltOnly"/>
</Schema>
textOnly, eltOnly, mixed, empty
Defining a Schema (IE5)
 and then content model
<Schema xmlns="urn:schemas-microsoft-com:xml-data">
<ElementType name="when" content="textOnly" />
<ElementType name="cost" content="textOnly"/>
<ElementType name="pizza" content="textOnly"/>
<ElementType name="pizzaOrder" content="eltOnly">
<element type="when"/>
<element type="cost"/>
<element type="pizza"/>
</ElementType>
</Schema>
Defining a Schema (IE5)
 and even the content model for text
<Schema xmlns="urn:schemas-microsoft-com:xml-data">
<ElementType name="when" content="textOnly"
type="time"/>
<ElementType name="cost" content="textOnly"
type="float"/>
<ElementType name="pizza" content="textOnly"/>
<ElementType name="pizzaOrder" content="eltOnly">
<element type="when"/>
<element type="cost"/>
<element type="pizza"/>
...
Defining a Schema (IE5)
 But that requires another namespace
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="when" content="textOnly"
dt:type="time"/>
<ElementType name="cost" content="textOnly"
dt:type="float"/>
<ElementType name="pizza" content="textOnly"/>
<ElementType name="pizzaOrder" content="eltOnly">
<element type="when"/>
<element type="cost"/>
...
Schema Components
 Schemas build on the declarations and
usage of elements and attributes
 ElementType elements declare a kind of element
 AttributeType elements declare a kind of attribute
 element elements show the use of an element within
the context of another element
 attribute elements show the use of an attribute on an
element
Schema Components
 Various attributes specify the allowable
properties each element or attribute
 model specifies whether the element may contain
'foreign' elements, not specified in the schema
 minOccurs and maxOccurs put lower- and upper-
bounds on the repetition of an element
 order specifies whether subelements must appear in
the order specified, or whether only a single
subelement can be chosen
 required states that an attribute must be present
 default gives a default value for a missing attribute
Schema Data Types
 Microsoft's Schema provides 23 built-in
data types to which textual content can
conform
various numeric types (float, ints)
date, time, urn, uuid, char, hex, boolean and
blob
 No derived / extended types are allowed
 Separate namespace labels data vocab
Using Data Types
 A node's validated data type is directly
accessible within the IE DOM
DOMelement.nodeTypedValue
instead of .nodeValue or .text
 A node's schema definition is available
DOMElement.definition property
see
weather
.html

More Related Content

What's hot (20)

Xml Schema
Xml SchemaXml Schema
Xml Schema
 
Xml schema
Xml schemaXml schema
Xml schema
 
XSD
XSDXSD
XSD
 
Publishing xml
Publishing xmlPublishing xml
Publishing xml
 
XML's validation - XML Schema
XML's validation - XML SchemaXML's validation - XML Schema
XML's validation - XML Schema
 
XML DTD and Schema
XML DTD and SchemaXML DTD and Schema
XML DTD and Schema
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Xsd tutorial
Xsd tutorialXsd tutorial
Xsd tutorial
 
Xml basics
Xml basicsXml basics
Xml basics
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
00 introduction
00 introduction00 introduction
00 introduction
 
fundamentals of XML
fundamentals of XMLfundamentals of XML
fundamentals of XML
 
Xsd
XsdXsd
Xsd
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xml
 
DTD
DTDDTD
DTD
 
XML Technologies
XML TechnologiesXML Technologies
XML Technologies
 
03 namespace
03 namespace03 namespace
03 namespace
 
XSLT presentation
XSLT presentationXSLT presentation
XSLT presentation
 

Viewers also liked

Form = Function
Form = FunctionForm = Function
Form = Functionpjones
 
Form = Function
Form = FunctionForm = Function
Form = Functionpjones
 
Database concepts
Database conceptsDatabase concepts
Database conceptsJames Wong
 
ALP_AMD without recording file
ALP_AMD without recording fileALP_AMD without recording file
ALP_AMD without recording fileHONGRAK KIM
 
Presentación power point
Presentación power point Presentación power point
Presentación power point Jocelyn Patrinos
 
Blockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveBlockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveTommaso Pellizzari
 
Capco Blockchain, Distributed Ledger and Cryptocurrencies keynote to IIROC co...
Capco Blockchain, Distributed Ledger and Cryptocurrencies keynote to IIROC co...Capco Blockchain, Distributed Ledger and Cryptocurrencies keynote to IIROC co...
Capco Blockchain, Distributed Ledger and Cryptocurrencies keynote to IIROC co...Craig Borysowich
 

Viewers also liked (7)

Form = Function
Form = FunctionForm = Function
Form = Function
 
Form = Function
Form = FunctionForm = Function
Form = Function
 
Database concepts
Database conceptsDatabase concepts
Database concepts
 
ALP_AMD without recording file
ALP_AMD without recording fileALP_AMD without recording file
ALP_AMD without recording file
 
Presentación power point
Presentación power point Presentación power point
Presentación power point
 
Blockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveBlockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspective
 
Capco Blockchain, Distributed Ledger and Cryptocurrencies keynote to IIROC co...
Capco Blockchain, Distributed Ledger and Cryptocurrencies keynote to IIROC co...Capco Blockchain, Distributed Ledger and Cryptocurrencies keynote to IIROC co...
Capco Blockchain, Distributed Ledger and Cryptocurrencies keynote to IIROC co...
 

Similar to Xml schema (20)

Xml
XmlXml
Xml
 
Xml
XmlXml
Xml
 
Xml
XmlXml
Xml
 
XML
XMLXML
XML
 
Introduction to XML.ppt
Introduction to XML.pptIntroduction to XML.ppt
Introduction to XML.ppt
 
Introduction to XML.ppt
Introduction to XML.pptIntroduction to XML.ppt
Introduction to XML.ppt
 
[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml
XmlXml
Xml
 
Web Service Workshop - 3 days
Web Service Workshop - 3 daysWeb Service Workshop - 3 days
Web Service Workshop - 3 days
 
23xml
23xml23xml
23xml
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)
 
Data interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTDData interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTD
 

More from James Wong

Multi threaded rtos
Multi threaded rtosMulti threaded rtos
Multi threaded rtosJames Wong
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data miningJames Wong
 
Data mining and knowledge discovery
Data mining and knowledge discoveryData mining and knowledge discovery
Data mining and knowledge discoveryJames Wong
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data miningJames Wong
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching worksJames Wong
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsJames Wong
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherenceJames Wong
 
Abstract data types
Abstract data typesAbstract data types
Abstract data typesJames Wong
 
Abstraction file
Abstraction fileAbstraction file
Abstraction fileJames Wong
 
Hardware managed cache
Hardware managed cacheHardware managed cache
Hardware managed cacheJames Wong
 
Abstract class
Abstract classAbstract class
Abstract classJames Wong
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisJames Wong
 
Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with javaJames Wong
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithmsJames Wong
 
Cobol, lisp, and python
Cobol, lisp, and pythonCobol, lisp, and python
Cobol, lisp, and pythonJames Wong
 

More from James Wong (20)

Data race
Data raceData race
Data race
 
Multi threaded rtos
Multi threaded rtosMulti threaded rtos
Multi threaded rtos
 
Recursion
RecursionRecursion
Recursion
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data mining
 
Data mining and knowledge discovery
Data mining and knowledge discoveryData mining and knowledge discovery
Data mining and knowledge discovery
 
Cache recap
Cache recapCache recap
Cache recap
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data mining
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching works
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessors
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherence
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Abstraction file
Abstraction fileAbstraction file
Abstraction file
 
Hardware managed cache
Hardware managed cacheHardware managed cache
Hardware managed cache
 
Object model
Object modelObject model
Object model
 
Abstract class
Abstract classAbstract class
Abstract class
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with java
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Cobol, lisp, and python
Cobol, lisp, and pythonCobol, lisp, and python
Cobol, lisp, and python
 
Inheritance
InheritanceInheritance
Inheritance
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 

Xml schema

  • 1. Schema  Schemas specify the structure of an XML document constraints on its content  This is also the purpose of a DTD schema does it better syntax is XML can use existing XML tools
  • 2. Schema  What you can't do with DTD's constrain the #PCDATA e.g.  a telephone number  a price  a single word precisely constrain repetition  up to three children on a family ticket a precise selection of elements  in any combination or permutation
  • 3. Schema  XML is a meta-language for defining tag languages  A schema is a formal specification (in XML) of the grammar for one language useful for validating content & interchange  XML Schema is a language for writing the specifications
  • 4. Schemas • Common Vocabularies • Shared Applications • Network effect • Formal Sets of Rules • Machine-based XML processing • Not human-based document processing • Building Contracts • Core rules for a series of transactions
  • 5. Schemas • DTDs • good at describing documents • can't manage complex data structures • syntax is not extensible • available tools won't work
  • 6. Schemas  Schemas build on primitive types integers, floating point, strings, dates  Types can be based on other types aggregations specifications restrictions equivalences  Distinction between types and elements
  • 7. Schemas  Schema building is very like OO data design E-R diagrams  Schemas may be complex compared to the documents because humans 'intuitively understand' tag names
  • 8. Schema Standards • XML Schema (current W3C standard) • large, full-featured, unimplemented • XML-Data • early contender, supported by Microsoft • reduced set of XML-Data is part of IE5. • DCD • joint creation of Microsoft and IBM • simpler version of XML-Data
  • 9. Schema Standards • SOX • XML structures via OO-inheritance • Schematron • uses XSLT for schemas • DSD • like Schematron with simpler XML syntax • RELAX • based on hedge automata theory • much simpler than XML Schema
  • 11. Schema Problems  Legal implications of schemas as contracts Eskimo Snow and Scottish Rain: Legal Considerations of Schema Design  http://www.w3.org/TR/md-policy-design syntactic operability with semantic fault occurs because DTDs and schemas mix  syntax  semantics
  • 12. Schema Problems • W3C standard "XML Schemas" • Too big, too complex • XML 1.0 spec = 30 pages, Schemas >200 • Too much, too soon • it isn't clear that many developers are sure what to do with this enormous toolkit today. • Competitors
  • 13. Defining A Schema (IE5)  Take an example XML document instance <?xml version="1.0"?> <pizzaOrder> <when>18:04:30</when> <cost>8.75</cost> <pizza>Hot n Spicy</pizza> </pizzaOrder>
  • 14. Defining A Schema (IE5)  First declare that it uses a schema definition via the default namespace <?xml version="1.0"? xmlns="x-schema:pizzaOrderSchema.xml"> <pizzaOrder> <when>18:04:30</when> <cost>8.75</cost> <pizza>Hot n Spicy</pizza> </pizzaOrder>
  • 15. Defining a Schema (IE5)  Now create an outline schema <Schema xmlns="urn:schemas-microsoft-com:xml-data"> ... </Schema>  ie an XML document from the schema language namespace
  • 16. Defining a Schema (IE5)  First we declare the kinds of elements we have <Schema xmlns="urn:schemas-microsoft-com:xml-data"> <ElementType name="when"/> <ElementType name="cost"/> <ElementType name="pizza"/> <ElementType name="pizzaOrder"/> </Schema>
  • 17. Defining a Schema (IE5)  and specify allowable content <Schema xmlns="urn:schemas-microsoft-com:xml-data"> <ElementType name="when" content="textOnly"/> <ElementType name="cost" content="textOnly"/> <ElementType name="pizza" content="textOnly"/> <ElementType name="pizzaOrder" content="eltOnly"/> </Schema> textOnly, eltOnly, mixed, empty
  • 18. Defining a Schema (IE5)  and then content model <Schema xmlns="urn:schemas-microsoft-com:xml-data"> <ElementType name="when" content="textOnly" /> <ElementType name="cost" content="textOnly"/> <ElementType name="pizza" content="textOnly"/> <ElementType name="pizzaOrder" content="eltOnly"> <element type="when"/> <element type="cost"/> <element type="pizza"/> </ElementType> </Schema>
  • 19. Defining a Schema (IE5)  and even the content model for text <Schema xmlns="urn:schemas-microsoft-com:xml-data"> <ElementType name="when" content="textOnly" type="time"/> <ElementType name="cost" content="textOnly" type="float"/> <ElementType name="pizza" content="textOnly"/> <ElementType name="pizzaOrder" content="eltOnly"> <element type="when"/> <element type="cost"/> <element type="pizza"/> ...
  • 20. Defining a Schema (IE5)  But that requires another namespace <Schema xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <ElementType name="when" content="textOnly" dt:type="time"/> <ElementType name="cost" content="textOnly" dt:type="float"/> <ElementType name="pizza" content="textOnly"/> <ElementType name="pizzaOrder" content="eltOnly"> <element type="when"/> <element type="cost"/> ...
  • 21. Schema Components  Schemas build on the declarations and usage of elements and attributes  ElementType elements declare a kind of element  AttributeType elements declare a kind of attribute  element elements show the use of an element within the context of another element  attribute elements show the use of an attribute on an element
  • 22. Schema Components  Various attributes specify the allowable properties each element or attribute  model specifies whether the element may contain 'foreign' elements, not specified in the schema  minOccurs and maxOccurs put lower- and upper- bounds on the repetition of an element  order specifies whether subelements must appear in the order specified, or whether only a single subelement can be chosen  required states that an attribute must be present  default gives a default value for a missing attribute
  • 23. Schema Data Types  Microsoft's Schema provides 23 built-in data types to which textual content can conform various numeric types (float, ints) date, time, urn, uuid, char, hex, boolean and blob  No derived / extended types are allowed  Separate namespace labels data vocab
  • 24. Using Data Types  A node's validated data type is directly accessible within the IE DOM DOMelement.nodeTypedValue instead of .nodeValue or .text  A node's schema definition is available DOMElement.definition property see weather .html