Archive for the 'java and xml Introduction' Category
XSL is the Extensible Stylesheet Language. It is defined as a language for expressing stylesheets. This broad definition is broken down into two parts:
XSL is a language for transforming XML documents.
XSL is an XML vocabulary for specifying the formatting of XML documents.
The definitions are similar, but one deals with moving from one XML document form […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
One of the cooler things about XML is the ability to transform it into something else. With the wealth of web-capable devices these days (computers, personal organizers, phones, DVRs, etc.), you never know what flavor of markup you need to deliver. Sometimes HTML works, sometimes XHTML (the XML flavor of HTML) is required, sometimes the […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
In February of 2004, the XML 1.1 specification was released by the World Wide Web Consortium (W3C; http://www.w3.org). If you don’t recall hearing much about XML 1.1, it’s no surprise; XML 1.1 was largely about Unicode conformance, and really didn’t affect XML as a whole that much, particularly for document authors and programmers not working […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
The last XML construct to look at is the CDATA section marker. A CDATA section is used when a significant amount of data should be passed on to the calling application without any XML parsing. It is used when an unusually large number of characters would have to be escaped using entity references, or when […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
One item I have not discussed is escaping characters, or referring to other constant type data values. For example, a common way to represent a path to an installation directory in online documentation is <path-to-Ant> or <TOMCAT_HOME>. Here, the user would replace the text with the appropriate choice of installation directory. In the following journal […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
Note the use of namespaces in the root element of Example 1-1:
<rdf:RDF xmlns:rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns:dc=”http://purl.org/dc/elements/1.1/”
xmlns=”http://purl.org/rss/1.0/” xmlns:admin=”http://webns.net/mvcb/”
xmlns:l=”http://purl.org/rss/1.0/modules/link/”
xmlns:content=”http://purl.org/rss/1.0/modules/content/“>
An XML namespace is a means of associating one or more elements in an XML document with a particular URI. This means that the element is identified by both its name and its namespace URI. In many complex […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
In addition to text contained within an element’s tags, an element can also have attributes. Attributes are included with their respective values within the element’s opening declaration (which can also be its closing declaration!). For example, in the channel element, a URL for information about the channel is noted in an attribute:
<channel rdf:about=”http://www.neilgaiman.com/journal/journal.asp”>
In this example, […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
So far, I have glossed over defining an actual element. Let’s take an in-depth look at elements, which are represented by arbitrary names and must be enclosed in angle brackets. There are several different variations of elements in the sample document, as shown here:
<!– Standard element opening tag –>
<items>
<!– Standard element with […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
The root element is the highest-level element in the XML document, and must be the first opening tag and the last closing tag within the document. It provides a reference point that enables an XML parser or XML-aware application to recognize a beginning and end to an XML document. In Example 1-1, the root element […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments
It all begins with the XML 1.0 Recommendation, which you can read in its entirety at http://www.w3.org/TR/REC-xml. Example 1-1 shows an XML document that conforms to this specification. I’ll use it to illustrate several important concepts.
Example 1-1. A typical XML document is long and verbose
<?xml version=”1.0″ encoding=”UTF-8″?> <rdf:RDF xmlns:rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#” […]
February 1st, 2008 | Posted in java and xml Introduction | No Comments