How
to build XML DTD
If you
know how you want your XML document to be, then you can easily create
an XML DTD. First you should be clear in your requirement for the XML
document. The next step is to know the syntax of the DTD and how to
create it.
_______________________________________________
_______________________________________________
Suppose
you want your XML document to hold the data regarding music CDs. Then
you might require a <title> element that would hold the title
of the music CD. Then each of that title might have some artists who
were involved in creating that CD.
So it is
necessary for a tag like <artist> to be present. There could be
more than one artist in creating that CD. So, multiple <artist>
elements are needed. Based on these you can create a DTD as given below:
<!ELEMENT
music ( cd+ ) >
<!ELEMENT cd ( title, artist+ ) >
<!ELEMENT title ( #PCDATA ) >
<!ELEMENT artist ( #PCDATA ) >
If you
examine the above DTD you will find that the ELEMENT keyword is used
to define an element. The word following that keyword is the name of
the element and the words within the bracket indicate the child elements.
So, from
the above code you will find that the root element is <music>
and it would have one of more <cd> elements. One or More is indicated
by the '+' sign. The <cd> element would have <title> and
<artist> element.
The '+'
sign indicates that there would be one or more <artist> element.
The PCDATA indicates that the element would hold only text data that
is parsed.
posted by Olier Raby on Mon 25th Jun 2007 23:48 UTC (New Mobile Computing)
Firefox add-ons , or extensions, are small programs that run inside the browser in order to customize some behaviors. In theory, it is possible to develop and maintain a multilingual, multiversion and multiOS Firefox add-on.