![]() |
![]() |
|
![]() |
![]() |
Encyclopedia :
X :
XM :
XML |
|
|
XML The Extensible Markup Language (XML) is a W3C-recommended general-purpose markup language for creating special-purpose markup languages. It is a simplified subset of SGML, capable of describing many different kinds of data. Its primary purpose is to facilitate the sharing of structured text and information across the Internet. Languages based on XML (for example, RDF, RSS, MathML, XSIL and SVG) are themselves described in a formal way, allowing programs to modify and validate documents in these languages without prior knowledge of their form. HistoryIn the mid-Nineties, some practitioners of SGML had gained experience with the then-new World Wide Web, and believed that SGML offered solutions to some of the problems the Web was likely to face as it grew. Jon Bosak argued that the W3C should sponsor an "SGML on the Web" activity. After some resistance, he was authorized to launch that activity in mid-1996, albeit with little involvement by or support from the W3C leadership. Bosak was well-connected in the small community of people who had experience both in SGML and the Web. He received active support in his efforts from Microsoft. XML was designed by an eleven-member Working Group supported by an (approximately) 150-member Interest Group. Technical debate took place on the Interest Group mailing list, and issues were resolved by consensus, or when that failed, majority vote, of the Working Group. James Clark served as Technical Lead of the Working Group, notably contributing the empty-element " The XML Working Group never met face-to-face; the design was accomplished using a combination of email and weekly teleconferences. The major design decisions were reached in twenty weeks of intense work between July and November of 1996. Further design work continued through 1997, and XML 1.0 became a W3C Recommendation on February 10, 1998. Strengths and weaknessesThe features of XML that make it well-suited for data transfer are: XML is also heavily used as a format for document storage and processing, both online and offline, and offers several benefits: For certain applications, XML also has the following weaknesses: Correctness in an XML documentFor an XML document to be correct, it must be: Well-formed documentsAn XML document is text, a sequence of Unicode characters in any one of a variety of encodings; while XML requires support for UTF-8 and UTF-16 and these are commonly used, the use of other encodings such as ISO-8859 is not uncommon. A well-formed document must conform to the following rules, among others:
: <MySample> ... </MySample>whereas this is not : <MySample> ... </Mysample>The careful choice of names for XML elements will convey the meaning of the data in the markup. This increases human readability while retaining the rigor needed for software parsing. For example, a simple recipe might be expressed in XML as:
Valid documentsAn XML document that complies with a particular schema, in addition to being well-formed, is said to be valid. An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic constraints imposed by XML itself. A number of standard and proprietary XML schema languages have emerged for the purpose of formally expressing such schemas, and some of these languages are XML-based, themselves. Before the advent of generalised data description languages such as SGML and XML, software designers had to define special file formats or small languages to share data between programs. This required writing detailed specifications and special-purpose parsers and writers. XML's regular structure and strict parsing rules allow software designers to leave parsing to standard tools, and since XML provides a general, data model-oriented framework for the development of application-specific languages, software designers need only concentrate on the development of rules for their data, at relatively high levels of abstraction. Well-tested tools exist to validate an XML document "against" a schema: the tool automatically verifies whether the document conforms to constraints expressed in the schema. Some of these validation tools are included in XML parsers, and some are packaged separately. Other usages of schemas exist: XML editors, for instance, can use schemas to support the editing process. DTDThe oldest schema format for XML is the Document Type Definition (DTD), inherited from SGML. While DTD support is ubiquitous due to its inclusion in the XML 1.0 standard, it is seen as limited for the following reasons:
XML SchemaA newer XML schema language, described by the W3C as the successor of DTDs, is XML Schema, or more informally referred to in terms of the initialism for XML Schema instances, XSD (XML Schema Definition). XSDs are far more powerful than DTDs in describing XML languages. They use a rich datatyping system, allow for more detailed constraints on an XML document's logical structure, and are required to be processed in a more robust validation framework. Additionally, XSDs use an XML based format, which makes it possible to use ordinary XML tools to help process them, although WXS implementations require much more than just the ability to read XML. Criticisms of WXS include the following: RELAX NGAnother popular schema language for XML is RELAX NG. Initially specified by OASIS, RELAX NG is now also an ISO international standard (as part of DSDL). It has two formats: an XML based syntax and a non-XML compact syntax. The compact syntax aims to increase readability and writability, but since there is a well-defined way to translate compact syntax to the XML syntax and back again by means of James Clark's Trang conversion tool, the advantage of using standard XML tools is not lost. Compared to XML Schema, RELAX NG has a simpler definition and validation framework, making it easier to use and implement. It also has the ability to use any datatype framework on a plug-in basis; for example, a RELAX NG schema author can require values in an XML document to conform to definitions in XML Schema Datatypes. Other schema languagesSome schema languages not only describe the structure of a particular XML format but also offer limited facilities to influence processing of individual XML files that conform to this format. DTDs and XSDs both have this ability; they can for instance provide attribute defaults. RELAX NG intentionally does not provide these facilities. Displaying XML on the webExtensible Stylesheet Language (XSL) is a supporting technology that describes how to format or transform the data in an XML document. The document is changed to a format suitable for browser display. The process is similar to applying a CSS to an HTML document for rendering.Without using CSS or XSL, a generic XML document is rendered differently in different web browsers. Browsers like Internet Explorer and Mozilla allow viewing of generic XML document similar to directory structure, e.g. expanding or collapsing a subtree. In order to allow CSS styling, the XML document must include a special reference to a style sheet:
<link> element.For XSL Transformations (XSLT), this is also very similar:
While browser-based XML rendering develops, the alternative is conversion into HTML or PDF or other formats on the server. Programs like Cocoon process an XML file against a stylesheet (and can perform other processing as well) and send the output back to the user's browser without the user needing to be aware of what has been going on in the background. XML extensions
A filter in the Extensible Stylesheet Language (XSL) family can transform an XML file for displaying or printing.
Versions of XMLThere are two current versions of XML. The first, XML 1.0, was initially defined in 1998. It has undergone minor revisions since then, without being given a new version number, and is currently in its third edition, as published on February 4, 2004. It is widely implemented and still recommended for general use. The second, XML 1.1, was initially published on the same day as XML 1.0 Third Edition. It contains features — some contentious — that are intended to make XML easier to use for certain classes of users (mainframe programmers, mainly). XML 1.1 is not very widely implemented and is recommended for use only by those who need its unique features. XML 1.0 and XML 1.1 differ in the requirements of characters used for element names, attribute names etc.: XML 1.0 only allows characters which are defined in Unicode 2.0, which includes most world scripts, but excludes scripts which only entered in a later Unicode version, such as Mongolian, Cambodian, Amharic, Burmese, etc.. It should be noted here that the restriction present in XML 1.0 only applies to element/attribute names: both XML 1.0 and XML 1.1 allow for the use of full Unicode in the content itself. Thus XML 1.1 is only needed if in addition to using a script added after Unicode 2.0 you also wish to write element and attribute names in that script. Other minor changes between XML 1.0 and XML 1.1 are that control characters are now allowed to be included but only when escaped, and two special Unicode line break characters are included, which must be treated as whitespace. XML 1.0 documents are well-formed XML 1.1 documents with one exception: XML documents that contain unescaped C1 control characters are now malformed: this is because XML 1.1 requires the C1 control characters to be escaped with numeric character references. There are also discussions on an XML 2.0, although it remains to be seen if such will ever come about. XML-SW (SW for skunk works), written by one of the original developers of XML, contains some proposals for what an XML 2.0 might look like: elimination of DTDs from syntax, integration of namespaces, XML Base and XML Information Set (infoset) into the base standard. The World Wide Web Consortium also has a XML Binary Characterization Working Group doing preliminary research into use cases and properties for a binary encoding of the XML infoset. The working group is not chartered to produce any official standards. Since XML is by definition text-based, Sun Microsystems has proposed the name fast infoset for its own binary infoset to avoid confusion, and is working to standardize that through ISO. See alsoReferencesExternal links
|
|
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License. |
|
| © 2008 Chamas Enterprises Inc. |