XML

views updated

XML Abbrev. for extensible markup language. A simplified form of SGML designed for use on the Web. It was introduced in 1997. In XML (as in SGML) different types of text are delineated by tags. Generally these tags are placed in angle brackets. For example, <i> starts italic text and </i> ends italic text. The convention is that an end tag is the same as a starting tag, but has a forward slash after the opening angle bracket. One of the rules of using XML is that every opening tag should have a corresponding closing tag. (Note that this is not the case in SGML or HTML, where closing tags may be implied.) The tags may be customized and, in general, indicate the type of information in the text. For example, the text of this dictionary is held in XML. The tag <en> is used to delineate an entry; tag <hw> is used for the headword; <def> is used for the dictionary definition; <xr> is used for a cross-reference; etc. Tags are able to have attributes. For example, to start a new letter in the dictionary one might use <letter alpha=“A”>. XML files have an ASCII format and characters that are not in the ASCII character set are represented by a string starting with ampersand and ending with semicolon. For example, letter e acute (é) is &…´ and letter a grave (à) is &agrave; (alternatively, a Unicode value can be used). XML files that have the correct tag structure are said to be “well-formed”. In addition, an XML file may have a DTD (document type definition) associated with it. Files that conform to their associated DTD are said to be “valid”.

XML is the preferred way of holding text. It is easily searchable and different types of information can be extracted using the tags. Also, it is easy to convert the tags into HTML tags for Web use or into typesetting tags for desktop publishing. There is also a style language, XSL (extensible style language), that can be used to define how the tagged elements will display (font, color, format, etc.). XSL files are themselves XML files. If an XML file has an associated XSL file (declared in the XML file) then suitable software will display it correctly.

A number of extensions of XML exist to cover chemical markup, mathematical notation, etc. In addition, XML is the basis of scalable vector graphics. See SVG.


More From encyclopedia.com