Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
XML
Data Modeling
Document Modeling
A document model defines a set of element names and attributes
that can appear in an XML document.
A document model, more ...
-You want to define an XML vocabulary, and you need to ensure that
people can computers produce XML documents that conform...
There are three major technologies that you can use to create a data
model for your XML documents:
-DTD
-XDR Schema
-XML S...
DTD, or Document Type Definition, is a technology that’s part of the
XML specification. This means that all validating XML...
<?xml version=“1.0” encoding=“UTF-8”?>
<!– The DTD follows... -->
<!DOCTYPE people
[
<!ELEMENT people (person+)>
<!ELEMENT...
<!–- The XML data begins here... -->
<people>
<person>
<name>
<first>Erik</first>
<last>Westermann</last>
</name>
</person...
-DTDs use a specialized syntax that’s different from XML, making
them more difficult to learn for people without a backgro...
XDR, or XML Data Reduced, is an XML vocabulary invented by
Microsoft taht allows you to describe the schema of an XML
docu...
<?xml version=“1.0” encoding=“UTF-8”?>
<Schema name=“Untitled-schema”
xmlns=“urn:schemas-microsfot-com:xml-data”
xmlns:dt=...
<ElementType name=“name” model=“closed” content=“eltOnly” order=“seq”>
<element type=“first” minOccurs=“1” maxOccurs=“1” /...
XSD, the XML Schema Definition, is a W3C recommendation that
allows you to describe XML schemas using an XML vocabulary.
T...
<?xml version=“1.0” encoding=“UTF-8”?>
<xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema”
elementFormDefault=“qualifie...
<xs:element name=“people”>
<xs:complexType>
<xs:sequence>
<xs:element ref=“person” maxOccurs=“unbounded”/>
</xs:sequence>
...
DTDs
-Have been around for a long time and enjoy broad support from a
wide range of products and vendors
-Generally well-u...
Nächste SlideShare
Wird geladen in …5
×

XML - Data Modeling

6.183 Aufrufe

Veröffentlicht am

XML Data Models

Veröffentlicht in: Software
  • Als Erste(r) kommentieren

XML - Data Modeling

  1. 1. XML Data Modeling
  2. 2. Document Modeling
  3. 3. A document model defines a set of element names and attributes that can appear in an XML document. A document model, more formally and generally known as a data model, describes the logical structure of a set of data. The data model specifies which information a data set contains in terms of the names of the fields, which data each field can contain, and the relationships between fields and other sets of data. Document Model
  4. 4. -You want to define an XML vocabulary, and you need to ensure that people can computers produce XML documents that conform on the vocabulary. -You want to reduce the cost of creating a new XML-aware application. -You want to ensure that XML documents meet a certain level of quality, in terms of their structure and the data that they contain. -XML documents are created by people or other applications and are consumed (read) by other applications. A data model becomes important in the following scenarios:
  5. 5. There are three major technologies that you can use to create a data model for your XML documents: -DTD -XDR Schema -XML Schema Types of Data Models
  6. 6. DTD, or Document Type Definition, is a technology that’s part of the XML specification. This means that all validating XML parsers must be able to read and work with a DTD. A validating XML parser can not only read XML documents, but verify that they conform to a specific schema. Data Modeling with DTD
  7. 7. <?xml version=“1.0” encoding=“UTF-8”?> <!– The DTD follows... --> <!DOCTYPE people [ <!ELEMENT people (person+)> <!ELEMENT person (name)> <!ELEMENT name (first, last)> <!ELEMENT first (#PCDATA)> <!ELEMENT last (#PCDATA)> ]> Example of a DTD
  8. 8. <!–- The XML data begins here... --> <people> <person> <name> <first>Erik</first> <last>Westermann</last> </name> </person> <person> <name> <first>Tom</first> <last>Archer</last> </name> </person> </people>
  9. 9. -DTDs use a specialized syntax that’s different from XML, making them more difficult to learn for people without a background in SGML or XML -DTDs don’t allow you to specify which type of data an element can contain. -DTDs have a fixed, non-extensible content model that doesn’t allow developers to create new elements and attributes. -DTDs don’t support namespaces. Disadvantages of DTD
  10. 10. XDR, or XML Data Reduced, is an XML vocabulary invented by Microsoft taht allows you to describe the schema of an XML document. The XDR describes that schema in terms of not only the document’s content, but also which types of content are contained in the document’s elements. The primary drawback to using XDR is that it’s limited to Microsoft products and technologies – other vendors don’t support XDR. Data Modeling with XDR Schema
  11. 11. <?xml version=“1.0” encoding=“UTF-8”?> <Schema name=“Untitled-schema” xmlns=“urn:schemas-microsfot-com:xml-data” xmlns:dt=“urn:schemas-microsoft-com:datatypes”> <ElementType name=“people” model=“closed” content=“eltOnly” order=“seq”> <AttributeType name=“xmlns” dt:type=“string”/> <attribute type=“xmlns”/> <element type=“person” minOccurs=“1” maxOccurs=“*” /> </ElementType> <ElementType name=“person” model=“closed” content=“eltOnly” order=“seq”> <element type=“name” minOccurs=“1” maxOccurs=“1” /> </ElementType> An Example of XDR
  12. 12. <ElementType name=“name” model=“closed” content=“eltOnly” order=“seq”> <element type=“first” minOccurs=“1” maxOccurs=“1” /> <element type=“last” minOccurs=“1” maxOccurs=“1” /> </ElementType> <ElementType name=“first” model=“closed” content=“textOnly” dt:type=“string”/> <ElementType name=“last” model=“closed” content=“textOnly” dt:type=“string”/> </Schema>
  13. 13. XSD, the XML Schema Definition, is a W3C recommendation that allows you to describe XML schemas using an XML vocabulary. The XSD describes the XML Document in terms of its data types. Data Modeling with XSD
  14. 14. <?xml version=“1.0” encoding=“UTF-8”?> <xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema” elementFormDefault=“qualified”> <xs:element name=“first” type=“xs:string”/> <xs:element name=“last” type=“xs:string”/> <xs:element name=“name”> <xs:complexType> <xs:sequence> <xs:element ref=“first”/> <xs:element ref=“last”/> </xs:sequence> </xs:complexType> </xs:element> An Example of XSD
  15. 15. <xs:element name=“people”> <xs:complexType> <xs:sequence> <xs:element ref=“person” maxOccurs=“unbounded”/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name=“person”> <xs:complexType> <xs:sequence> <xs:element ref=“name”/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
  16. 16. DTDs -Have been around for a long time and enjoy broad support from a wide range of products and vendors -Generally well-understood XDR -Microsoft-specific technology. Limited support in the industry. XSD -W3C Standard. Broader acceptance from vendors. -New in the market. Which Dat Modelling Schema Should I use?

×