XML entry required

Source: Internet
Author: User
Tags website server xml parser xsl

 

1. What is XML?
XML developers will tell you that XML is not actually a language, but a system used to define other languages. Maybe you have already heard of it. Maybe you have even tried some of these languages yourself ?? For example, Microsoft defines the Channel Definition Format (Channel Definition Format) for the push technology ).
W3C is a developer of some public standards on the Internet. It has released a series of standards and drafts related to XML. They describe XML as "a general syntax used to express structured data ". Structured Data refers to the data whose content, meaning, and usage are defined by tags. For example, in the HTML definition, the text defined by the By separating the structure and data, an XML document can be used for multiple purposes once written: displayed on a computer screen or on a mobile phone screen, or be transferred to a voice device designed for the blind, and so on. It can work almost on any possible communication device. At this time, the role of an XML document is far more than what you used to do, just to display the content of a simple document. In this way, XML can be used in addition to Internet connections.
In some large document manufacturers, SGML is a language they have been using for many years, but it is too complicated. It only involves over 400 pages of definition. The emergence of XML has also created some opportunities for them. In fact, XML is a simplified subset of SGML. Most of the work of SGML can be done by XML, which is much easier than SGML.
Of course, the platform-independent XML was originally designed for the web and will have the greatest impact on the web.
Dom (domument object model) is a programming interface that defines how to access data in a document. What XML can do for the Web depends largely on how it interacts with the DOM (Document Object Model.
With Dom, programmers can use a standard method to dynamically manipulate the document content and related attributes. In other words, a programmer can perform certain actions on a section of content in the Document Object Tree of a browser. For example, when you move the mouse over a short text segment, the color changes. Both navigator and Microsoft Internet Explorer of Netscape define incompatible Dom, but both companies have announced that they will support W3C standard DOM in their next version of browsers. This will bring a lot of convenience to programmers.

2. Why is XML important?
A very important principle on the Web is that content is the most important thing for a website. Unfortunately, the content is always associated with how to display them. When you browse a webpage, how many times have you seen a small tag that says "it is best to browse this website in 800*600 Resolution? Countless!
XML will help solve this problem. In XML, website builders no longer specify what is displayed on the webpage. What they need to do is to define a document structure. For example, you need to define the document title, author, and a series of related links. Any device equipped with an XML browser ?? Is a handheld computer, a TV set-top box, or a high-performance workstation ?? The XML document content can be displayed according to the display characteristics of each device.
Perhaps the most powerful feature of XML lies in its internal scalability. Any company or organization can expand XML to implement new applications. Now, I care about the proposal of XML application solutions on the Internet almost every day. Some XML-based languages have already been used, such as Microsoft's Channel Definition Format ?? There are also some under development, including resource Definition Format and open software description.
XML may also be the standard for data and document exchange mechanisms. For example, you can use XML to implement information exchange between different databases on the Internet.
So far, it seems too early to accurately describe the XML public. But the possibilities it brings are infinite. Maybe that's why XML is so interesting in its early stages.

3. What is the relationship between SGML, HTML, and XML?
SGML, the standard General Markup Language (Standard Generalized Markup Language), was first used to describe data in a word processing program. Such as rich text files and Word doc files can be seen as an example of applying SGML. If you open an RTF file in notepad, you can see something similar to HTML, that is, the source data tracing of RTF, which is also defined by SGML. It has been more than 10 years since the birth of SGML. It can be said that it has developed very well. Both XML and HTML can be regarded as examples of SGML. They are the descriptive language of the document format developed from SGML. Therefore, they all have some common features, such as similar syntaxes, and use angle brackets labels. But to be precise, HTML is an application of SGML, while XML is a simplified subset of SGML.
The difference is essentially. Simply put, HTML cannot be used to define (or derive) a new application, but XML can. For example, the resource tracing format and Channel Definition Format are new applications defined by XML. In theory, you can even rewrite HTML with XML. W3C provides a legend (see figure) for the relationship between them, which vividly illustrates this point.
XML is actually compatible with SGML ?? XML documents can be edited by any SGML and parsed by browsers. However, XML is much simpler than SGML, and it is especially designed for the Internet with Limited transmission bandwidth. Tim Bray is one of the compilers of the XML standard. According to him, XML is to inherit the advantages of SGML, but it can go beyond the complexity of SGML and make it work well online.
HTML, SGML, and XML will all hold their posts within a certain period of time, so there will be no other solutions for the moment. HTML is still the quickest way to publish information online. If the data to be published has long-term application value and requires some structured content, the website builder should consider using XML instead. Unlike HTML and XML, SGML won't be widely accepted on the Internet, because it is not specially designed for online transmission. But for high-end applications, those highly structured document applications, SGML will still play a role.

4. How is XML implemented?
XML can be applied to many different aspects. One of them is used to exchange information between people and machines. For example, the information is interpreted from a website server as being shared by users in a browser. Data is exchanged between machines, systems, and applications.
In the above two applications, you may need a three-tier architecture: a database server is a layer to store data. A server serving as the middle layer is used to properly interpret and express the data. Then, the client displays the data and can be further applied. The database server can receive information from multiple data sources, which may already exist in XML format. The middle layer can integrate all the data and then send it to the client.
Currently, many web pages are generated in this way. In addition, a constructed XML document allows the client program to modify the external ends of the document to display it in different media, such as printing it in a printer.

5. What is DTD?
Document Type Definition is a set of syntax definitions for tags. It tells you that in an XML document, you can use tags, the order in which tags appear, and the attributes that can be used. DTD first works in SGML and also introduces DTD in XML, but it is not necessary to form an XML document. Besides, it usually does not appear together with XML in a document (of course it can also be together), but in a separate DTD file. In this way, A single DTD can be referenced by multiple XML files.
Because XML is not a language, but a standard method used to define other languages, it does not have a common DTD like HTML. Therefore, companies and individuals who want to use XML can define their appropriate DTD to meet different requirements.
There are also a lot of arguments about DTD. Some people think it is very important and the most substantive thing. Some people limit creativity, while others think it is useful, but it is not good enough. Microsoft tried to use its XML-data to end these arguments, but critics thought it should be improved from the essential definition of DTD.
Microsoft's schema, including Microsoft, has proposed a DTD alternative solution for some DTD issues, known as schema, which has been submitted to W3C as XML-data. Similar to DTD, a schema provides some rules about the document and provides usable labels, attributes, and attributes between tags.
However, unlike DTD, schema can be used to define data types. For example, if a tag named <price> is defined in the DTD, the content contained in the tag can be a number or string. However, if schema is used, you can force the input content to only be numbers, rather than other types of data.
This method is obviously effective, especially when data is exchanged between different applications, objects, or databases. The only question is: Can a schema become part of the DTD standard, or simply an independent XML extension.

6. What are well-formed and valid documents?
In essence, there are two types of XML documents: well-formed (well-structured) and valid (valid ). A well-structured XML document follows the general rules of XML syntax. This rule is much stricter than HTML and SGML. The syntax rules of HTML are quite random and may often be omitted or nonstandard. However, XML documents cannot do this. XML documents must be written strictly according to XML syntax rules. The following describes the rules that well-formed XML should comply:
1. the first column of the XML file must be the declaration of the XML document;
2. the XML file can have only one root node.
3. the start and end tags must be called pairs.
4. Empty labels must contain the "/" symbol.
5. The first tag cannot appear at each other and must meet the nest structure.
6. The English case is different.
7. Attributes must be enclosed by double quotation marks.
8. special characters include "&", "<", ">", "", and.
A valid XML document must be stricter than a well-structured XML document. In addition to all the eight rules listed above, it must comply with the definition of a DTD document. As mentioned above, DTD is not mandatory for an XML document, but a corresponding DTD definition must exist for a valid XML document.
Validation of the effectiveness of XML documents is largely a consideration of the publishing and writing tools. For XML browsers, to display XML content, you only need to satisfy the well-formed definition.

7. How does the browser interpret XML documents?
The tool used to interpret XML is generally called the XML analyzer (parser), but its formal name should be the XML processor ). XML transmits data to applications used for writing, publishing, searching, or displaying data. XML does not provide an API (application interface) to control its behavior. It simply passes the parsed XML document to the application. Of course, as mentioned earlier, XML will not be parsed for XML documents that do not meet the well-formed condition. Both Netscape and Microsoft have built-in XML parser in their latest browsers. In this way, when XML is passed to the client browser, it is first parsed by the parser before being passed to the browser to display the content.

8. What is the relationship between RDF, CDF, and XML?
If XML has the ability to speak a language, XML applications can be seen as the specific language to be spoken. RDF (Resource description format) is such an XML application. It is also a language that only complies with the XML syntax and is derived from XML.
RDF is a method used to describe and access data. This means that RDF is data about data, or metadata (metadata ). On the web, this metadata can be used to create a standard website map to obtain more accurate search results and hierarchical descriptions of website subjects.
RDF can also be used to create smart bookmarks. When the webpage address referenced by the bookmarks changes, the bookmarks themselves automatically change. This is especially useful for websites with frequently updated content. For website builders, using metadata is a simple but effective solution.
Similarly, CDF has also evolved from XML. CDF (Channel Definition Format) is proposed and strongly advocated by Microsoft. With its XML parser, Internet Explorer 4.0 can read CDF files and extract related webpage content. This is the so-called "push" technology. Netscape also has a corresponding "push" technology, but its syntax structure is different from Microsoft's CDF.

9. What is the relationship between style pages and XML?
Because XML separates content and forms, website designers need a new way to control the layout and display. The style page comes forward at this time. Up to now, there are three different style pages that can work with XML:
1. Cascading Style Sheets (CSS ).
2. extensible style language (XSL ).
3. Document Style semantics and Specification Language (dsssl ).
XML is well supported by the current CSS standard, and CSS can also complete most of the basic style and shape settings. However, CSS cannot meet some high-end applications. At this time, you may need to turn to dsssl, the ISO standard. It once worked very well with the XML advanced SGML. Of course, there is no problem with XML ?? The only problem is that she is too complicated, and most of them are designed for the publishing industry, without too much consideration for the particularity of online transmission.
So the rest is XSL, which is basically designed for XML. Currently, XSL remains to be discussed as a W3C motion, so it is only supported in ie5, and other browsers do not know XSL yet. XSL gives web designers and users greater flexibility. Many of its features are unimaginable in HTML. For example, HTML <H2> labels are displayed in all browsers, but in XSL, social media reporters can specify any page elements to display as they want. The user can also determine how to display <H2> through personal settings. XSL is designed to work with some scripting languages such as JavaScript. You can even write a script like this: "If a certain attribute value of an XML element is 10 then to make it green, Else To make it blue", and so on. With XSL, XML seems omnipotent.

10. What improvements does XML provide for hyperlinks?
XML makes some improvements to HTML hyperlinks and adds some features, including the ability to create "smart" links, which saves a lot of trouble for writing javsscript manually. In XML, a link appears as an object. You can perform convenient operations on a hyperlink like any other object.
What is the original link standard ?? XML linking language (Xll) is now divided into two new standards: xpointer and xlink.
Xpointer: in HTML, you can use bookmarks to link to any part of a page. With xpointer, you will be able to "address to" (instead of "link to") Any part of other pages. Obviously, this is very useful for document reference.
Xlink: when a user clicks a hyperlink in HTML, the current webpage is replaced by a new webpage. Xlink allows web developers to add some behaviors for the linked object ). For example, now you must use JavaScript to display the linked webpage in a new window, but xlink adds some actions to the linked object, it is easy to implement the pop-up window to simply call the object method. Other useful applications, such as the pop-up warning dialog box and the dialog box that requires confirmation, can be easily implemented through the xlink object mechanism. But now, we have to turn to Script Programming to solve the problem.
For a series of related links, XML allows web developers to create extended links to conveniently implement websites or webpages such as www.webring.com, automatically link webpages with the same themes. Currently, CGI scripts are used to implement this function, but the extension Link provides standard methods to establish associations between resources.
There are still some issues that need to be further discussed, especially the work on the "behavior" mechanism. However, this does not prevent the use of xpinter and xlink as new standards in the near future.

11. xml Internationalization
The emergence of XML makes it ever easier to internationalize websites. Like java, XML uses Unicode (ISO 10646) as its encoding standard, which is a way for website builders to easily write texts and symbols from different countries, you don't have to worry too much about Garbled text. Unicode includes all ASCII characters, simplified Chinese, traditional Chinese, Japanese, Korean, and Greek. In XML, mixed encoding is allowed. For example, a webpage displaying Chinese characters can reference a German word without worrying about garbled characters.
Developers do not need to learn anything new specifically for Unicode. When a webpage is displayed in a browser on the client, the browser automatically displays the webpage with the appropriate character set.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.