SlideShare une entreprise Scribd logo
1  sur  21
CIS-189 XML
   Qualification refers to whether a value
    (element, attribute) must be qualified by a its
    namespace
    ◦ When an element (or attribute) doesn’t have a
      namespace declaration it’s unqualified
    ◦ Determines how name is used in data (instance)
      document
   A schema has the attributes elementFormDefault
    and attributeFormDefault
    ◦ Set to qualified or unqualified
    ◦ By setting to qualified, must include a namespace when
      use attributes or elements
<schema attiributeFormDefault=“unqualified”
elementFormDefault=“unqualified”>

   Element and attributes can be specified
    individually as qualified (or not)
    <element form=“unqualified”>
    <attribute form=“qualified”>
   Have several different ways to specify how
    elements fit together
   Sequence: specifies that elements must be in
    order, and there’s variability in when and how
    many times a child element occurs
   All: elements may appear (or not), and in any
    order
   Choice: one of several child elements may
    appear
   Group: a set of elements may be referenced
    by name
   Allows elements to appear in any order or not
    at all
   Rules governing use
    1. Must be only content model declaration of a
       <complexType> definition
      For example, can’t follow with <sequence>
    2. Can only have element declarations as children
    3. The children of the <all> element may appear
       once – or not at all
<element name=“name”>
 <complexType>
  <all>
   <element name=“first” type=“xs:string” />
   <element name=“middle” type=“xs:string” />
   <element name=“last” type=“xs:string” />
  </all>
 </complextType>
</element>
   Similar in syntax to sequence
   Only one member of list can appear in the
    document
   Allow a middle initial or a middle name

<choice>
 <element name=“middleInitial” type=“xs:string” />
 <element name=“middleName type=“xs:string” />
</choice>

Note: Best case would restrict Middle Initial to one
character with a simple type.
   A group allows you to tie elements together, and
    then reference then with a single name
Definition:
<group name=“nameFields”>
  <element name=“first” type=“xs:string” />
  <element name=“middle” type=“xs:string” />
  <element name=“last” type=“xs:string” />
</group>
Use:
<element name=“name”>
  <complexType>
       <group ref=“nameFields” />
  </complexType>
</element>
   Can create a group of attributes similar to
    element groups
   Allows re-use of common members without
    multiple definitions
    ◦ Attribute groups cannot be recursive (refer to
      themselves
   Create limits on acceptable values as a simple
    type
   A facet is a single property or trait of a simple
    type
   Twelve facets can be applied to limit
    acceptable values
   minExclusive: smallest value, excluding
    what’s specified
   minInclusive: smallest value, including what’s
    specified
   maxExclusive: largest value, excluding what’s
    specified
   maxInclusive: largest value, including what’s
    specified
   totalDigits: total number of digits of a
    numeric type
   fractionDigits: number of decimal places
   length: number of items in a list or characters
    in a string
   minLength: minimum number of list items or
    characters
   maxLength: maximum number of list items
    or characters
   enumeration: specify member of a list
   whitespace: how whitespace should be
    treated
   pattern: restrict string types by pattern
Specifying a positive integer
<xs:simpleType name="creditHours">
 <xs:restriction base="xs:integer">
 <xs:minInclusive value="0" />
 </xs:restriction>
</xs:simpleType>
Specifying a list:
<xs:simpleType name="cisDepartments">
 <xs:restriction base="xs:string">
   <xs:enumeration value="CIS" />
   <xs:enumeration value="CNA" />
   <xs:enumeration value="CS" />
 </xs:restriction>
</xs:simpleType>
   Specify a 3 digit value

<xs:simpleType name="courseNumbering">
 <xs:restriction base="xs:string">
   <xs:pattern value="b[0-9]{3}b" />
 </xs:restriction>
</xs:simpleType>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
  elementFormDefault="qualified"
  xmlns="http://tempuri.org/XMLSchema.xsd"
  xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
  xmlns:xs="http://www.w3.org/2001/XMLSchema”>
 <xs:element name="course">
  <xs:complexType>
   <xs:sequence>
     <xs:element name="department" type="cisDepartments" />
     <xs:element name="number" type="courseNumbering" />
     <xs:element name="title" type="xs:string" />
     <xs:element name="credits" type="creditHours" />
   </xs:sequence>
  </xs:complexType>
 </xs:element>
<xs:simpleType name="creditHours">
 <xs:restriction base="xs:integer">
  <xs:minInclusive value="0" />
 </xs:restriction>
</xs:simpleType>
<xs:simpleType name="cisDepartments">
 <xs:restriction base="xs:string">
  <xs:enumeration value="CIS" />
  <xs:enumeration value="CNA" />
  <xs:enumeration value="CS" />
 </xs:restriction>
</xs:simpleType>
<xs:simpleType name="courseNumbering">
 <xs:restriction base="xs:string">
  <xs:pattern value="b[0-9]{3}b" />
 </xs:restriction>
</xs:simpleType>

</xs:schema>
   A list allows an element or attribute to store
    multiple values
    ◦ Uses enumerated values
    ◦ Values are separated by whitespace, so whitespace
      cannot be part of the content
    ◦ Can be built-in XML or a defined simpleType data
      type
Define
<simpleType name=“Degrees”>        different
 <restriction base=“string”>       values
     <enumeration value=“AA” />
     <enumeration value=“AS” />
     <enumeration value=“AAS” />
 </restriction>
</simpleType>
                                       Define
<simpleType name=“DegreesList”>        data type
 <list itemType=“Degrees”/>            using
</simpleType>                          values

<element name=“degreesEarned” type=“DegreesList” />

                    Define element storing different values
   <union> allows the combination of two data
    type for an element or attribute
   If have a possiblePoints element, expected
    value would be an integer; <union> would
    allow a string entry to note a “Missing” value
   Separate data types with whitespace

<simpleType name=“CreditValue”>
<union memberTypes=“xs:integer xs:string />
</simpleType
<xs:simpleType name="zipCode">
  <xs:union>
   <xs:simpleType>
     <xs:restriction base="xs:string">
      <xs:pattern value="[0-9]{5}" />
     </xs:restriction>
   </xs:simpleType>
   <xs:simpleType>
     <xs:restriction base="xs:string">
      <xs:pattern value="[0-9]{5}-[0-9]{4}" />
     </xs:restriction>
   </xs:simpleType>
  </xs:union>
 </xs:simpleType>

Contenu connexe

Tendances

SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Language
elliando dias
 

Tendances (20)

XML Schema
XML SchemaXML Schema
XML Schema
 
Xml part4
Xml part4Xml part4
Xml part4
 
XML Fundamentals
XML FundamentalsXML Fundamentals
XML Fundamentals
 
Mysql Crud, Php Mysql, php, sql
Mysql Crud, Php Mysql, php, sqlMysql Crud, Php Mysql, php, sql
Mysql Crud, Php Mysql, php, sql
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Language
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
Xml Schema
Xml SchemaXml Schema
Xml Schema
 
Xslt
XsltXslt
Xslt
 
Xsd tutorial
Xsd tutorialXsd tutorial
Xsd tutorial
 
Web Service Workshop - 3 days
Web Service Workshop - 3 daysWeb Service Workshop - 3 days
Web Service Workshop - 3 days
 
Informasjonsintegrasjon – hva er utfordringene
Informasjonsintegrasjon – hva er utfordringeneInformasjonsintegrasjon – hva er utfordringene
Informasjonsintegrasjon – hva er utfordringene
 
Xslt
XsltXslt
Xslt
 
XML DTD and Schema
XML DTD and SchemaXML DTD and Schema
XML DTD and Schema
 
Xml part2
Xml part2Xml part2
Xml part2
 
SCDJWS 1. xml schema
SCDJWS 1. xml schemaSCDJWS 1. xml schema
SCDJWS 1. xml schema
 
Xml part3
Xml part3Xml part3
Xml part3
 
Structure&amp;union
Structure&amp;unionStructure&amp;union
Structure&amp;union
 
XSLT
XSLTXSLT
XSLT
 
J query lecture 1
J query lecture 1J query lecture 1
J query lecture 1
 
XSLT. Basic.
XSLT. Basic.XSLT. Basic.
XSLT. Basic.
 

En vedette (7)

Cis245 Midterm Review
Cis245 Midterm ReviewCis245 Midterm Review
Cis245 Midterm Review
 
CIS160 final review
CIS160 final reviewCIS160 final review
CIS160 final review
 
Cis166 Final Review C#
Cis166 Final Review C#Cis166 Final Review C#
Cis166 Final Review C#
 
CIS 245 Final Review
CIS 245 Final ReviewCIS 245 Final Review
CIS 245 Final Review
 
Stored procedures
Stored proceduresStored procedures
Stored procedures
 
3 sql overview
3 sql overview3 sql overview
3 sql overview
 
Normalization
NormalizationNormalization
Normalization
 

Similaire à Schemas 2 - Restricting Values

Alfresco Custom Model
Alfresco Custom ModelAlfresco Custom Model
Alfresco Custom Model
Andrea Leo
 
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
Donghyeok Kang
 
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
phanleson
 

Similaire à Schemas 2 - Restricting Values (20)

Xsd restrictions, xsl elements, dhtml
Xsd restrictions, xsl elements, dhtmlXsd restrictions, xsl elements, dhtml
Xsd restrictions, xsl elements, dhtml
 
XML Schema
XML SchemaXML Schema
XML Schema
 
XML SCHEMAS
XML SCHEMASXML SCHEMAS
XML SCHEMAS
 
02 xml schema
02 xml schema02 xml schema
02 xml schema
 
Alfresco Custom Model
Alfresco Custom ModelAlfresco Custom Model
Alfresco Custom Model
 
Native XML processing in C++ (BoostCon'11)
Native XML processing in C++ (BoostCon'11)Native XML processing in C++ (BoostCon'11)
Native XML processing in C++ (BoostCon'11)
 
Xsd examples
Xsd examplesXsd examples
Xsd examples
 
XML_schema_Structure
XML_schema_StructureXML_schema_Structure
XML_schema_Structure
 
Xml session
Xml sessionXml session
Xml session
 
Schematron
SchematronSchematron
Schematron
 
35 schemas
35 schemas35 schemas
35 schemas
 
XSD
XSDXSD
XSD
 
XML Schemas
XML SchemasXML Schemas
XML Schemas
 
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL Superpowers
 
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
 
Generation_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdfGeneration_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdf
 
Selenium-Locators
Selenium-LocatorsSelenium-Locators
Selenium-Locators
 
Sightly - Part 2
Sightly - Part 2Sightly - Part 2
Sightly - Part 2
 
Day2 xslt x_path_xquery
Day2 xslt x_path_xqueryDay2 xslt x_path_xquery
Day2 xslt x_path_xquery
 

Plus de Randy Riness @ South Puget Sound Community College

Plus de Randy Riness @ South Puget Sound Community College (20)

SQL Constraints
SQL ConstraintsSQL Constraints
SQL Constraints
 
CIS145 Final Review
CIS145 Final ReviewCIS145 Final Review
CIS145 Final Review
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
CIS245 sql
CIS245 sqlCIS245 sql
CIS245 sql
 
CSS
CSSCSS
CSS
 
XPath
XPathXPath
XPath
 
XSLT Overview
XSLT OverviewXSLT Overview
XSLT Overview
 
Views
ViewsViews
Views
 
CIS282 Midterm review
CIS282 Midterm reviewCIS282 Midterm review
CIS282 Midterm review
 
CIS 145 test 1 review
CIS 145 test 1 reviewCIS 145 test 1 review
CIS 145 test 1 review
 
XML schemas
XML schemasXML schemas
XML schemas
 
Document type definitions part 2
Document type definitions part 2Document type definitions part 2
Document type definitions part 2
 
Document type definitions part 1
Document type definitions part 1Document type definitions part 1
Document type definitions part 1
 
DOM specifics
DOM specificsDOM specifics
DOM specifics
 
SQL overview and software
SQL overview and softwareSQL overview and software
SQL overview and software
 
Cis166 final review c#
Cis166 final review c#Cis166 final review c#
Cis166 final review c#
 
Triggers
TriggersTriggers
Triggers
 
CIS 282 Final Review
CIS 282 Final ReviewCIS 282 Final Review
CIS 282 Final Review
 
SQL Server Stored procedures
SQL Server Stored proceduresSQL Server Stored procedures
SQL Server Stored procedures
 
SQL Server Views
SQL Server ViewsSQL Server Views
SQL Server Views
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Schemas 2 - Restricting Values

  • 2. Qualification refers to whether a value (element, attribute) must be qualified by a its namespace ◦ When an element (or attribute) doesn’t have a namespace declaration it’s unqualified ◦ Determines how name is used in data (instance) document  A schema has the attributes elementFormDefault and attributeFormDefault ◦ Set to qualified or unqualified ◦ By setting to qualified, must include a namespace when use attributes or elements
  • 3. <schema attiributeFormDefault=“unqualified” elementFormDefault=“unqualified”>  Element and attributes can be specified individually as qualified (or not) <element form=“unqualified”> <attribute form=“qualified”>
  • 4. Have several different ways to specify how elements fit together  Sequence: specifies that elements must be in order, and there’s variability in when and how many times a child element occurs  All: elements may appear (or not), and in any order  Choice: one of several child elements may appear  Group: a set of elements may be referenced by name
  • 5. Allows elements to appear in any order or not at all  Rules governing use 1. Must be only content model declaration of a <complexType> definition  For example, can’t follow with <sequence> 2. Can only have element declarations as children 3. The children of the <all> element may appear once – or not at all
  • 6. <element name=“name”> <complexType> <all> <element name=“first” type=“xs:string” /> <element name=“middle” type=“xs:string” /> <element name=“last” type=“xs:string” /> </all> </complextType> </element>
  • 7. Similar in syntax to sequence  Only one member of list can appear in the document  Allow a middle initial or a middle name <choice> <element name=“middleInitial” type=“xs:string” /> <element name=“middleName type=“xs:string” /> </choice> Note: Best case would restrict Middle Initial to one character with a simple type.
  • 8. A group allows you to tie elements together, and then reference then with a single name Definition: <group name=“nameFields”> <element name=“first” type=“xs:string” /> <element name=“middle” type=“xs:string” /> <element name=“last” type=“xs:string” /> </group> Use: <element name=“name”> <complexType> <group ref=“nameFields” /> </complexType> </element>
  • 9. Can create a group of attributes similar to element groups  Allows re-use of common members without multiple definitions ◦ Attribute groups cannot be recursive (refer to themselves
  • 10. Create limits on acceptable values as a simple type  A facet is a single property or trait of a simple type  Twelve facets can be applied to limit acceptable values
  • 11. minExclusive: smallest value, excluding what’s specified  minInclusive: smallest value, including what’s specified  maxExclusive: largest value, excluding what’s specified  maxInclusive: largest value, including what’s specified  totalDigits: total number of digits of a numeric type
  • 12. fractionDigits: number of decimal places  length: number of items in a list or characters in a string  minLength: minimum number of list items or characters  maxLength: maximum number of list items or characters  enumeration: specify member of a list  whitespace: how whitespace should be treated  pattern: restrict string types by pattern
  • 13. Specifying a positive integer <xs:simpleType name="creditHours"> <xs:restriction base="xs:integer"> <xs:minInclusive value="0" /> </xs:restriction> </xs:simpleType>
  • 14. Specifying a list: <xs:simpleType name="cisDepartments"> <xs:restriction base="xs:string"> <xs:enumeration value="CIS" /> <xs:enumeration value="CNA" /> <xs:enumeration value="CS" /> </xs:restriction> </xs:simpleType>
  • 15. Specify a 3 digit value <xs:simpleType name="courseNumbering"> <xs:restriction base="xs:string"> <xs:pattern value="b[0-9]{3}b" /> </xs:restriction> </xs:simpleType>
  • 16. <?xml version="1.0" encoding="utf-8"?> <xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema”> <xs:element name="course"> <xs:complexType> <xs:sequence> <xs:element name="department" type="cisDepartments" /> <xs:element name="number" type="courseNumbering" /> <xs:element name="title" type="xs:string" /> <xs:element name="credits" type="creditHours" /> </xs:sequence> </xs:complexType> </xs:element>
  • 17. <xs:simpleType name="creditHours"> <xs:restriction base="xs:integer"> <xs:minInclusive value="0" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="cisDepartments"> <xs:restriction base="xs:string"> <xs:enumeration value="CIS" /> <xs:enumeration value="CNA" /> <xs:enumeration value="CS" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="courseNumbering"> <xs:restriction base="xs:string"> <xs:pattern value="b[0-9]{3}b" /> </xs:restriction> </xs:simpleType> </xs:schema>
  • 18. A list allows an element or attribute to store multiple values ◦ Uses enumerated values ◦ Values are separated by whitespace, so whitespace cannot be part of the content ◦ Can be built-in XML or a defined simpleType data type
  • 19. Define <simpleType name=“Degrees”> different <restriction base=“string”> values <enumeration value=“AA” /> <enumeration value=“AS” /> <enumeration value=“AAS” /> </restriction> </simpleType> Define <simpleType name=“DegreesList”> data type <list itemType=“Degrees”/> using </simpleType> values <element name=“degreesEarned” type=“DegreesList” /> Define element storing different values
  • 20. <union> allows the combination of two data type for an element or attribute  If have a possiblePoints element, expected value would be an integer; <union> would allow a string entry to note a “Missing” value  Separate data types with whitespace <simpleType name=“CreditValue”> <union memberTypes=“xs:integer xs:string /> </simpleType
  • 21. <xs:simpleType name="zipCode"> <xs:union> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[0-9]{5}" /> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[0-9]{5}-[0-9]{4}" /> </xs:restriction> </xs:simpleType> </xs:union> </xs:simpleType>