|
|
|
|
|
| what? why? how? some examples ...and some links || group ASP project grade report | |
|
|
|
|
So then, why use XML? There are quite a few reasons why XML has suddenly become the choice for many purposes. One of the main ones is, like HTML, it is in plain text; in other words, you can open it with any text editor up through a graphical XML creation system. So even if you need to do some quick XML work on a foreign server, and you don't have your editor of choice installed, you can still edit it using Notepad, BBEdit Lite, pico, emacs, or whatever text editor is standard on the operating system. Also, as mentioned in the "what?" section, XML is a data-based language, so you are defining data sets rather than just using one standard one. These are called DTDs, or Document Type Definitions. Of course, as you've already seen, they're not necessary; if you don't use one, the default will be assumed. HTML is just a DTD for SGML. (Document type definitions are beyond the scope of this project, but if you'd like more information, see the links page; there's a link to Group 2's project, which, among other things, covers DTDs as part of SAX.) XML is also much more definable in terms of style. While XML itself only defines data, the stylesheet standard, XSL (as shown in the "what?" section), allows you to format and output XML in any way. While this is possible in HTML, XSL also can do things like process searches, extraction, or can even output to another file type like PDF, LaTeX, or...well, things that we can't even imagine now. XML is also a "well-formed" language. What this means is, every <tag> must have a corresponding closing </tag>. This isn't true in HTML; for example, the break tag, <br>, doesn't require a closing tag. HTML browsers are forced to understand this, and deal with it. (If you need to use a tag that doesn't have a closing tag, you put a / at the end, such as <br/>. This tells the interpreter that there won't be a closing tag.) This makes processing XML much simpler, since the handler never has to guess at what the tag means, when it will close, or if it will close. Also, since XML is completely hierarchical, the XSL document or the XML handler can immediately jump to the part it needs in each entry. Also, since each piece is delimited, the pieces are easier to rearrange and search through. Those are the basics on why you want to use XML. Next, then, is the question of how to use the language. |
|