Question 11 :
How do I use prefixes to refer to element type and attribute names in an XML namespace?
Make sure you have declared the prefix and that it is still in scope . All you need to do then is prefix the local name of an element type or attribute with the prefix and a colon. The result is a qualified name, which the application parses to determine what XML namespace the local name belongs to.
For example, suppose you have associated the serv prefix with the http://www.our.com/ito/servers namespace and that the declaration is still in scope. In the following, serv:Address refers to the Address name in the http://www.our.com/ito/servers namespace. (Note that the prefix is used on both the start and end tags.)
<!-- serv refers to the http://www.our.com/ito/servers namespace. --> <serv:Address>127.66.67.8</serv:Address>
Now suppose you have associated the xslt prefix with the http://www.w3.org/1999/XSL/Transform namespace. In the following, xslt:version refers to the version name in the http://www.w3.org/1999/XSL/Transform namespace:
<!-- xslt refers to the http://www.w3.org/1999/XSL/Transform namespace. -->
Question 12 :
How do I use the default XML namespace to refer to element type names in an XML namespace?
Make sure you have declared the default XML namespace and that that declaration is still in scope . All you need to do then is use the local name of an element type. Even though it is not prefixed, the result is still a qualified name ), which the application parses to determine what XML namespace it belongs to.
For example, suppose you declared the http://www.w3.org/to/addresses namespace as the default XML namespace and that the declaration is still in scope. In the following, Address refers to the Address name in the http://www.w3.org/to/addresses namespace.
<!-- http://www.w3.org/to/addresses is the default XML namespace. --> <Address>220.127.116.11</Address>
Question 13 :
What is XML?
XML is the Extensible Markup Language. It improves the functionality of the Web by letting you identify your information in a more accurate, flexible, and adaptable way.
It is extensible because it is not a fixed format like HTML (which is a single, predefined markup language). Instead, XML is actually a metalanguage—a language for describing other languages—which lets you design your own markup languages for limitless different types of documents. XML can do this because it's written in SGML, the international standard metalanguage for text document markup (ISO 8879).
Question 14 :
What is a markup language?
A markup language is a set of words and symbols for describing the identity of pieces of a document (for example 'this is a paragraph', 'this is a heading', 'this is a list', 'this is the caption of this figure', etc). Programs can use this with a style sheet to create output for screen, print, audio, video, Braille, etc.
Some markup languages (e.g. those used in word processors) only describe appearances ('this is italics', 'this is bold'), but this method can only be used for display, and is not normally re-usable for anything else.
Question 15 :
Where should I use XML?
Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML.
Despite early attempts, browsers never allowed other SGML, only HTML (although there were plugins), and they allowed it (even encouraged it) to be corrupted or broken, which held development back for over a decade by making it impossible to program for it reliably. XML fixes that by making it compulsory to stick to the rules, and by making the rules much simpler than SGML.
But XML is not just for Web pages: in fact it's very rarely used for Web pages on its own because browsers still don't provide reliable support for formatting and transforming it. Common uses for XML include:
because you can define your own markup, you can define meaningful names for all your information items. Information storage
because XML is portable and non-proprietary, it can be used to store textual information across any platform. Because it is backed by an international standard, it will remain accessible and processable as a data format. Information structure
XML can therefore be used to store and identify any kind of (hierarchical) information structure, especially for long, deep, or complex document sets or data sources, making it ideal for an information-management back-end to serving the Web. This is its most common Web application, with a transformation system to serve it as HTML until such time as browsers are able to handle XML consistently. Publishing
The original goal of XML as defined in the quotation at the start of this section. Combining the three previous topics (identity, storage, structure) means it is possible to get all the benefits of robust document management and control (with XML) and publish to the Web (as HTML) as well as to paper (as PDF) and to other formats (e.g. Braille, Audio, etc) from a single source document by using the appropriate style sheets. Messaging and data transfer
XML is also very heavily used for enclosing or encapsulating information in order to pass it between different computing systems which would otherwise be unable to communicate. By providing a lingua franca for data identity and structure, it provides a common envelope for inter-process communication (messaging). Web services
Building on all of these, as well as its use in browsers, machine-processable data can be exchanged between consenting systems, where before it was only comprehensible by humans (HTML). Weather services, e-commerce sites, blog newsfeeds, AJAX sites, and thousands of other data-exchange services use XML for data management and transmission, and the web browser for display and interaction.