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 (17)

Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml p5 Lecture Notes
Xml p5 Lecture NotesXml p5 Lecture Notes
Xml p5 Lecture Notes
 
Dom parser
Dom parserDom parser
Dom parser
 
XML - SAX
XML - SAXXML - SAX
XML - SAX
 
Xsd
XsdXsd
Xsd
 
DOM-XML
DOM-XMLDOM-XML
DOM-XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml schema
Xml schemaXml schema
Xml schema
 
fundamentals of XML
fundamentals of XMLfundamentals of XML
fundamentals of XML
 
XML and XSLT
XML and XSLTXML and XSLT
XML and XSLT
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
The Document Object Model
The Document Object ModelThe Document Object Model
The Document Object Model
 
XSL - XML STYLE SHEET
XSL - XML STYLE SHEETXSL - XML STYLE SHEET
XSL - XML STYLE SHEET
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 

Viewers also liked

Python data structures
Python data structuresPython data structures
Python data structuresFraboni Ec
 
Computer security
Computer securityComputer security
Computer securityFraboni Ec
 
List and iterator
List and iteratorList and iterator
List and iteratorFraboni Ec
 
Data and assessment
Data and assessmentData and assessment
Data and assessmentFraboni Ec
 
Information retrieval
Information retrievalInformation retrieval
Information retrievalFraboni Ec
 
Crypto passport authentication
Crypto passport authenticationCrypto passport authentication
Crypto passport authenticationFraboni Ec
 
Prolog programming
Prolog programmingProlog programming
Prolog programmingFraboni Ec
 
Building a-database
Building a-databaseBuilding a-database
Building a-databaseFraboni Ec
 
Learn ruby intro
Learn ruby introLearn ruby intro
Learn ruby introFraboni Ec
 
coupe-du-monde-package_fecafoot
coupe-du-monde-package_fecafootcoupe-du-monde-package_fecafoot
coupe-du-monde-package_fecafootFatime Karagama
 
Google mock for dummies
Google mock for dummiesGoogle mock for dummies
Google mock for dummiesFraboni Ec
 
Nlp naive bayes
Nlp naive bayesNlp naive bayes
Nlp naive bayesFraboni Ec
 
Data visualization
Data visualizationData visualization
Data visualizationFraboni Ec
 
Exception handling
Exception handlingException handling
Exception handlingFraboni Ec
 

Viewers also liked (20)

Linked list
Linked listLinked list
Linked list
 
Python data structures
Python data structuresPython data structures
Python data structures
 
Computer security
Computer securityComputer security
Computer security
 
List and iterator
List and iteratorList and iterator
List and iterator
 
Data and assessment
Data and assessmentData and assessment
Data and assessment
 
Information retrieval
Information retrievalInformation retrieval
Information retrieval
 
Crypto passport authentication
Crypto passport authenticationCrypto passport authentication
Crypto passport authentication
 
Java
JavaJava
Java
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Building a-database
Building a-databaseBuilding a-database
Building a-database
 
Learn ruby intro
Learn ruby introLearn ruby intro
Learn ruby intro
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
coupe-du-monde-package_fecafoot
coupe-du-monde-package_fecafootcoupe-du-monde-package_fecafoot
coupe-du-monde-package_fecafoot
 
My netral
My netralMy netral
My netral
 
Google mock for dummies
Google mock for dummiesGoogle mock for dummies
Google mock for dummies
 
Nlp naive bayes
Nlp naive bayesNlp naive bayes
Nlp naive bayes
 
Data visualization
Data visualizationData visualization
Data visualization
 
Gm theory
Gm theoryGm theory
Gm theory
 
Exception handling
Exception handlingException handling
Exception handling
 
Big data
Big dataBig data
Big data
 

Similar to Xml schema (20)

Xml
XmlXml
Xml
 
Introduction to xml schema
Introduction to xml schemaIntroduction to xml schema
Introduction to xml schema
 
Xml
XmlXml
Xml
 
XML Schema
XML SchemaXML Schema
XML Schema
 
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
 
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)
 
Xml unit1
Xml unit1Xml unit1
Xml unit1
 

More from Fraboni Ec

Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreadingFraboni Ec
 
What is simultaneous multithreading
What is simultaneous multithreadingWhat is simultaneous multithreading
What is simultaneous multithreadingFraboni Ec
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherenceFraboni Ec
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data miningFraboni Ec
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data miningFraboni Ec
 
Data mining and knowledge discovery
Data mining and knowledge discoveryData mining and knowledge discovery
Data mining and knowledge discoveryFraboni Ec
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching worksFraboni Ec
 
Hardware managed cache
Hardware managed cacheHardware managed cache
Hardware managed cacheFraboni Ec
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithmsFraboni Ec
 
Cobol, lisp, and python
Cobol, lisp, and pythonCobol, lisp, and python
Cobol, lisp, and pythonFraboni Ec
 
Abstract data types
Abstract data typesAbstract data types
Abstract data typesFraboni Ec
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsFraboni Ec
 
Abstraction file
Abstraction fileAbstraction file
Abstraction fileFraboni Ec
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisFraboni Ec
 
Abstract class
Abstract classAbstract class
Abstract classFraboni Ec
 
Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with javaFraboni Ec
 

More from Fraboni Ec (20)

Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
 
Lisp
LispLisp
Lisp
 
What is simultaneous multithreading
What is simultaneous multithreadingWhat is simultaneous multithreading
What is simultaneous multithreading
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherence
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data mining
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of 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
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching works
 
Hardware managed cache
Hardware managed cacheHardware managed cache
Hardware managed cache
 
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
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessors
 
Abstraction file
Abstraction fileAbstraction file
Abstraction file
 
Object model
Object modelObject model
Object model
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Abstract class
Abstract classAbstract class
Abstract class
 
Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with java
 
Inheritance
InheritanceInheritance
Inheritance
 

Recently uploaded

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 

Recently uploaded (20)

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 

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