Page 178 - E-Bussiness and E-Commerce Management Strategy, Implementation, and Practice
P. 178

M03_CHAF9601_04_SE_C03.QXD:D01_CHAF7409_04_SE_C01.QXD  16/4/09  11:09  Page 145





                                                                              Chapter 3 E-business infrastructure  145



                                      Data Items: The Xml Document <books.xml>

                                      <?xml version="1.0"?>
                                      <!DOCTYPE Bookstore SYSTEM "books.dtd">
                                      <?xml-stylesheet type="text/html" href="books.xsl"?>

                                      <Bookstore>
                                      <Book ID="101">
                                           <Author>Dave Chaffey</Author>
                                           <Title>E-business and E-commerce Management</Title>
                                           <Date>30 November 2003</Date>
                                           <ISBN>0273683780</ISBN>
                                           <Publisher>Pearson Education</Publisher>
                                      </Book>
                                      <Book ID="102">
                                           <Author>Dave Chaffey</Author>
                                           <Title>Total E-mail Marketing</Title>
                                           <Date>20 February 2003</Date>
                                           <ISBN>0750657545</ISBN>
                                           <Publisher>Butterworth Heinemann</Publisher>
                                      </Book>
                                      </Bookstore>

                                      Note: The tags such as Bookstore, Book and author are defined for this particular
                                      application. They are defined in a separate Data Type Definition document which is
                                      shown below.



                                    The DTD referenced at the start of the XML document defines the data items associated
                                    with the root element, which in this case is the bookstore:



                                      Data Definition: Document Type Definition <books.dtd>
                                      <!ELEMENT BookStore (Book)*>

                                      <!ELEMENT Book (Title, Author+, Date, ISBN, Publisher)>

                                      <!ATTLIST Book ID #REQUIRED>
                                      <!ELEMENT Title (#PCDATA)>
                                      <!ELEMENT Author (#PCDATA)>
                                      <!ELEMENT Date (#PCDATA)>
                                      <!ELEMENT ISBN (#PCDATA)>
                                      <!ELEMENT Publisher (#PCDATA)>

                                      Notes:
                                      The Bookstore can contain many books *
                                      Bookstore is known as the ‘Root element’.
                                      + Allows for one or more author.
                                      PCDATA stands for parsed character data, i.e. a text string; further validation of fields
                                      could be used
                                      REQUIRED shows that this field is essential.
   173   174   175   176   177   178   179   180   181   182   183