SCDJWS 1. xml schema

709 views

Published on

It's cover the first chapter about the SCDJWS certification.

Refers to:
1. SCDJWS 5.0 Study Guide by Mikalai Zaikin
2. SCDJWS 5 Study Notes by Ivan A Krizsan

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
709
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
50
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SCDJWS 1. xml schema

  1. 1. <ul>XML Schema </ul><ul>Francesco Ierna </ul>
  2. 2. <ul>XML Document </ul>
  3. 3. <ul>XML Schema </ul><ul><li>XML SCHEMA : </li><ul><li>A way of describing and constraining the content of XML documents. </li></ul><li>Three parts : </li></ul><ul><ul><li>Datatypes
  4. 4. Contranints the XML Documents
  5. 5. What schema are and how one builds a schema </li></ul></ul><ul><li>Four main elements : </li></ul><ul><ul><li>Xsd:element  : contains simple or complext type if no type is specified
  6. 6. Xsd:attribute ( always simple type, no order req)
  7. 7. Xsd:complextType  : descrive how elements that contains other elements are organized. Can extends and restrict </li><ul><li>Sequence  : optional element
  8. 8. All  : any order, maxOccurs 1 and MinOccurs 0, in all group
  9. 9. Choise  : one of elements contained in the choise element to be present in the containing element </li></ul><li>Xsd:simpleType ( derives from existing type, restricting) : cannont t contains child elements or attributes </li><ul><li>Derives frome existing type
  10. 10. Rescrting existing type (xsd:rescriting) </li></ul></ul></ul><ul><ul><ul><ul><li>length , minLength , maxLength , pattern , enumeration , whiteSpace , maxInclusive , maxExclusive , minInclusive , minExclusive , totalDigits , fractionDigits </li></ul></ul></ul></ul>
  11. 11. <ul>Example .XSD </ul><?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?> <xsd:schema (root) xmlns:xsd=' http://www.w3.org/2001/XMLSchema ' (default) xmlns:xsd=&quot;http://www.ivan.com/schemas&quot; > <xsd:element name=&quot; order_request &quot;> <xsd:complexType> <xsd:sequence> ---------------> <xsd:element name=&quot; company_name &quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot; product_id &quot; Type=&quot;xsd:string&quot;/> <xsd:element name=&quot; product_price &quot; type=&quot;xsd:double&quot;/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> < order_request > < company_name >IBA JV</company_name> < product_id >C-0YST</product_id> < product_price >500.00</product_price> </ order_request >
  12. 12. <ul>Example XML </ul>
  13. 13. <ul>Include – Redefine- Import </ul>1. &quot;include&quot; Component - This component brings all declarations and definitions of an external schema document into the current schema . The external schema document must have the same target namespace as the current schema. &quot;include&quot; components are usually used to build a new schema by extending existing schema documents. 2. &quot;redefine&quot; Component - This component offers the same functions as the &quot;include&quot; component. But a &quot;redefine&quot; component also allows you redefine some datatypes provided in the included schema document . &quot;redefine&quot; components are usually used to revise a schema by redefining datatype definitions of existing schema documents. 3. &quot;import&quot; Component - This component offers the same functions as the &quot;include&quot; component except that the included schema document has a different target namespace. &quot;import&quot; components are usually used to build a new schema by borrowing element declarations from existing schema documents from other namespaces.
  14. 14. <ul>Import </ul>

×