In this chapter, we will view several application instances of XML to further improve the XML tag language and XML used in the background. Take a look at some applications of XML, even just the development of the primary stage, it is also encouraging. This chapter will tell readers to some views of XML's wide application. When I write this book, more XML applications are being created and launched with other formats.
The fifth part tells some of the XML applications discussed in this chapter in more detail.
The main contents of this chapter include:
· What is XML app
XML for XML
XML background application
2.1 What is an XML application
XML is a meta-marker language that can be used to design a markup language related to a particular expertise. Each XML-based tag language is called an XML application. This application uses XML as an editor like a Mozilla web browser, a gnumeric spreadsheet, or XML PRO, but is applied in a particular area, such as chemical chemical markers (Chemical Markup Language, Shie CML) or GEDML used in the family spectrum. Each XML application has its own syntax and vocabulary. This syntax and vocabulary abide by the basic rules of XML.
This is a bit like a human language, and each language has their own vocabulary and grammar, but simultaneously follows the basic rules required by human anatomy and brain structure.
XML is a very flexible format based on text data. The extensive applications discussed in this chapter have chosen XML as the basis because of the factors that exclude large-scale publicity), and XML provides a format that is easy to read and written in accordance with the actual and clearly described. The application uses this format for its data, you can solve a large number of standard tools and library functions. Furthermore, the additional syntax and semantics are easily added to the basic structure provided by the XML for such procedures.
2.1.1
Chemical Marker Language
The chemical marker language of Peter Murray-Rust (Chemical Markup Language) may be the first XML application. CML is originally developed into SGML applications, but with the development of XML standards, it has gradually evolved into XML. Under the simplest form of CML, CML is "HTML plus molecule", but its use is exceeded by the range of the Web.
Molecular documents often include thousands of different detailed objects. For example, a single medium-sized organizers may contain hundreds of atoms, each of which has several chemical bonds. CML seeks to organize this complex chemical object in a direct manner to enable computer to understand and display and retrieve it. CML can be used in molecular structures and sequences, spectral analysis, crystallization, publishing, chemical databases, and other aspects. Its vocabulary includes molecules, atoms, chemical bonds, crystals, molecular formulas, sequences, symmetrical, reactions, and other chemologies. For example, Listing 2-1 is a basic CML document describing water (H2O):
Listing 2-1: Water molecule H2O
H o h
1 "> 1 2
2 "> 2 3
1 1
The maximum improvement in the method of conventional management chemical data provided by CML is the search. CML also makes complex molecular data can be sent on the web. Since the bottom layer of XML is unrelated to the platform, it is possible to avoid problems that are not compatible due to different platforms, this problem is using traditional chemical software and documents (such as Protein Data Bank (PDB) format or MDL. Molfiles can often be encountered.
Murray-Rust also created the first XML browser Jumbo. Figure 2-1 is a CML file that Jumbo is displayed. Jumbo assumes each XML element to the Java class that can display these elements. In order to support Jumbo to support new elements, you can write as long as you write a Java class for this element. Jumbo is published with a basic set of CML elements (which includes molecular, atoms, and chemical bonds). Jumbo can get from http://www.xml-cml.org/. 2.1.2
Mathematical Marker Language (Mathematical Markup Language)
Legend Legend of Tim Berners-Lee invented World Wide Web and HTML, so that high-energy physicists can exchange papers and prepress publications. From my personal point of view, I never believe this legend. I am learning physics, and I have been in physics, application mathematics, astronomy, and computer science for many years. The paper of these disciplines is a common, that is, the paper is full of a lot of equations. Until now, the Web has already had a nine years, and there is no good way to include equations on the web page.
There are several ways to find custom syntax, and there is a conversion program that converts the equation edited by the LATEX software into a GIF image, and the other is a custom browser, you can read TEX Documents, but all these methods cannot produce high quality results, and these can not meet the needs of the Web author (even the author of the scientific field). In the end, only XML can start changing this situation.
Figure 2-1 Jumbo browser showing the CML file
Mathematical Markup Language (Mathml) is an XML application for mathematical equations. Mathml has sufficient ability to handle most forms of mathematical problems from junior mid-to-initial mutational arithmetic to calculus and differential equations. It can also handle many more advanced topics, but there are some blank, such as more advanced marks in some mathematical branches. Although the high end of pure mathematics and theoretical physics is limited to mathematics and theoretical physics, it is sufficient to deal with almost all education, scientific, engineering, business, economic and statistical requirements. And in the future, Mathml will inevitably expand, so it can be considered that even the theoretical physics of the purest mathematics and pure theory can be published and studied on the Web. Mathml completed the development of the WEB to scientific research and communication (although it also applied to making the advertising brochure too far) as a new media.
Netscape Navigator and Internet Explorer also do not support Mathml. But many mathematicians have a warm hope, hoping that these browsers can support this in the near future. W
3C
Some supports for Mathml have been integrated into their browser test platform Amaya. Figure 2-2 is a coast form of the MaxWell equation written by Mathml in AMAYA.
Amaya software can be found in the Browsers / Amaya directory of the CD-ROM attached to this book.
Figure 2-2 MaxWell Equation in a fault form written by Mathml in amaya browser
Listing 2-2 lists the XML files that Amaya browser are displayed:
Listing 2-2: Maxwell equation in Mathml
XMLns: m = "http://www.w3.org/t / EC-mathml /"
>
And God Said,
δ
alpha
Fly
αβ
=
4
π
c
J
beta
And there Was Light
Listing 2-2 is an example of a page mixing using HTML / XML. The title and paragraph of the text ("Fiat Lux", "Maxwell's Equations", "And God Said", "And there Was Light" is written in classic HTML. The actual equation is written in Mathml, which is an XML application. In general, this hybrid page requires special support for browsers. Here is this situation, otherwise you have to have plug-ins, ActiveX controls, or JavaScript programs to analyze and display embedded XML data. Of course, the end user needs a browser like Mozilla 5.0 or Internet Explorer 5.0, which can analyze and display pure XML files without the need for HTML as an intermediary.
2.1.3
Channel definition format
Microsoft's channel definition format (Channel Definition Format) is an XML application used to define channels. The Web site uses the channel to send information to the subscription site, one change the situation where the user who is sitting in the user came to browse and acquire information. This is also called web broadcasting or "push". CDF is first introduced in Internet Explorer 4.0.
The CDF document is an XML file, which is stored separately from the HTML file of the pushed site, but is linked to this HTML file. The channel definition in the CDF document determines which page to send. The page can be pushed to the subscriber by sending a notification, but it can also send the entire site, or by the reader to "pull" information when it is convenient.
Users can add CDF to their own sites without changing existing content. Just add an invisible link with the CDF file on the page. When the browser accesses this page, the browser displays a dialog and ask the viewer to book the channel. If the viewer chooses a subscription, the browser downloads the CDF document describing the channel. The browser then combines the CDF document with the specified parameters to combine the user's own preferred item to determine when to check the new content on the server. This is actually really "push" because the customer must initialize the connection, but this is indeed happening without browsing the request. Figure 2-3 is a case where the iDG's Active Channel (active channel) is displayed in Internet Explorer 4.0.
Figure 2-3 Idg's Active Channel (Active Channel) displayed in Internet Explorer 4.0
CDF will be discussed in detail in Chapter 21, "Use CDF Push Web Site".
Internet Explorer 4.0 can be found in the Browsers / IE4 directory on the CD-ROM of this book.
2.1.4
Classic literature
Jon Bosak has translated all dramas of Shakespeare (Shash Shibi) into XML. The full text of these scripts includes, with XML tags to distinguish between the name, each curtain title, stage guidance, white, lines, narration, etc.
Shash Shibi's full set of dramas can be found in the Examples / Shakespeare directory on the CD-ROM in this book.
Readers may ask, what is the benefit of such a book or an ordinary text file? For human readers, this is different, but for the computer analytical text, doing this makes it easy to distinguish different elements of drama. For example, let the computer find the lines of Romeo (Romeo) in full text.
Further, by means of a style sheet of the formatted document, an actor is easy to print a copy of the show, in which all the words of him (her) are formatted into bold, and he (she) front and The latter lines are represented by a bevel. It is also possible to imagine what is divided into a white-white, and the version using XML is much easier than the original text. Bosak has marked the new Old Testament, the Qur'an and Mormon Teaching, with XML. The marks in these books are somewhat different. For example, it does not distinguish between speakers. Thus (for example), this special XML document cannot be used to create the Bible with red letters, although the use of different sets of tags can achieve this. (Bible with red letters) uses red printing.) And because these documents are written in English, not the original language, this is not so useful for academic text analysis. If the time and resources are allowed, as long as it is willing, it is also possible to write the original text with XML. At this time, as long as the design is different from BOSAK, it is a vocabulary and syntax that describes the same data.
The Bible marked by XML, the Qur'an and Mormon teaching teachings can be found in the Examples / Religion directory on the CD-ROM attached to this book.
2.2 XML for XML
XML is the most universal format for text data. Some things used thereto further improve the XML itself. This includes XSL style single language, XLL link language, and document description for XML (Document Content Description, DCD).
2.2.1
XSL
XSL (Extensible Style Language, scalable style language) itself is an XML application. XSL has two main parts. The first part defines the vocabulary that converts an XML document. The XSL of this section includes an Element, node, model, template, and other XML tag, node, model, template, and other XML documents to another (or the same order) as required by the XML tag, node, node, node, and other elements required to convert an XML document from one mark.
The second part of the XSL defines a vocabulary for formatting the XML document (generated by the first part) after formatting the conversion. This includes XML tags for formatting objects (such as paging, block, characters, list, graphics, boxes, fonts, and others). A typical XSL style sheet is listed in Listing 2-12:
Listing 2-12: A XSL style single
XMLns: XSL = "http://www.w3.org/t / wd-xsl"
XMLns: fo = "http://www.w3.org/t / wd-xsl / fo"
Result-ns = "fo">
10PT "font-family =" SERIF "space-before ="
12PT
">
<>
We will discuss XSL in detail in Chapters 14 and 15.
2.2.2
XLL
Scalable link language (Extensible Linking Language) defines a new more general type of link called XLINK. XLINKS can complete all tasks that can be done with URL-based hyperlinks in HTML. For example, the footnote element can be directly linked to the text as the following example:
Seduce
Further, XLINK can do things that HTML links cannot be done. XLINK can be two-way, and the reader can return to the original page (where the page is running). XLINK can be linked to any location in the document. XLINK can embed the text or graphics data instead of users to activate links (more flexible). A short, XLINK is more powerful to make the hyperlink. The contents of XLINK will be discussed in more detail in Chapter 16, "XLINK".
2.2.3
DCD
XML's tool for declaring how XML element should be formatted to function is insufficient for unsatisfactory content. For example, suppose to establish a Month element as part of the data:
9
We can see the content of the Month element should be character data. We can't say that this element must be given to an integer from 1 to 12.
Several XML itself has been proposed to more strictly restrict what can appear in any given content. One solution is that the documentation description (Document Content Description, DCD) For example, there is a DCD here, which is declared that the MONTH element can only contain 1 to 12 integers:
Min = "1" max = "12" />
I can also show a lot of examples of XML XML, but the above case has shown that the basic view: XML is powerful to describe and expand itself. In addition, this also means that the XML specification can remain short and simple. You can don't have XML 2.0 because any of the main desired additional content can be established according to the original XML, and it is not necessary to become a new function of XML. People and programmers who need to enhance function can use these new features, without having to ignore it. Users don't have to know what is not used. XML provides "brick and mud", using these "bricks and mud" can build "cottage" can also build a towering "castle".
2.3 XML background application
Not all XML applications are public, open standards. Many software developers are turning their own data to XML, just because XML is well understood by the public, the general purpose format, can be handled with easy, inexpensive or free tools.
Microsoft Office 2000 has enabled HTML to format equivalent to its built-in binary format. However, HTML 4.0 does not provide full support for all functions required for Office, such as revision tracking, footnotes, annotations, indexes, and jealoustries. Additional data that cannot be expressed with HTML is embedded in the XML small code block. The vector graphics of Word are saved in the VML. In this case, the invisibility of embedded XML is a key factor in the standard browser.
Federal Express will use detailed information as a more competitive advantage as other shipping companies (such as UPS (US Express Service Company and Post Office)). First of all, this information comes from customer software, then It is through the web. Recently, Fedex starts to integrate their API (application interface) and library functions (third party and internal developers can use these APIs to integrate their software and systems with FedEx) test. This service The data format is XML.
Netscape Navigator 5.0 supports direct display of XML on a web browser, but Netscape actually starts using XML when you have already opened 4.5. When the user requests Netscape display a list of sites associated with the current site, the browser is connected to a CGI program running on the Netscape server. The data sent back is XML. Listing 2-13 is an XML data for sites associated with site http://metalab.unc.edu/:
Listing 2-13: XML data in contact with http://metalab.unc.edu/
href = "http:/// in fo.neetscape.com/fwd/rl/http://metalab.unc.edu:80/*">
href = "http://info.netscape.com/fwd/rl/http://www.sun.com/"
Name = "Sun Microsystems">
href = "http://info.netscape.com/fwd/rl/http://www.unc.edu/"
Name = "UNC">
HREF = "http://info.netscape.com/fwd/rl/http://sunsite.sut.ac.jp/"
Name = "sunsite
Japan
">
HREF = "http://info.netscape.com/fwd/rl/http://sunsite.nus.sg/"
Name = "sunsite
Singapore
">
HREF = "http://info.netscape.com/fwd/rl/http://sunsite.berkeley.edu/"
Name = "
Berkeley
Digital Library Sunsite ">
HREF = "http://info.netscape.com/fwd/rl/http://www.sun.com/sunsite"
Name = "sunsite on the net">
HREF = "http://info.netscape.com/fw.sunsite.auc.dk/"
Name = "sunsite
Denmark
">
HREF = "http://info.netscape.com/fwd/rl/http://sunsite.edu.cn/"
Name = "sunsite
China
">
HREF = "http://info.netscape.com/fwd/rl/http://sunsite.stanford.org/"
Name = "
Stanford
University
Sunsite>
HREF = "http://info.netscape.com/fwd/rl/http://www.cdromshop.com/
CDSHOP / DESC / P.061590000085.html "Name =" Sunsite Archive ">
Name = "Learn About Smart Browsing ...">
All this happens after the scene. Users will never know those data being transmitted with XML. In fact, it is displayed in the menu in Netscape Navigator, not an XML or HTML page.
These actually only use XML for immature surfaces for internal data. Many other items using XML have just started, and some projects will start next year. Most such projects will not be paid attention to publication, and they will not be touched in commercial publications, but in any case, they have potential for the company to save the company's development costs. XML self-illustrative is also useful for the company's internal data. For example, many companies are now in a hurry to find out if the retirement programmer has used two numbers 20 years ago. If you are doing something like this, you are willing to write the data into the following: 3C
79 65 61 72 3E 39 39
3C
2F
79 65 61 72 3E
Still below:
99
Unfortunately, many programmers now insist on writing data into the first format. XML also makes errors easy to discover and modify.
2.4 Summary of this chapter
This chapter just just exposed to the application that has been and will use XML. Some applications, such as CML, Mathml, and MusicML are obviously HTML extensions for web browsers. But many other applications, such as OFX, XFDL, and HRML are completely about another road. All of these applications have their own semantics and syntax on XML. In some cases, XML "root" is obvious, but in other cases, even if it works for a long time, it will not necessarily find what is related to XML. In this chapter, we discussed the following available XML applications:
· Molecular science using CML
Science and mathematics using Mathml
Use CDF web broadcast
Classics
Multimedia applications using SMIL and HTML TIME
Update by OSD
Vector graphic using pgml and vml
Music marker represented by musicml
Automatic audio response using VOXML
Financial data using OFX
Form with XFDL legally bundled
Human resource work information using HRML
Metadata expressed by RDF (META-DATA)
XML itself includes XSL, XLL, and DCD to make XML more perfect
Many companies apply XML on the Internet, including Microsoft, Federal Express, and Netscape
In the next chapter, the reader will learn to write its own XML document and display it on a web browser.