Information Technology Reference
In-Depth Information
version =”1.0” encoding=”UTF 8”? >< xs:schema
xmlns=”http://www.wsmo.org/namespace”
xmlns:xs=”http://www.w3.org/2001/XMLSchema”
elementFormDefault=”qualified” attributeFormDefault=”qualified” targetNamespace=”http://
www.wsmo.org/namespace” >
< xs:element name=”people” >
< xs:complexType >
< xs:sequence >
< xs:element name=”title” type=”xs:string” maxOccurs=”1”/ >
< xs:element name=”member” type=”person” maxOccurs=”unbounded”/ >
< /xs:sequence >
< /xs:complexType >
< /xs:element >
< xs:complexType name=”person” >
< xs:sequence >
< xs:element name=”firstname” type=”namestring” minOccurs=”1” maxOccurs=”2”/ >
< xs:element name=”lastname” type=”namestring” minOccurs=”1” maxOccurs=”2”/ >
< xs:element name=”a liation” type=”namestring” maxOccurs=”unbounded”/ >
< /xs:sequence >
< xs:attribute name=”chair” default =”no” >
< xs:simpleType >
< xs:restriction base=”xs:string” >
< xs:enumeration value=”yes”/ >
< xs:enumeration value=”no”/ >
< / xs:restriction >
< /xs:simpleType >
< /xs:attribute >
< /xs:complexType >
< xs:simpleType name=”namestring” >
< xs:restriction base=”xs:string” >
< ! −− This pattern says that names are strings
starting with an uppercase letter −−>
< xs:pattern value=” \{ p }\{ Lu \} . \∗ ”/ >
< / xs:restriction >
< /xs:simpleType >
< /xs:schema >
Listing 2.4. XML Schema offers features beyond DTD: datatypes, reuse of element
structures, etc.
Although XML Schema allows one to define reusable types for attributes
and tags, this does not mean that one can indeed define refined tags, i.e.
not true inheritance on a semantic level is supported [38].
No complex checks relating different elements or attributes are supported
(for instance, in comparison arithmetic, one element may need to be
greater than another, the sum of the contents of elements of a particu-
lar type should not exceed a certain amount, etc.).
2.3.3 XPath and XSLT
So far, we have only scratched the surface, limiting our discussion to defining
the structure of XML documents. We have not yet touched on how to query,
tranform, and integrate various XML files/formats: the forte of the family of
standards that surround XML.
Switching between different XML formats, easily generating mediators or
wrappers between different formats, merging data, and combining and filtering
information are the hallmark of the Web as it evolves from a network of
Search WWH ::




Custom Search