[Distributed computing environment learning notes] 6 basic part of the Web-oriented computing environment (Development and XML)

Source: Internet
Author: User
Tags xslt

Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/

1. Technical Features and Development History of web technology

A) Technical Features

  • Use Hypertext Technology (HTML) to connect information and information;
  • Use Uniform Resource Positioning Technology (URI) to precisely locate global information;
  • The new application layer protocol (HTTP) is used to achieve distributed information sharing.

B) Development History

Phase 1 web: static pages-each web site consists of a host, Web server, and many web pages. HTML (Hypertext Markup Language), HTTP (Hypertext Transfer Protocol), and Web 1.0.

The second stage of Web: dynamic pages-combining databases and web to publish information from databases on the Web. Typical technologies include CGI, server-specific APIs, ODBC, and JDBC.

The third stage of Web: Web 2.0 -- Starting from people, so that everyone can get up and get up, then, we use the power of software and machines to make the information more accessible to those who need it. The main supporting technologies include blog, RSS, wiki, and SNS.

 

2. XML Technology

A) Basic Concept: XML, the Extensible Markup Language, the latest page description language standard developed by the World Wide Web Consortium (W3C: World Wide Web Consortium), used to self-describe information. It focuses on describing the organization and structure of data content so that data can be exchanged and processed on the network.

B) basic features: each labeled data maintains its meaning, so the possibility of data exchange between systems is greatly increased.

C) Basic Concept: Structured labeled data is a language standard that achieves "document structuring.

D) features:

Scalability: XML is the meta language used to design Markup languages, rather than a specific markup language with a fixed set of tags, such as HTML. Just as Java allows users to declare their own classes, XML allows users to create and use their own tags, rather than the limited vocabulary of HTML. Scalability is crucial. enterprises can use XML to define their own Markup languages for e-commerce, supply chain integration, and other applications, and even specific industries to define special Markup languages in this field, as the basis for information sharing and data exchange in this field.

Flexibility: HTML is difficult to develop because it is a mixture of formats, hypertext, and graphic user interfaces. It is very difficult to develop these functions together at the same time. XML provides a structured data representation that separates user interfaces from structured data. In XML, you can use style sheets, such as XSL (Extensible Stylesheet Language, extensible style sheet language) and css2 (Cascading Style Sheet Level 2, Cascading Style Sheet level 2nd ), present the data to the browser. Hyper link between XML documents is supported by an independent xlink (Extensible linking language. All these aspects can be improved and developed independently. Therefore, many advanced functions pursued by web users are easier to implement in the XML environment.

Self-descriptive: XML documents usually contain a document type declaration, So XML documents are self-described. Not only can people understand XML documents, but computers can also process them. Data in XML documents can be extracted, analyzed, processed, and displayed in the required format by any application that can parse XML data. The XML Representation of data is truly independent from the application system and can be reused. Therefore, XML is suitable for open information management. Because of the Self-descriptive nature, the data in the document can be created, queried, and updated by XML applications, similar to processing data in traditional relational databases and object-oriented databases. Therefore, XML documents are seen as the data warehouse and data docing of documents.

Concise: XML only has about 20% of the complexity of SGML, but it has about 80% of SGML features. Compared with the complete SGML, XML is much simpler, easier to learn, and easier to implement. The birth of XML also draws on people's experience in using HTML on the web over the years. XML uses a Unicode character encoding system to support almost all major languages in the world, and texts in different languages can be mixed in the same document.

E) Related Terms

  • XML: an XML source code file written with XML tags. XML files are plain text files similar to ASCII files. They can be created and modified in any text editor. It consists of three parts:
    • XML Document declaration; declaration indicates an XML document, which complies with the XML version specification.
    • Definition of document types and style sheets;
    • Mark the content created with XML: The content body of the document
  • Element: similar to HTML, elements in XML are defined by tags, including start and end tags and content. Example: Bajin
  • Tag: used to define elements. In XML, tags must appear in pairs to enclose data in the middle. The tag name is the same as the element name (e.g .).
  • Attribute: similar to attributes in HTML, attributes in XML further describe and describe tags. A tag can have multiple attributes. Each attribute has its own name and value, which are part of the identifier. Example: Bajin
  • Well-formed XML (well-structured/well-formatted XML) is a document that complies with XML syntax rules and complies with XML specifications ". If all your tags strictly comply with the XML specification, then your XML document
    • You do not need a DTD file to define it.
    • Close all elements correctly (empty elements must be <element/>)
    • No cross between tags
    • All attribute values must be enclosed in quotation marks and attributes must appear in name-value pairs.
    • Other rules: for example, a document with a good structure must start with an XML declaration. For example:
  • Valid XML (valid XML) an XML document that complies with the XML syntax rules and the corresponding DTD/schema file specifications is called a valid XML document.
  • Parser: A tool software that checks whether an XML document complies with the DTD/schema definition. Compare and analyze the XML document with its DTD/schema file to see if it complies with the document data structure rules ).

F) DTD

Definition:Description of the Organization and storage structure of data in a data file. Describes the syntax and vocabulary of a markup language, that is, the overall structure of the file and the syntax of the file; specifies the details of all rules that a syntax analyzer needs to know to explain a "valid" XML file. Strictly defines where a data item should appear and lists all valid elements, such as elements, tags, attributes, and entities. defines the relationship between various data items.

Purpose:By creating different types of document definitions, we have data files of different formats. The DTD of data files of different formats is given according to certain standards. In this way, even if you encounter a data file with an unknown format but a DTD, you can analyze its DTD to know the organization structure of the data in the file, and then extract the data.

Example:

<? XML version = "1.0" encoding = "gb3212"?>
<! Element computer (manufacturer, identifier, clock speed, memory, hard disk, unit price)>
<! ATTLIST computer type # required>
<! Element manufacturer (# pcdata)>
<! Element identifier (type, model)>
<! Element type (# pcdata)>
<! Element Model (# pcdata)>
<! Element clock speed (# pcdata)>
<! Element Memory (# pcdata)>
<! Element hard drive (# pcdata)>
<! Unit price of element (# pcdata)>

"Computer" and "manufacturer" are defined using tags in XML documents.
2nd Action Element type declaration, the "computer" element is defined by multiple elements, such as the "manufacturer", "identifier", and "Frequency.
3rd Declaration of the behavior attribute list. A computer has a type attribute, and the attribute value is defined in the expression of text data. In such a document, all the symbols should be defined to correctly express the meaning of the data contained in the document.

Note:

1. pcdata indicates parsed character data, which is the standard character information parsed from a text file. Any number must be converted by the parser.

2. We recommend that you use Microsoft's XML notepad to check the DTD.

3. You can use CSS to format in XML, and the browser can parse it.

 

Usage of DTD:

The embedded DTD is directly included in the XML document (declaration part ).
External mode: calls an independent DTD file. Save the DTD document as a. DTD file and call it in the doctype declaration line.(Common)
If it is saved as computer. DTD, reference it as follows:

 

 

G) XML Schema

Basic concept: an upgraded version of the DTD that describes the XML Data Model in XML format. It has powerful features not available in the DTD, such as the data type and number of sub-elements, is an industry-standard XML data modeling tool. XML schema is a standard XML document. The supported data types include numeric, Boolean, integer, date and time, Uri, and decimal number. It also supports generating more complex types from these simple types.

H) XML display

When the display mode is to be expressed in the XML document element content, the XSL style sheet (XSL style sheet) described in the XSL language is used. When using the XSL method, the same document can complete multiple expressions and transformations to implement various types of display content. The XSL standard is essentially a translation mechanism that allows you to specify how to translate/display an XML tag.

  • Dsssl-Document Style and semantics Specification Language -- an international SGML standard for scheme-like ages for style sheets and document conversion
  • CSS-Cascading Style Sheet specification -- simple syntax for assigning styles to elements (in some HTML browsers)
  • XSL-extensible style language -- combines features of dsssl and CSS using XML syntax (a xsl style sheet is a XML file)
  • Both XSL and CSS are methods for modifying XML and can be used to define XML display formats.
    Differences between XSL and CSS:
    XSL is applied to the entire XML document, while CSS only specifies the display mode of HTML tags. The task is to specify a set of display attributes for HTML elements.
    CSS determines the visual appearance of the page, but does not change the structure of the source document.
    XSL is a markup language used to process documents, also known as a template-based language. It allows you to map a pattern to the source document, the output of the source document is written in XML, HTML, or plain text.

I) XML Conversion

XSLT (XSL transformations, XSL conversion): A Tool for XML format conversion, which is part of XSL. It is used to convert an XML format (conforming to an XML Data Model) to another XML format and convert the data to the Browser display format, convert business data between different content modes (transform the tree structure of the original XML document to other tree structures by defining rules, so that the document format is changed to the content required by the user ).

J) XML Web Model

The XML and DTD files are first expanded by the XML processor (parser) in a tree structure according to rules. For documents that do not comply with XML syntax rules, the XML processor prompts an error message. XML syntax rules are very strict. No matter which XML processor is used, the same tree structure must be extracted. The XSL processor displays data based on the data expanded by the tree structure and the XSL style table.

K) Comparison between XML and Related Technologies

XML vs. html

XML vs. Database

Key idea of XML: separating data content from applications improves data reusability and exchange efficiency on the network. (Using the data organization structure information described in XML, different data users can be guided to extract the data content they care about and use it for their respective purposes .)
Key idea of Database: store data in a way independent of data usage, so that it can be used by different applications.

XML vs. CORBA

CORBA: used to solve the interoperability between objects. It is mainly used for software integration and acts on the functional level.
XML: used to solve data interoperability. It can be used for software integration but at the data level.

L) XML Parsing

XML document parsing analyzes whether the content of an XML document complies with the XML standard, determines whether a document complies with the DTD/Schema, and supports access to the content of an XML document. There are two main Resolution Methods:

  • Dom (Document Object Model): Creates a hierarchical data structure based on the content of the document; readable, writable, and modifiable; W3C standard. This is an XML application interface based on the hierarchy tree. Dom provides a set of interfaces for users to load, operate, and serialize XML documents, and provides a full representation of XML documents stored in memory, provides a method to randomly access the entire document.
  • SAX (Simple API for XML): Event-based parser; sequential reading, fast, not writable; Industry de facto standard. Sax is an interface set that allows developers to read and analyze data in XML documents in their own applications. It was initially designed for the Java programming language and uses Java interface definitions.
  • Dom vs. Sax

You do not need to create a tree structure for the entire document in the memory. Compared with Dom, Sax is a lightweight interface set. For example, if you want to scan data to find information about a specific stock in the document, you do not need to put unnecessary data into the memory, you can use SAX to scan data to find information related to the stock, and then create a document structure that is only related to this part, thus saving system resources and processing time. Because the entire document is not stored in the memory, Sax cannot randomly reach a part of the document. At the same time, developers must process the information in order during the process, as a result, it is difficult for Sax to process documents that contain many internal cross-references, so it cannot implement complicated searches.

M) XML standard system

 

Basic Standard: specifies some common features, methods, or rules when XML is used to set standards.

  • XML: is the basis of the XML system. It mainly defines the low-level grammar of description data.
  • DTD: Specifies the logical structure of a document. XML documents that comply with the DTD syntax are considered valid.
  • XML Schema: describes how to define XML documents more strictly, so that you can process XML documents more automatically.
  • XML namespace: used to ensure the consistency of names in the xml dtd, so that names in different DTD can be merged into a document as needed.
  • Dom (Document Object Module): XML Document Object Model. It defines a set of platform-and language-independent interfaces so that XML documents can be controlled by software, so that programs and scripts can dynamically access and modify the content, structure, and style of XML documents.
  • XQuery: provides a flexible query mechanism to extract data from Web documents.
  • XPath (XML Path Language, XML Path Language): the element/attribute location mechanism used by XSLT. It is a language used to locate all parts of the XML document.
    Use the path to locate the elements/attributes in the XML file. Similar to the relative path concept in the operating system directory structure, XPath describes how to identify, select, and match components in an XML file, including elements, attributes, and text content.
  • Xll (Extensible link language): xlink and xpointer standards, which specify the content about links and positioning. Supports existing simple links on the web and further extends the link function, such as killing links, establishing two-way links, and linking to an element.
  • CSS (stacked style sheet): Used as the style standard for XML document display. CSS is a style table language developed for HTML and can be used to apply styles for XML documents. However, CSS does not have the ability to convert and generate structures (such as directories) that are usually required for XML-based publishing.
  • Extensible style language (XSL): the language used to specify the XML document style.

Application standards: various industries adopt XML to develop Internet-specific application standards to meet information exchange and archiving requirements within the industry.

  • XHTML: The standard for XML display (HTML is redefined using XML): In addition to more strict document standardization requirements, it can also use the namespace method in XML, use other Markup Language tags to enrich the display effect.
  • SVG: a language used to describe two-dimensional vector graphics and vector/dot matrix hybrid graphics.
  • GIF, JPEG, and PNG files are large and slow in transmission. SVG defines tags that specifically describe vector images. These images are described with points and lines, which can greatly reduce the file length and shorten the transmission time. SVG has the tags for defining image filtering operations and describing animations, greatly enriching the web page display effect.
  • SMIL (Synchronized Multimedia Integration Language, synchronous Multimedia Integration Language): A markup language used for video-synchronous multimedia platforms. It describes video, audio, image, text, and other effects, it can be used for online transmission of multimedia data such as training courses.
  • Soap: a remote object is called in a web system through the Internet communication protocol (HTTP. A soap file is an electronic envelope that can put a data block (payload) into the envelope. A data block consists of a tag describing the call method and the data parameters required to complete the method.

N) XML application

Transmission of structured data:

  • E-commerce between enterprises. WWW is used to exchange commodity information and receive and issue orders, thus reducing communication costs and software costs. By using XML to exchange and automatically update product information such as electronic directories, you can implement automatic directory classification and services, and implement Directory Services in multiple languages.
  • Document and knowledge management. XML provides practical knowledge management for various documents and materials. Using the structured and Semantic Functions of XML documents, you can manage multi-project indexes in a unified manner, and the new and old documents can be used together.
  • Publishing is independent of the media. XML and XSL together can replace the existing word processing and desktop publishing formats. In fact, they can provide a single, completely internationalized format with almost unlimited printing and online publishing capabilities, fully interoperable across all products and platforms.
  • Implement automatic information processing between enterprises.

O) Advantages of XML:

  • XML provides a powerful, flexible, and efficient way to express data content.
  • XML is highly scalable (by defining a new DTD/Schema ).
  • The data content in XML has nothing to do with specific applications, so that the data represented by XML is efficient and reusable.
  • XML uses DTD/Schema to make the contained data self-explanatory and can be used by different programs for different purposes.
  • XML adopts an open, text-based format, which can be created and edited by any tool from the text editor to the visual development environment, making the program simpler.
  • Data is separated from display. XSL specifies how to display data. You can specify different style sheets for the same data for different outputs and easily change the display format.
  • With strong link capabilities, you can define two-way links, multi-target links, extended links, and links between two documents.
  • Easy to handle. XML strictly defines the format and has a hierarchical structure, making it easier to process.
  • It is a non-vendor standard and can be processed by any parser.

 

Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/

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.