Information Technology Reference
In-Depth Information
the source relational database according to the translated parent and child elements
in the mapped DTD as follows:
Begin
While not end of element do
Read an elementfromthe translated target DTD;
Read the tuple of a corresponding relation of the element from
thesourcerelationaldatabase;
load this tuple into a target XML document;
read the child elements of the element according to the DTD;
while not at end of the corresponding child relation in the
source relationaldatabasedo
read thetuple from thechild relation suchthatthe
child's correspondingtothe processedparentrelation's
tuple;
load the tuple to the target XML document;
end loop //end inner loop
end loop // end outer loop
end
As a result, the data can be converted into an XML according to each preserved data
semantic in the translated DTD as shown in the following rules:
Notice that each rule of data conversion must be processed after each rule of
schema translation in Sect. 3.7 in Chap. 3.
Rule 1: Mapping Weak Entity from RDB to XML
In converting relational data of weak entity into an XML instance, we must ensure
that each child element's IDREF refer to its strong element's ID (Fig. 4.13 ).
Rule 2: Mapping Participation from RDB to XML
In converting relational tuples with total participation into XML instances, we must
ensure that each child elements (converted from child relation tuples) is under its
corresponding parent element (converted from parent relation tuples). Similarly,
we can convert partial participation tuples into XML instances. However, for those
RelationA
A1
a11
a12
XMLDocument
A2
a21
a22
<AA1="a11"A2="a21" id="1">
<B B1="b11" B2="b21" idref="1"></B>
</A>
Data
Relation B
* A1
a11
Conversion
B1
b11
B2
b21
<AA1="a12"A2="a22" id="2"></A>
Search WWH ::




Custom Search