XML, as opposed to HTML, is less about defining the individual structure of a document and more about a document's ability to connect to others. In addition, XML does not rely on a standardized set of terms. This leads to an increased flexibility in determining how different parts of a document relate to other parts, and is therefore inherently a more explicit, dynamic set of semantics. As opposed to HTML, there are no predefined tags, but the language used can refer back to a namespace that serves as a reference point. Using a namespace, as opposed to tags allows for greater interoperability between readable documents. This interoperability makes for an easier time when it comes to exchanging information across formats (maybe? Unsure).
An XML document is composed of entities with elements that have attributes. This concept is familiar. How they are created and manipulated is a little more confusing.
In the introductory statement of a piece of XML (the infuriatingly misspelled prolog), you can introduce the type of "grammar" you are going to use; you make up the tags out of your own, reasonably rational imagination! Having defined the grammar, you can fill in the syntax with elements (like BIB or BOOK), and refine those elements with attributes (BOOK gets attributes like AUTHOR and TITLE). This involves creating a document type definition (DTD) There are very many rules about how to go about organizing the document, most of which boggled my mind. The DTD, as an ancillary, external document, reminds me a little of how CSS relates to HTML, but, again, I'm probably way off on that because they serve different purposes. The downfall of a DTD, however, is that you have to do it yourself. Maybe that's not a downfall, however, as it provides firm control over the specific document you're creating. However, because XML is based on exchange and connection, a tag you've created may mean something within your particular DTD, but may mean something else to the entity that's reading the code. Enter the namespace, which essentially defines the vocabulary your XML grammar will be working with, so the computer on the receiving end of the document can use the namespace as a reference point, or dictionary.
The rules for linking (Xlink, XPointer, and XPath) are a tightly wound that involves what seem to me to be sub-languages. You assign an addresses to the locations of the objects you want linked together using the Xlink namespace, and that's where I get completely, utterly lost. Where does the XPointer point? I know it uses XPath somehow. Even the helpful, Explain-Like-I'm-Five W3C tutorials couldn't get me to understand it.
What I do understand, however, is that the flexibility and hierarchical structure of XML documents are good for storage in databases. This makes them pretty important. I very much look forward to next week's lecture for a little clarity.
No comments:
Post a Comment