SlideShare a Scribd company logo
1 of 15
XML SCHEMA
By
D.AKSHAYA
III B.TECH IT-A
WHAT IS XML?
 Extensible Markup Language (XML)
is a markup language that defines a
set of rules for encoding documents in
a formatwhich is both human-
readable and machine-readable
 XML was designed to carry data, not
to display data
XML HTML
 Used to carry data
 Can create own tags
 Platform independent and language
independent
 Tags and attributes are case sensitive &
must be quoted
 XML elements must be properly nested
 All XML elements must have a closing
tag
 XML is used to create new internet
languages. Here are some examples:
◦ WSDL for describing available web
services
◦ WAP and WML as markup languages for
handheld devices
◦ RSS languages for news feeds
◦ RDF and OWL for describing resources
and ontology
◦ SMIL for describing multimedia for the web
 Used to display data
 Cant create own tags
 Not language
independent
 Tags are not case
sensitive & quotes is not
complusory
WHERE AND WHY XML?
 SCENARIO
A web service client or server written in
java must convert between its internal
representation of data and character
strings appropriate for representing the
data in a SOAP document(or any kind of
doc used for displaying the data in the
web)
Eg: Currency convertor
From dollars : web service has to convert
the java double value to represent the
amount in string
Contd..
 What would be the constraints in this
process??
 Data range decision
 Value constraints
 Usage of scientific notation
 Precision issues and etc..
Solution???
 XML SCHMEA (XML VOCABULARY):
 It has a definition of collection of
standard data types.
 It has the range of values that could
be used for a particular data type and
then datas on how to represent the
values
XML SCHEMA
 WELL FORMED XML DOCUMENT
 XML with correct syntax is "Well Formed" XML.
XML validated against a DTD is "Valid" XML.
Example for XML Document
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me! </body>
</note>
XML ELEMENT &
VOCABULARY
 XML Element
 An XML element is everything from (including) the element's
start tag to (including) the element's end tag.
 An element can contain:
 other elements
 text
 attributes
 Or a mix of all of the above...
 XML vocabulary
 XML vocabulary is used to define
 element and attribute names
 element content
 Semantics of elements and attributes
 Some of the xml vocabularies are XHTML, RSS, XSL, DTD,
and Schema
Xml schema and DTD
DTD SCHEMA
 Defines the structure with a
list of defined elements in the
xml document.
 <!DOCTYPE note
[
<!ELEMENT note
(to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from
(#PCDATA)>
<!ELEMENT heading
(#PCDATA)>
<!ELEMENT body
(#PCDATA)>
]>
Extension: .dtd
Has only two data types: CDATA
& PDATA
 It is an alternative to DTD to define the
structure of an XML document.
 <xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element
name="to" type="xs:string"/>
<xs:element
name="from" type="xs:string"/>
<xs:element name="heading"
type="xs:string"/>
<xs:element
name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
 This definition file is stored with .xsl
extension.
 Can have primitive and complex data
types.
DATA TYPES IN XML
SCHEMA
DATA TYPES
SIMPLE
PRIMITIVE(BUILT-
IN)
USER DEFINED
COMPLEX
PRIMITIVE(BUILT-
IN)
USER DEFINED
A quick comparison..
SIMPLE DATA TYPE
 Values are
represented in xml
doc by character
data
 Used to represent
individual values
COMPLEX DATA
TYPE
 Values are
represented using
mark up.
 Used to represent
structured
data(highly
organised).
Built in data type..
Simplebuiltindatatypes
The data types
defined by xml
schema
specification itself
are called built-in
data types.
Eg:
<latitude
xsi:type=“xsd:decim
al”>40.28</latitude>
Xsd decimal is a
reference to XML
schema
Xml schema type is
similar to java ‘s primitive
types. Except for boolean
XML schema types
appear as type and
message elements.
Within types, user
defined data types are
the building blocks for
user-defined types.
Within message
elements built in types
are used to declare data
type for an operation
parameter or return
value.
XML NAMESPACES
 It is a collection of element and
attributes names associated with an
XML vocabulary. XML Namespaces
provide a method to avoid element
name conflicts.
doc1
• <table>
<tr>
<td>Apples</
td>
<td>Bananas
</td>
</tr>
</table>
Doc 2
•<table>
<name> Coffee
Table</name>
<width>80</widt
h>
<length>120</le
ngth>
</table>
Namespace
usage
• <h:table>
<h:tr>
<h:td>Apples</h:td
>
<h:td>Bananas</h:
td>
</h:tr>
</h:table>
<f:table>
<f:name>African
Coffee
Table</f:name>
<f:width>80</f:width
>
<f:length>120</f:len
gth>
</f:table>
USER DEFINED TYPES..
 USER DEFINED
SIMPLE TYPES
 <simpleType
name=“memberType”>
<restriction
base=“string”>
<enumeration
value=“platinum”/>
<enumeration
value=“gold”/>
</restriction>
</simpleType>
Facets of simple data
type:
length,minlength,maxlen
gth
 USER DEFINED
COMPLEX TYPE
 <anExchangeValue
xsi:type=“ExchangeVal
ues”>
 <dollars>1.0</dollars>
 <euros>0.7468</euros
>
 </anExchangeValue>
THANKS FOR
LISTENING!

More Related Content

What's hot (20)

XML
XMLXML
XML
 
Dtd
DtdDtd
Dtd
 
XML Schemas
XML SchemasXML Schemas
XML Schemas
 
Object oriented database
Object oriented databaseObject oriented database
Object oriented database
 
Basic perl programming
Basic perl programmingBasic perl programming
Basic perl programming
 
Sgml
SgmlSgml
Sgml
 
Object oriented database model
Object oriented database modelObject oriented database model
Object oriented database model
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Overview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FOOverview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FO
 
Xpath
XpathXpath
Xpath
 
Xml schema
Xml schemaXml schema
Xml schema
 
Xml ppt
Xml pptXml ppt
Xml ppt
 
Query optimization in SQL
Query optimization in SQLQuery optimization in SQL
Query optimization in SQL
 
Xml
XmlXml
Xml
 
XML Databases
XML DatabasesXML Databases
XML Databases
 
DBMS and its Models
DBMS and its ModelsDBMS and its Models
DBMS and its Models
 
XML
XMLXML
XML
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
SQL Joins and Query Optimization
SQL Joins and Query OptimizationSQL Joins and Query Optimization
SQL Joins and Query Optimization
 

Similar to Xml schema (20)

distributed system concerned lab sessions
distributed system concerned lab sessionsdistributed system concerned lab sessions
distributed system concerned lab sessions
 
Xml and Co.
Xml and Co.Xml and Co.
Xml and Co.
 
Xml sasidhar
Xml  sasidharXml  sasidhar
Xml sasidhar
 
Xml
XmlXml
Xml
 
XML/XSLT
XML/XSLTXML/XSLT
XML/XSLT
 
XML Schema.pptx
XML Schema.pptxXML Schema.pptx
XML Schema.pptx
 
Xml by Luqman
Xml by LuqmanXml by Luqman
Xml by Luqman
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
XML-Unit 1.ppt
XML-Unit 1.pptXML-Unit 1.ppt
XML-Unit 1.ppt
 
Introduction to xml schema
Introduction to xml schemaIntroduction to xml schema
Introduction to xml schema
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
Xml
XmlXml
Xml
 
advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptx
 
Xml
XmlXml
Xml
 
Xml 1
Xml 1Xml 1
Xml 1
 
XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
 
Xml andweb services
Xml andweb services Xml andweb services
Xml andweb services
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
 
Web Services Part 1
Web Services Part 1Web Services Part 1
Web Services Part 1
 
XML External Entity (XXE)
XML External Entity (XXE)XML External Entity (XXE)
XML External Entity (XXE)
 

More from Akshaya Akshaya

More from Akshaya Akshaya (6)

Organzing Principles Of Management- IBM case study
Organzing Principles Of Management- IBM case studyOrganzing Principles Of Management- IBM case study
Organzing Principles Of Management- IBM case study
 
User interface
User interfaceUser interface
User interface
 
Dyslexia
DyslexiaDyslexia
Dyslexia
 
Java ring
Java ringJava ring
Java ring
 
Carbon nano tubes
Carbon nano tubesCarbon nano tubes
Carbon nano tubes
 
Gene therapy
Gene therapyGene therapy
Gene therapy
 

Recently uploaded

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 

Recently uploaded (20)

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 

Xml schema

  • 2. WHAT IS XML?  Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a formatwhich is both human- readable and machine-readable  XML was designed to carry data, not to display data
  • 3. XML HTML  Used to carry data  Can create own tags  Platform independent and language independent  Tags and attributes are case sensitive & must be quoted  XML elements must be properly nested  All XML elements must have a closing tag  XML is used to create new internet languages. Here are some examples: ◦ WSDL for describing available web services ◦ WAP and WML as markup languages for handheld devices ◦ RSS languages for news feeds ◦ RDF and OWL for describing resources and ontology ◦ SMIL for describing multimedia for the web  Used to display data  Cant create own tags  Not language independent  Tags are not case sensitive & quotes is not complusory
  • 4. WHERE AND WHY XML?  SCENARIO A web service client or server written in java must convert between its internal representation of data and character strings appropriate for representing the data in a SOAP document(or any kind of doc used for displaying the data in the web) Eg: Currency convertor From dollars : web service has to convert the java double value to represent the amount in string
  • 5. Contd..  What would be the constraints in this process??  Data range decision  Value constraints  Usage of scientific notation  Precision issues and etc..
  • 6. Solution???  XML SCHMEA (XML VOCABULARY):  It has a definition of collection of standard data types.  It has the range of values that could be used for a particular data type and then datas on how to represent the values
  • 7. XML SCHEMA  WELL FORMED XML DOCUMENT  XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML. Example for XML Document <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me! </body> </note>
  • 8. XML ELEMENT & VOCABULARY  XML Element  An XML element is everything from (including) the element's start tag to (including) the element's end tag.  An element can contain:  other elements  text  attributes  Or a mix of all of the above...  XML vocabulary  XML vocabulary is used to define  element and attribute names  element content  Semantics of elements and attributes  Some of the xml vocabularies are XHTML, RSS, XSL, DTD, and Schema
  • 9. Xml schema and DTD DTD SCHEMA  Defines the structure with a list of defined elements in the xml document.  <!DOCTYPE note [ <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> ]> Extension: .dtd Has only two data types: CDATA & PDATA  It is an alternative to DTD to define the structure of an XML document.  <xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element name="to" type="xs:string"/> <xs:element name="from" type="xs:string"/> <xs:element name="heading" type="xs:string"/> <xs:element name="body" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element>  This definition file is stored with .xsl extension.  Can have primitive and complex data types.
  • 10. DATA TYPES IN XML SCHEMA DATA TYPES SIMPLE PRIMITIVE(BUILT- IN) USER DEFINED COMPLEX PRIMITIVE(BUILT- IN) USER DEFINED
  • 11. A quick comparison.. SIMPLE DATA TYPE  Values are represented in xml doc by character data  Used to represent individual values COMPLEX DATA TYPE  Values are represented using mark up.  Used to represent structured data(highly organised).
  • 12. Built in data type.. Simplebuiltindatatypes The data types defined by xml schema specification itself are called built-in data types. Eg: <latitude xsi:type=“xsd:decim al”>40.28</latitude> Xsd decimal is a reference to XML schema Xml schema type is similar to java ‘s primitive types. Except for boolean XML schema types appear as type and message elements. Within types, user defined data types are the building blocks for user-defined types. Within message elements built in types are used to declare data type for an operation parameter or return value.
  • 13. XML NAMESPACES  It is a collection of element and attributes names associated with an XML vocabulary. XML Namespaces provide a method to avoid element name conflicts. doc1 • <table> <tr> <td>Apples</ td> <td>Bananas </td> </tr> </table> Doc 2 •<table> <name> Coffee Table</name> <width>80</widt h> <length>120</le ngth> </table> Namespace usage • <h:table> <h:tr> <h:td>Apples</h:td > <h:td>Bananas</h: td> </h:tr> </h:table> <f:table> <f:name>African Coffee Table</f:name> <f:width>80</f:width > <f:length>120</f:len gth> </f:table>
  • 14. USER DEFINED TYPES..  USER DEFINED SIMPLE TYPES  <simpleType name=“memberType”> <restriction base=“string”> <enumeration value=“platinum”/> <enumeration value=“gold”/> </restriction> </simpleType> Facets of simple data type: length,minlength,maxlen gth  USER DEFINED COMPLEX TYPE  <anExchangeValue xsi:type=“ExchangeVal ues”>  <dollars>1.0</dollars>  <euros>0.7468</euros >  </anExchangeValue>