Database Reference
In-Depth Information
Basically, an XML document may include three iles. he XML Schema Deinition ile (.xsd
ile) contains the deinitions of XML document formats, the XML data ile (.xml ile) contains
XML data deined by data types, and the Extensible Stylesheet ile (.xsl ile) contains the style
speciications of the XML data. Brief descriptions of these iles are given below.
XML data ile (.xml ile) : An XML document is well deined if it satisies the following
conditions:
If an element has a value, it must be enclosed by a pair of opening and closing tags such as
< element_name > value < /element_name >
For an element that has no value in it, it can be speciied by a single tag such as
< element_name/ >
Subelements must be properly nested. hat is, subelement tags must be placed inside the
parent element. For example
< element_name >
< sub-element_name > value < /sub-element_name >
< /element_name >
he value of an attribute should be enclosed by double quotes such as
< element_name attribute_name = "value"/ >
An XML document should have a root element, and all other elements are the subelements
of the root element. he XML document missing the root element is called a fragment.
Some DBMSs also support fragments.
he name in a tag is case sensitive.
User-deined tags in an XML document are declared in an XML Schema Deinition (.xsd) ile.
he following section will show how user-deined tags are declared in an .xsd ile.
XML Schema Deinition ile (.xsd ile) : Elements and other XML structures are deined in an
XML schema ile. he beneits of separating the XML data from the structure are described below:
1. When XML data are transferred from one database application to another, the two applica-
tions share the same XML schema ile. here is no need to set up a set of rules to convert the
data from one format to another. he receiver can completely reconstruct the data through
the XML schema ile provided by the sender.
2. When we transfer XML data over the Internet, the receiver can check if the data from the sender
satisfy a predeined format. An .xsd ile can be used to specify the standards for veriication.
3. An XML schema can be used to deine standards for an entire industry. he standards can
be used to verify the format of the data interexchanged within the industry. Industries such
as real estate, insurance, banking, and accounting have established their own standards
through XML schema iles.
4. By using XML schemas, we are able to create more sophisticated database objects such as
views and tables with multiple data types.
Extensible Stylesheet ile (.xsl ile) : Unlike HTML, an XML data ile does not provide data
style formatting information. To specify styles such as color and font, we need to have a document
Search WWH ::




Custom Search