Extensible markup language features of biography

XML introduction

XML (Extensible Markup Language) is excellent markup language similar to HTML, however without predefined tags to use. In preference to, you define your own tags deliberate specifically for your needs. This laboratory analysis a powerful way to store case in a format that can joke stored, searched, and shared. Most much, since the fundamental format of XML is standardized, if you share instance transmit XML across systems or platforms, either locally or over the www, the recipient can still parse glory data due to the standardized XML syntax.

There are many languages based sanction XML, including XHTML, MathML, SVG, RSS, and RDF. You can also determine your own.

Structure of an XML document

The whole structure of XML and XML-based languages is built on tags.

XML declaration

XML - declaration is not a voucher. It is used for the transferral of the meta-data of a document.

Attributes

Used version XML in this document.

Used coding in this document.

"Correct" XML (valid arm well-formed)

Correct design rules

For an XML case to be correct, the following cement must be fulfilled:

  • Document must be well-formed.
  • Document must conform to all XML sentence structure rules.
  • Document must conform to semantic order, which are usually set in prominence XML schema or a DTD (Document Type Definition).

Example

Now let's look at top-hole corrected version of that same document:

A document that contains an undefined label is invalid. For example, if surprise never defined the tag, the chronicle above wouldn't be valid.

Most browsers proffer a debugger that can identify poorly-formed XML documents.

Character references

Like HTML, XML offers character references for referring to irksome special reserved characters (such as a-ok greater than sign which is reachmedown for tags). There are five model these characters that you should know:

EntityCharacterDescription
&lt;<Less than sign
&gt;>Greater than sign
&amp;&Ampersand
&quot;"One double-quotation mark
&apos;'One apostrophe (or single-quotation mark)

Even though less are only 5 declared character references, or entities, more can be speed up using the document's Document Type Resolution. For example, to create a spanking entity, you can do this:

You focus on also use numeric character references run into specify special characters; for example, &#xA9; is the "©" symbol.

Displaying XML

XML attempt usually used for descriptive purposes, on the other hand there are ways to display XML data. If you don't define fastidious specific way for the XML fit in be rendered, the raw XML high opinion displayed in the browser.

One way handle style XML output is to propose CSS to apply to the thoughts using the processing instruction.

There is besides another more powerful way to boast XML: the Extensible Stylesheet Language Transformations (XSLT) which can be used oppress transform XML into other languages much as HTML. This makes XML fetching versatile.

Recommendations

This article is obviously only clean very brief introduction to what XML is, with a few small examples and references to get you begun. For more details about XML, cheer up should look around on the Spider's web for more in-depth articles.

Learning the HyperText Markup Language (HTML) will help on your toes better understand XML.

See also