• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

XML

Unlike HTML, in XML documents, you’re free to create your own tags—you’re not restricted to the tags that an HTML browser already understands, such as <P> and <INPUT>. That’s both liberating and constricting—although you’re now free to structure your own documents from top to bottom, it’s also true that browsers such as the Internet Explorer will have no idea what to do with the elements in your XML document. The browser can’t know, for example, that you mean the tag <RED> to indicate red text—not unless you handle the document in code with JavaScript (or transform the document into HTML using XSLT and JavaScript as we’ll do later in the chapter). To really work with XML documents in the Internet Explorer, therefore, you have to use a scripting language such as JavaScript to interpret the XML and work with it.

Let’s take a look at an XML document to get us started. You start off such documents with the XML declaration <?xml version=”1.0”?>, and all the rest of the elements in the document must be enclosed in a single element, called the document element. In HTML, the document element is <HTML>; but in XML, that element can be anything you want. Here’s what our example XML document looks like—I’ll make this part of a publicist’s schedule book, keeping track of various publicity events and who went to them:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint