Transforming XML Schema to Conceptual XML Reema Al-Kamha Spring Research Conference Supported by NSF
Dec 19, 2015
2
Motivation
XML is becoming standard for data representation.
XML Schema defines the structure of XML documents.
XML Schema has a textual representation.There is a need to conceptualize XML
Schema.
4
XML Schema Components
The element elementThe attribute elementThe simpleType elementThe complexType elementThe attributeGroup elementThe choice, and sequence elements
………………
5
Choice Translation
<xs:element name="Phone"> <xs:complexType> <xs:choice minOccurs="1" maxOccurs="1"> <xs:element name="HomePhone" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="CellPhone" type="xs:string"/> </xs:choice> </xs:complexType> </xs:element>
6
Sequence Translation<xs:element name= "Document > <xs:complexType> <xs:sequence minOccurs="1" maxOccurs= "100"> <xs:element ref="Employee" /> </xs:sequence> </xs:complexType> .................... </xs:element> <xs:element name="Employee"> <xs:complexType> <xs:sequence> <xs:element name="Name" type="NameType"/> <xs:element name="Phone"/> </xs:sequence> ………………………. </xs:complexType></xs:element> ……………………………………….. ………………………………………. <xs:complexType name="NameType"> <xs:sequence> <xs:element name="FirstName" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="MiddleName" type="xs:string" minOccurs="0" maxOccurs="2"/> <xs:element name="LastName" type="xs:string" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType></xs:element>
7
<xs:element name="Employee"> <xs:complexType> <xs:sequence> ................... </xs:sequence> <xs:attribute name="EmployeeNumber" type "xs:string" use="required" /> <xs:attributeGroup ref="EmployeeAttribute" /> </xs:complexType> </xs:element> <xs:attributeGroup name="EmployeeAttribute" > <xs:attribute ref="Status" use="optional" /> <xs:attribute name="Language" type="LanguageType" /> </xs:attributeGroup> <xs:attribute name="Status" type="xs:string" /> <xs:simpleType name="LanguageType" > <xs:restriction base="xs:string" > <xs:enumeration value="English" /> <xs:enumeration value="Latin" /> </xs:restriction>
</xs:simpleType>
Attribute & AttributeGroup Translation
8
Key Constraint Translation <xs:element name= "Document"> <xs:complexType> …………………… …………………… </xs:complexType> <xs:key name= "AKey"> <xs:selector xpath= ".//Employee" /> <xs:field xpath= "@EmployeeNumber"/> </xs:key> </xs:element>