Page 326 - Open Soource Technologies 304.indd
P. 326

Web Technologies-I



                   Notes              grammar cannot be expressed in EBNF. Writing a proper SGML parser requires handling
                                      a variety of rarely used and difficult to parse language features. XML does not.
                                    9.  XML documents shall be easy to create. Although there will eventually be sophisticated
                                      editors to create and edit XML content, they would not appear immediately. In the interim,
                                      it must be possible to create XML documents in other ways: directly in a text editor, with
                                      simple shell and Perl scripts, etc.

                                   10.  Terseness in XML markup is of minimal importance. Several SGML language features
                                      were designed to  minimize  the amount of typing required to manually key in SGML
                                      documents. These features are not supported in XML. From an abstract point of view, these
                                      documents are indistinguishable from their more fully specified forms, but supporting
                                      these features adds a considerable burden to the SGML parser (or the person writing it,
                                      anyway). In addition, most modern editors offer better facilities to define shortcuts when
                                      entering text.

                                 13.1.6 How is XML defined?
                                    •  XML is defined by a number of related specifications:

                                    •  Extensible Markup Language (XML) 1.0
                                    •  Defines the syntax of XML.
                                    •  XML Pointer Language (XPointer) and XML Linking Language (XLink).

                                    •  Defines a standard way to represent links between resources. In addition to simple links,
                                      like HTML’s <A> tag, XML has mechanisms for links between multiple resources and
                                      links between read-only resources. XPointer describes how to address a resource; XLink
                                      describes how to associate two or more resources.

                                    •  Extensible Style Language (XSL).
                                    •  Defines the standard stylesheet language for XML.
                                    •  As  time  goes  on,  additional  requirements  will  be  addressed  by  other  specifications.
                                      Currently, namespaces (dealing with tags from multiple tag sets), a query language
                                      (finding out what’s in a document or a collection of documents), and a schema language
                                      (describing the relationships between tags, DTDs in XML) are all being actively pursued.
                                    •  Understanding the Specs.

                                    •  For the most part, reading and understanding the XML specifications does not require
                                      extensive knowledge of SGML or any of the related technologies.

                                 13.2 Lightning Guide to XML


                                 Most XML consists of elements (like HTML tags), entities, and regular data. For example:


                                 <book isbn=”1-56592-610-2”> <title>Programming PHP</title> <authors> <author>ABC</
                                 author> <author>XYZ</author> </authors> </book>
                                 In HTML, you often have an open tag without a close tag. The most common example of this is:
                                 <br>

                                 In XML, that is illegal. XML requires that every open tag be closed. For tags that do not enclose
                                 anything, such as the line break <br>, XML adds this syntax:

                                 <br />

        320                               LOVELY PROFESSIONAL UNIVERSITY
   321   322   323   324   325   326   327   328   329   330   331