XML and its technical guidelines: This article describes the techniques in XML and XML families. We will discuss how the core technologies are combined into a complete whole and some things that support XML technology. It seems that such things are happening every day: more and more developers believe that XML (Extensible Markup Language will fundamentally change our software industry. But if you want to figure out why this is or when you will happen, you will find the interpretation of the explanation of the XML. These things don't actually let you understand what, I believe that you will not satisfy the explanation like them. Typically, people have learned the main obstacles encountered when learning to grasp XML from XML amazing development speed. If you browse W3C about XML website (http://www.w4.org/xml/), you will find a lot of techniques and related publications about XML. W3C gathers such a large amount of information, causing a small trouble to developers. In the case of "How the technology used in XML is integrated", "it is difficult to learn XML in the case of clear concept. This article introduces you the techniques in the XML and XML families, making you not only understand the importance of XML at a higher level, but also know how the techniques in XML are combined to become a complete technology. After reading this article, you will have a roughly understanding of those XML dedicated nouns and their abbreviations, and lay the foundation from a deeper level learning XML in the future. So what is XML? Among the many authors of the previous XML, answering this problem has become a style. Just like you are well known, XML is an official abbreviation for Extensible Markup Language. They may think that XML pronunciation is more sexy than EML, so that the original letter E is changed to the letter X. However, when you cross the abbreviation from a deeper level, you will find it more than just a tag language, but a series of technologies. This technical family provides a solution for our development with better scalability and interoperability. Where is XML from? XML originated from SGML (STANDARD Generalized Markup Language. In other words, you can use XML or use SGML to create your own descriptive document. Both languages use the text ID (Tags) to describe data for other applications or It is a tool (such as an SGML or an XML analysis program). With XML, they can read the information correctly and some interesting operations for the data. XML is a simplified version of SGML, it is more suitable for use on the Web The syntax XML of XML defines the syntax used to describe your data. One is a correct XML statement:
Below is a good style XML document example (Hamburger.xml). Xml version = "1.0"?>
XML Version = "1.0"?>
Xml version = "1.0"?>
XML Version = "1.0"?>
Because only the APIs accepted by the industry standard, the code written by developers can be successfully implemented in other environments without modification. There are currently two major APIs that have been widely used by the developers, which is about to become future industry standards. They are: DOM (Document Object Model) and SAX (Simple API for XML). The DOM Document Object Model Document Object Model is a standard for accessing data and structures in XML documents by programming. W3C has agreed to list it as a recommendation object of the first grade specification of future industry standards. The DOM is a tree structure based on XML document in memory. When an XML file is loaded into the processor, a corresponding tree is established in memory (see Figure 1). The DOM also defines a programming interface to travers an XML tree and manages each element, a value, and attribute (including the name and attribute name). Figure 1. XML In-Memory Representation MSXML 2.0 Fully supports DOM and provides an easy-to-use object model interact with memory tree. Here is a simple VB example, which demonstrates how to use MSXML to traverse all child elements of a tree.
Set xmlDoc = CreateObject ( "MSXML.DOMDocument") bSuccess = xmlDoc.load ( "hamburger.xml") If bSuccess Then For Each node in xmlDoc.documentElement.childNodes val = node.text NextEnd If SAX DOM standard is a major drawback is that The overall XML document is loaded into the huge overhead caused by memory. This will bring us some problems when the amount of data is very large. When you transfer such a huge XML file on the internal network or the Internet, you may wait until all file transfer ends to process data. Many XML developers have realized this, so they work together (starting with the XML-DEV mailing list) to start to create another new standard. This is SAX. Although SAX is still in the early stages of development, because of its outstanding performance, it is quickly welcomed. SAX is a very simple XML API (like its name, Simple API for XML), which allows developers to use event-driven XML parsing. Unlike DOM, SAX does not require to load the entire XML file into memory. Its idea is very simple. Once the XML processor completes the operation of the XML element, it immediately invokes a customization of an event processor to process this element and related data. Although this can greatly improve efficiency, it will also cause a certain issue. For example, developers will have to be restricted in flexibility. If you want to know more detailed information, please visit http://www.megginson.com/sax/sax.html. Conversion Technology Once you start using a standard DOM API to implement the interaction of XML data, you will find that whether to get a specific data from a large document, or convert a part of an XML document to another. Format data (such as HTML) is very monotonous. For example, if you want to find all Lowfat Hamburger Price elements. In order to complete this with a standard DOM API, you must write the code through the code through the handwriting area to find qualified elements (in this example, the condition refers to the price element of Lowfat = YES in the HANBurger element). Look at another example, suppose you want to convert the Hamburger elements used and related data into a simple HTML form for user interaction. With standard DOM API, you have to manually pass through the entire tree to get the data you need in the HTML table. I recommend the work you need to do for standardization and simplifying people to complete these tasks, W3C recommends using XSL (Extensible Stylesheet Language) and a simple query language called XSL Patterns. XSL Patterns a mode is a string that selects nodes in the XML tree by it. Such option depends on the current node connected to the mode. The name of the element is the simplest mode, this mode selects all the child nodes with the name of the current node. For example, Hamburger mode selected all Hamburger child nodes of the current node. The syntax of the pattern is very complete. It allows you to identify a context in which a specified element is in the document (for example, the Price element is in the Hamburger element), and it also provides a powerful filter syntax, which can identify nodes that meet the given conditions (for example Lowfat = yes).
In order to find all Lowfat Hamburger Price elements in a Hamburgers element, you can use the following mode strings: / hamburgers / hamburger [@ lowfat = "yes"] / price When a pattern is applied to a given node, It only returns a list of nodes that meet the specified mode. This greatly simplifies the developer's operation and no longer needs to traverse the whole tree. MSXML 2.0 The definition of the model syntax support and the definition of 2.6 in Extensible Stylesheet Language (December 18th Working Draft) is the same. The IXmldomnode interface in MSXML 2.0 provides two ways, selectnodes and selectsinglenode. Both methods are parameters as a pattern string. For example, the following line of code will return all Price nodes that meet the conditions. Set nodelist = rootnode.selectnodes ("Hamburger") XSL XSL schema helps us identify some nodes in the XML document, but the operation of these nodes is still delayed Developers are completed. XSL can help us simplify the process of completing the usual XML task: transforming the XML node from a format to another. This demand for formatting originated from Web developers need to convert their XML data into HTML data for users to browse. In fact, XSL can do much more than the above description. XSL can effectively define conversions between an XML format to another XML format, which greatly enhances interoperability. If a person sends an XML document to your system, your system does not know the XML vocabulary it uses, you can get the words you are familiar with once a simple XSL conversion. It is because of this simple feature of XML, developers do not have to use universal vocabulary to describe some type of data. An XSL file contains a series of declaration templates for defined conversion rules. Each template clearly defines how to convert the specified nodes in the source document into the node (or other type of data) in the output document. You can use XSL mode to determine a template to apply those parts in a document. As an example, the Hamburger XML file is converted below:
Xml version = "1.0"?>
XML Version = "1.0"?> Hamburgers h1>