# XML - Managing Data Exchange/Exchanger XML Lite

## Exchanger XML Lite

Cladonia offers an xml editor at <http://www.exchangerxml.com/> for free
noncommercial use, and can be downloaded without registration.

This is a Java-based product that runs on all platforms including
Windows, Linux, Mac OSX and UNIX.

(NOTE: If you need an XML editor for commercial use, you can get a free
30-day trial of Exchanger XML Professional at
<http://www.exchangerxml.com>)

## Single Entity in Exchanger XML Lite

The following directions will lead you step-by-step through doing the
same project that is found in the ../A single
entity chapter.

## Part One: Creating the Project Folder

1\) Open Exchanger XML Lite

2\) Click on:

`     -Project`\
`      -New Project : a "New Project" folder will appear `\
`                in the project folder window`

3\) Type \"TourGuide\" over the \"New Project\" title to change the name
of the new project to TourGuide.

![](exchange2.png "exchange2.png")

## Part Two: Creating the Schema File

1\) Click on:

`     -File`\
`      -New `\
`      -For Type`\
`       -Scroll to "XML Schema Definition" and highlight it`\
`       -OK`

2)Exchanger automatically puts the beginning and ending tags in the file
for you, however, for our example, delete those automatic tags, and copy
and paste the following code into the file:

`<?xml version="1.0" encoding="UTF-8"?>`\
` <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"> `\
`  <!-- Tour Guide -->`\
`  <!--The tourGuide element is defined as a complex element type, i.e. `\
`    it has embedded elements.--> `\
`  <xsd:element name="tourGuide">`\
`    <xsd:complexType>`\
`      <xsd:sequence>`\
`        <!--The minimum number of times an element can occur is `\
`         set using minOccurs (default is 1) and an unlimited `\
`        number of times an element can occur maxOccurs=”unbounded”.-->`\
`        <xsd:element name="city" type="cityDetails" minOccurs = "1" maxOccurs="unbounded" />`\
`      </xsd:sequence>`\
`    </xsd:complexType>`\
`   </xsd:element>`\
`   <!-- City -->`\
`   <!--City is declared an element of named complex type -->`\
`   <!--<xsd:complexType begins the declaration of a complex `\
`type, ”cityDetails” identifies the complex type. `\
`   This is NOT the name of the element. This complex type `\
`   definition may be used in the declarations of more than one element.-->`\
`   <xsd:complexType name="cityDetails">`\
`    <!--Schema element sequence {13} specifies that the child elements `\
`    must appear in the order specified.-->`\
`    <xsd:sequence>`\
`       <!--<xsd:element begins the declaration of an element of simple `\
`       type. ”cityName” is the name of the element being declared (in `\
`       the XML document it will look something like: <cityName> ) `\
`       and ”xsd:string” is the data type of the element.--> `\
`       <xsd:element name="cityName" type="xsd:string"/>`\
`       <xsd:element name="adminUnit" type="xsd:string"/>`\
`       <xsd:element name="country" type="xsd:string"/>`\
`       <xsd:element name="population" type="xsd:integer"/>`\
`       <xsd:element name="area" type="xsd:integer"/>`\
`       <xsd:element name="elevation" type="xsd:integer"/>`\
`       <xsd:element name="longitude" type="xsd:decimal"/>`\
`       <xsd:element name="latitude" type="xsd:decimal"/>`\
`       <xsd:element name="description" type="xsd:string"/>`\
`       <xsd:element name="history" type="xsd:string"/>`\
`     <!--Closing of tags. Note: these should not overlap.--> `\
`     </xsd:sequence>`\
`   </xsd:complexType>`\
` </xsd:schema>`

3\) Click on the GREEN CHECK to Validate, and the BROWN CHECK to check
for Well-Formedness. These can be found on the toolbar:
![](Exchanger1.png "Exchanger1.png")

(NOTE: Be sure to eliminate any \"white space\" before the text that you
paste, or you may have an error when validating.)

4)Click on:

`  -File`\
`  -Save`\
`   -"city.xsd"`

5)Right Click on:

`  -"TourGuide" project folder`\
`   -Add File`\
`    -click on "city.xsd"`\
`    -open`\
`   `\
` (Note: Now the project "TourGuide" should contain one file,`\
`    "city.xsd".)`

## Part Three: Creating the Style Sheet

1)Click on:

`  -File`\
`  -New`\
`   -For Type`\
`   -Scroll to "XML StyleSheet Language" and highlight it`\
`    -OK`

2)Delete any automatic tags that appear, and cut and paste the following
code into the file:

`<?xml version="1.0" encoding="UTF-8"?>`\
` <!--<xsl:stylesheet> declares start of stylesheet and identifies the version `\
`   number and the official W3C namespace.-->`\
`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">`\
`  <xsl:output method="html"/>`\
`  <!--<xsl:template> defines the start of a template and contains `\
`  rules to apply when a specified node is matched. The match attribute is `\
`  used to associate (match) the template with an XML element, in this case `\
`  the root (/), or whole branch, of the XML source document. The XSL looks `\
`  for the root match and then outputs the HTML.--> `\
`  <xsl:template match="/">`\
`    <!--The contents of the template element are placed in the output `\
`     stream of HTML that the browser will be able to interpret.-->`\
`    <html>`\
`      <head>`\
`        <title>Tour Guide</title>`\
`      </head>`\
`      <body>`\
`        <h2>Cities</h2>`\
`        <xsl:apply-templates select="tourGuide"/>`\
`      </body>`\
`    </html>`\
`  </xsl:template>`\
`  <xsl:template match="tourGuide">`\
`    <xsl:for-each select="city">`\
`      <xsl:text>City: </xsl:text>`\
`        <!--<xsl:value-of> extracts the value of the selected `\
`        node/XML element and adds it to the output stream-->`\
`        <xsl:value-of select="cityName"/>`\
`        <br/>`\
`      <xsl:text>Population: </xsl:text>`\
`        <xsl:value-of select="population"/>`\
`        <br/>`\
`      <xsl:text>Country: </xsl:text>`\
`        <xsl:value-of select="country"/>`\
`        <br/>`\
`        <br/>`\
`    </xsl:for-each>`\
`  <!--<xsl:for-each> can be used to loop through each node in a specified `\
`     node set and add them to the output-->   `\
`  </xsl:template>`\
` </xsl:stylesheet>`

3\) Click on the GREEN CHECK to Validate, and the BROWN CHECK to check
for Well-Formedness. (NOTE: Be sure to eliminate any \"white space\"
before the text that you paste, or you may have an error when
validating.)

4)Click on:

`  -File`\
`   -Save As`\
`   -"city.xsl"`

5)Right Click on:

`  -"TourGuide" project folder`\
`   -Add File`\
`   -"city.xsl"`\
`    -open`

`  (Note: Now the project "TourGuide" contains two files, `\
`   "city.xsd", and "city.xsl".)`

!thumhttp://xpressvds.blogspot.com/bnail

## Part Four: Creating the XML File

1\) Click on:

` -File`\
`  -New`\
`  -Default XML Document`\
`   -OK`

2\) Delete any automatic tags that appear and copy and paste the
following code:

`<?xml version="1.0" encoding="UTF-8"?>`\
`<?xml-stylesheet href="city.xsl" type="text/xsl"?>`\
``\
`<!--The following declaration identifies the root element of the document `\
`(tourGuide) and the schema file (city.xsd) using xsi=schemaLocation-->`\
`<tourGuide>`\
`  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'`\
`  xsi:noNamespaceSchemaLocation='city.xsd'>`\
`  <!--The definition of the first city-->`\
`  <city>`\
`    <cityName>Belmopan</cityName>`\
`    <adminUnit>Cayo</adminUnit>`\
`    <country>Belize</country>`\
`    <population>11100</population>`\
`    <area>5</area>`\
`    <elevation>130</elevation>`\
`    <longitude>88.44</longitude>`\
`    <latitude>17.27</latitude>`\
`    <description>Belmopan is the capital of Belize</description>`\
`    <history>Belmopan was established following the devastation of the`\
`      former capitol, Belize City, by Hurricane Hattie in 1965. High `\
`      ground and open space influenced the choice and ground-breaking `\
`      began in 1966. By 1970 most government offices and operations had `\
`      already moved to the new location.`\
`    </history>`\
`  </city>`\
`  <!--the definition of the second city-->`\
`  <city>`\
`    <cityName>Kuala Lumpur</cityName>`\
`    <adminUnit>Selangor</adminUnit>`\
`    <country>Malaysia</country>`\
`    <population>1448600</population>`\
`    <area>243</area>`\
`    <elevation>111</elevation>`\
`    <longitude>101.71</longitude>`\
`    <latitude>3.16</latitude>`\
`    <description>Kuala Lumpur is the capital of Malaysia and the largest `\
`      city in the nation</description>`\
`    <history>The city was founded in 1857 by Chinese tin miners and `\
`      perseded Klang. In 1880 the British government transferred their `\
`      headquarters from Klang to Kuala Lumpur, and in 1896 it became the `\
`      capital of Malaysia. `\
`    </history>`\
`  </city>`\
`<!--The closing of the root element tag-->  `\
`</tourGuide>`

3\) Click on the GREEN CHECK to Validate, and the BROWN CHECK to check
for Well-Formedness. (NOTE: Be sure to eliminate any \"white space\"
before the text that you paste, or you may have an error when
validating.)

`(Also NOTE: You may need to select `\
` -Schema`\
` -Infer XML Schema`\
`  -then choose city.xsd`\
`in order to validate the xml file.)`

4)Click on:

` -File`\
` -Save As`\
`  -city.xml`

5\) Right click on:

` -TourGuide`\
`  -Add File`\
`  -"city.xml"`\
`   -open`\
`(Note: Now project "TourGuide" should contain three files, `\
`"city.xsd","city.xsl", and "city.xml".)`

## Part Five: Executing your code

1\) Open the city.xml file.

2\) Click on:

` -Transform`\
` -Execute Simple XSLT`\
`  -Current Document`\
`  -OK`

`  -XSL input`\
`   -From URl`\
`   -pick city.xsl`\
`    -open`\
`     -OK`

`    -Use Default Processor`\
`     -OK`\
`Note: the window should say "Transformation Complete"`

`Now you may close this window and follow step 3 to get the results.`

3)Click on:

` -Tools`\
` -Start Browser`\
`  `\
`Note: Results should look like this:`

![](Exchanger_XML_Lite_result.png "Exchanger_XML_Lite_result.png")


# XML - Managing Data Exchange/XML and JDBC

## Overview

ODBC is the acronym for the oft used API Open Database Connectivity.
Many applications and application programmers use ODBC in order to
access relational databases, such as SQL and Microsoft Access, and to
manipulate the data within the databases. Specifically, JDBC (Java
Database Connectivity), which is based on ODBC, is the API used by
applications developed in Java to perform these various tasks. Moreover,
JDBC is now capable of handling advanced datatypes in SQL which in turn
becomes useful when dealing with XML. Also, JDBC has within it the
ability to actually create XML data. Furthermore, the use of JAXP (Java
API for XML Processing) along with JDBC provides yet another way of
manipulating and using relational databases and XML. In any event, there
are multiple ways to use the JDBC API with XML.

## JDBC and XML Documents

Many Java Applications written today will more than likely interact with
an SQL database (or a relational database, but for the sake of
uniformity, we will work with SQL.) Depending on the intent of the
application, there may be the case of actually storing an XML document
for display or for manipulation. Whatever the case, JDBC now supports
all datatypes defined in the SQL:1999 specification. One of theses
datatypes is the CLOB (character large object) datatype. This datatype
is perfect for storing XML documents. This is one way XML and the JDBC
API works with each other.

## JDBC and XML Production

One of the more interesting things about JDBC is that it can be used to
gather MetaData. Meta-data is nothing more than data about data. From an
XML standpoint, this is very useful because we can create XML data on
the fly with nothing more than a table name. The class that makes this
possible is java.sql.ResultSetMetaData. Consequently this class is a
part of the JDBC API.

## JDBC and JAXP

Another intriguing way of dealing with XML objects is within the JAXP
(Java API for XML Processing). JAXP and JDBC together provide an
infrastructure for developing applications using XML and SQL.

Whenever XML instances in applications are dealt with, an XML parser is
a good tool to use. The XML parser turns the XML document into an object
or something the application can uses. Specifically, Document Object
Model (DOM) takes and XML instance and converts it into a tree. This
specific parser can be found in the JAXP API. You may then store the
parsed object in an SQL database for future use. This may open up many
ideas of how one may use JAXP and JDBC together when an issue presents
itself of dealing with XML and SQL.

## References

-   <http://www.xml.com>
-   <http://java.sun.com/xml>
-   Stels XML JDBC
    driver - JDBC driver
    for XML files.


# XML - Managing Data Exchange/XForms

## What Is XForms?

Forms are an important part of many web applications today. An HTML form
makes it possible for web applications to accept input from a user. Web
users now do complex transactions that are starting to exceed the
limitations of standard HTML forms. XForms is the next generation of
HTML forms and is richer and more flexible than HTML forms.\
\
XForms uses XML for data definition and HTML or XHTML for data display.
XForms separates the data logic of a form from its presentation.
Separating data from presentation makes XForms device independent,
because the data model can be used for all devices. The presentation can
be customized for different user interfaces, like mobile phones and
handheld devices and can provide interactivity between such devices. It
is also possible to add XForms elements directly into other XML
applications like VoiceXML (speaking web data), WML (Wireless Markup
Language), and SVG (Scalable Vector Graphics).\
\

## The Purpose of XForms

XForms is the separation of purpose from presentation. For example, the
purpose of a questionnaire application is to collect information about
the user. This is done by creating a presentation that allows the user
to provide the required information. Web applications typically render
such a presentation as an interactive document that is continuously
updated during user interaction. By separating the purpose from its
presentation, XForms enables the binding of different interactions to a
single model.\

## The Main Aspects of XForms

The **XForms model** defines what the form is, what data it contains,
and what it should do. The **XForms user interface** defines the input
fields and how they should be displayed. The **XForms Submit Protocol**
defines how XForms send and receive data, including the ability to
suspend and resume the completion of a form. **XForms is \"instance
data\"**, an internal representation of the data mapped to the familiar
\"form controls\". Instance data is based on XML and defined in terms of
XPath's internal tree representation and processing of XML\

## The XForms Framework

With XForms, input data is described in two different parts:

1.  XForm model\
2.  XForm user interface\

\

### The XForms Model

The XForm model defines what the form is, what data it contains, and
what it should do.\
The data model is an instance (a template) of an XML document. The
XForms model defines a data model inside a `<model>`{=html} element:\

` ``<model>`{=html}\
` ``<instance>`{=html}\
`   ``<person>`{=html}\
`     ``<fname/>`{=html}\
`     ``<lname/>`{=html}\
`   ``</person>`{=html}\
` ``</instance>`{=html}\
` ``<submission id="form1" action="submit.asp" method="get"/>`{=html}\
` ``</model>`{=html}

\
From the example above, you can see that the XForms model uses an
`<instance>`{=html} element to define the XML template for data to be
collected, and a `<submission>`{=html} element to describe how to submit
the data.\
The XForms model does not say anything about the visual part of the form
(the user interface).\
\
====The `<instance>`{=html} Element==== The data collected by XForms is
expressed as XML instance data. XForms is always collecting data for an
XML document. The `<instance>`{=html} element in the XForms model
defines the XML document.\
In the example above the \"data instance\" (the XML document) the form
is collecting data for looks like this:

` ``<person>`{=html}\
`   ``<fname/>`{=html}\
`   ``<lname/>`{=html}\
` ``</person>`{=html}

After collecting the data, the XML document might look like this:

` ``<person>`{=html}\
`   ``<fname>`{=html}`Jim``</fname>`{=html}\
`   ``<lname>`{=html}`Jones``</lname>`{=html}\
` ``</person>`{=html}

\

#### The `<submission>`{=html} Element

The XForms model uses a `<submission>`{=html} element to describe how to
submit the data. The `<submission>`{=html} element defines a form and
how it should be submitted. In the example above, the id=\"form1\"
attribute identifies the form, the action=\"submit.asp\" attribute
defines the URL to where the form should be submitted, and the
method=\"get\" attribute defines the method to use when submitting the
data.\
\
The following diagram shows how the XForm model has the capability to
work with a variety of user interfaces.

### The XForms User Interface

The XForms user interface is used to display and input the data. The
user interface elements of XForms are called controls (or input
controls):

` ``<input ref="fname">`{=html}``{=html}`First Name```{=html}`</input>`{=html}\
` ``<input ref="lname">`{=html}``{=html}`Last Name```{=html}`</input>`{=html}\
` ``<submit submission="form1">`{=html}``{=html}`Submit```{=html}`</submit>`{=html}

In the example above the two `<input>`{=html} elements define two input
fields. The ref=\"fname\" and ref=\"lname\" attributes point to the
`<fname>`{=html} and `<lname>`{=html} elements in the XForms model. The
`<submit>`{=html} element has a submission=\"form1\" attribute which
refers to the `<submission>`{=html} element in the XForms model. A
submit element is usually displayed as a button. Notice the
`<label>`{=html} elements in the example. With XForms every input
control element has a required `<label>`{=html} element.\
==Putting Everything Together== XForms has to run inside another XML
document. It could run inside XHTML 1.0, and it will run inside XHTML
2.0. If we put it all together, the document will look like this:

` ``<xforms>`{=html}\
` ``<model>`{=html}\
` ``<instance>`{=html}\
`   ``<person>`{=html}\
`     ``<fname/>`{=html}\
`     ``<lname/>`{=html}\
`   ``</person>`{=html}\
` ``</instance>`{=html}\
` ``<submission id="form1" action="submit.asp" method="get"/>`{=html}\
` ``</model>`{=html}\
` ``<input ref="fname">`{=html}``{=html}`First Name```{=html}`</input>`{=html}\
` ``<input ref="lname">`{=html}``{=html}`Last Name```{=html}`</input>`{=html}\
` ``<submit submission="form1">`{=html}``{=html}`Submit```{=html}`</submit>`{=html}\
` ``</xforms>`{=html}

\

## The XForms Processor

An XForms Processor built into the browser will be responsible for
submitting the XForms data to a target. The data can be submitted as XML
and could look something like this:

` ``<person>`{=html}\
`   ``<fname>`{=html}`Jim``</fname>`{=html}\
`   ``<lname>`{=html}`Jones``</lname>`{=html}\
` ``</person>`{=html}

Or it can be submitted as text, looking something like this:

` fname=Jim;lname=Jones`

\

## The XForms Namespace

The official namespace for XForms is: <http://www.w3.org/2002/xforms>.
If you want to use XForms in HTML (or XHTML 1.0), you should declare all
XForms elements with an XForms namespace. XForms is expected to be a
standard part of XHTML 2.0, eliminating the need for the XForms
namespace.

## An XForms Example

Take a look at this document using XForms:

` ``<xforms>`{=html}\
` ``<model>`{=html}\
`   ``<instance>`{=html}\
`   ``<person>`{=html}\
`     ``<fname/>`{=html}\
`     ``<lname/>`{=html}\
`   ``</person>`{=html}\
`   ``</instance>`{=html}\
`   ``<submission id="form1" method="get" action="submit.asp"/>`{=html}\
` ``</model>`{=html}\
` ``<input ref="fname">`{=html}\
` ```{=html}`First Name```{=html}`</input>`{=html}\
`  ``<input ref="lname">`{=html}\
` ```{=html}`Last Name```{=html}`</input>`{=html}\
\
`  ``<submit submission="form1">`{=html}\
` ```{=html}`Submit```{=html}`</submit>`{=html}\
` ``</xforms>`{=html}

## The Form Controls

The components of the form that deal with data entry and display are
referred to as the form controls or user interface controls. XForms
defines a comprehensive set of device-neutral, platform-independent form
controls. For each element of data defined in the model, a form control
defines its appearance via the client. These controls can be combined
with stylesheets to provide sophisticated form displays.

```{=html}
<table border="1">
```
```{=html}
<tr>
```
```{=html}
<td>
```
**XForms form control**

```{=html}
</td>
```
```{=html}
<td>
```
**Closest XHTML equivalent**

```{=html}
</td>
```
```{=html}
<td>
```
**Description**

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<input>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
`<input type="text">`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
For entry of small amounts of text

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
```{=html}
<textarea>
```
```{=html}
</td>
```
```{=html}
<td>
```
```{=html}
<textarea>
```
```{=html}
</td>
```
```{=html}
<td>
```
For entry of large amounts of text

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<secret>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
```{=html}
<textarea>
```
```{=html}
</td>
```
```{=html}
<td>
```
For entry of large amounts of text

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<secret>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
`<input type="password">`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
For entry of sensitive information

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
```{=html}
<output>
```
```{=html}
</td>
```
```{=html}
<td>
```
N/A

```{=html}
</td>
```
```{=html}
<td>
```
For inline display of any instance data

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<range>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
N/A

```{=html}
</td>
```
```{=html}
<td>
```
For smooth \"volume control\" selection of a value

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<upload>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
`<input type="file">`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
For upload of file or device data

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<trigger>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
`<button>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
For activation of form events

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<submit>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
`<input type="submit">`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
For submission of form data

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<select>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
`<select multiple="multiple">`{=html} or multiple
`<input type="checkbox">`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
For selection of zero, one, or many options

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<select1>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
`<select>`{=html} or multiple `<input type="radio">`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
For selection of just one option among several

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
\

## XForms Action

In the course of form processing, often some particular action needs to
happen.

```{=html}
<table border="1">
```
```{=html}
<tr>
```
```{=html}
<td>
```
**XForms Action**

```{=html}
</td>
```
```{=html}
<td>
```
**Description**

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
setfocus

```{=html}
</td>
```
```{=html}
<td>
```
Gives focus to a particular form control.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
setvalue

```{=html}
</td>
```
```{=html}
<td>
```
Sets the value of a particular node.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
message

```{=html}
</td>
```
```{=html}
<td>
```
Displays a message to the user.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
send

```{=html}
</td>
```
```{=html}
<td>
```
Submits all or part of the instance data.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
reset

```{=html}
</td>
```
```{=html}
<td>
```
Resets all or part of the instance data.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
load

```{=html}
</td>
```
```{=html}
<td>
```
Opens a document in the same or a new window.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
refresh

```{=html}
</td>
```
```{=html}
<td>
```
Refreshes the view of the instance data.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
recalculate

```{=html}
</td>
```
```{=html}
<td>
```
Recalculates the instance data.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
revalidate

```{=html}
</td>
```
```{=html}
<td>
```
Revalidates the instance data.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
setindex

```{=html}
</td>
```
```{=html}
<td>
```
Navigates through a repeating sequence.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
insert

```{=html}
</td>
```
```{=html}
<td>
```
Inserts a node from a repeating sequence.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
delete

```{=html}
</td>
```
```{=html}
<td>
```
Removes a node from a repeating sequence.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
toggle

```{=html}
</td>
```
```{=html}
<td>
```
Selects a case of a switch

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
dispatch

```{=html}
</td>
```
```{=html}
<td>
```
Dispatch an event.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
\

## XForms Methods

The XForms specification uses and builds upon XPath, which includes
adding some method calls useful for forms: These can be called at any
point where XPath is allowed. Additionally, implementations can support
"extension functions" to provide additional functionality.

```{=html}
<table border="1">
```
```{=html}
<tr>
```
```{=html}
<td>
```
**Method**

```{=html}
</td>
```
```{=html}
<td>
```
**Description**

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
avg()

```{=html}
</td>
```
```{=html}
<td>
```
Returns the arithmetic mean of the indicated nodes

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
min() and max()

```{=html}
</td>
```
```{=html}
<td>
```
Returns the minimum or maximum value of the indicated nodes

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
count-non-empty()

```{=html}
</td>
```
```{=html}
<td>
```
Returns the number of non-empty nodes

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
if()

```{=html}
</td>
```
```{=html}
<td>
```
Returns one of two strings depending on a Boolean value

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
index()

```{=html}
</td>
```
```{=html}
<td>
```
Indicates the current position in a repeating sequence

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
days-from-date()

```{=html}
</td>
```
```{=html}
<td>
```
Converts an XML Schema datatype into a number of days

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
seconds-from-dateTime()

```{=html}
</td>
```
```{=html}
<td>
```
Converts an XML Schema datatype into a number of seconds

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
seconds()

```{=html}
</td>
```
```{=html}
<td>
```
Converts an XML Schema duration into a number of seconds

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
months()

```{=html}
</td>
```
```{=html}
<td>
```
Converts an XML Schema duration into a number of months

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
now()

```{=html}
</td>
```
```{=html}
<td>
```
Returns the current date/time

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
\

## See Also

-   XForms Tutorial and Cookbook Wikibook This wiki
    book has over 75 XForms examples with links to working XForms
    applications.


# XML - Managing Data Exchange/XMLWebAudio

## Learning Objectives

Upon completion of this chapter, you will

-   understand the potential of XML based web delivery of audio text
    files
-   understand the use of SSML (Synthetic Speech Markup Language), the
    XML subset of tags

### The Problem:

How can text files of any content a user chooses be transferred to the
user in such a form that the end user can listen to them on a piece of
hardware that has mobile internet capability? An example would be
someone listening to a news report of any topic or from any region just
by converting text files which already exist on the internet to a
sythesized voice for playing on a mobile device in an automobile.

Existing Technology: There are several technologies available that work
with voice data. Voice XML provides a framework for transferring voice
data between entities. It is used for interactive voice triggered tools.
This technology is used extensively for phone menus and automated help
by companies with customer service or other areas of high call volume
needs.

Internet radio exists and provides a user with music or other
programming that is broadcast throughout the internet. This programming
is not up to the choice of the end user other than to select the
internet station to listen to.

Software exists that can convert any text file into an audio file. Text
files can be converted to audio files using software provided in the
Windows or Mac operating systems or very inexpensive stand-alone
software (an example is TextAloud). TextAloud allows a user to modify
the voice, the pace of reading and other features. Free versions of it
are available online. These systems can modify the voice in multiple
ways to the personal taste of a user. These systems do not make the
files available over the internet for users to search and listen to.

### The Potential:

With the right combination of XML technology, mobile communication
services and software/hardware that already exists the idea of internet
radio could be opened to a much larger volume of content than currently
exists. Most internet radio is in the form of music files and programed
radio content. The choices of internet radio could be extended to
include any existing text file which would include news reports,
government documents, educational materials and many forms of official
records. A business example would be a travelling salesman briefing
himself on a client's buying history by listening to a file in his car
on the way to a sales call with the customer. Another example includes
language conversion software that already exists that could enable a
person in a distant county to listen and learn about technology that is
being developed somewhere else.

### Requirements:

The technology would require three areas to come together to make the
process work. 1. The XML technology must include a set of agreed upon
XML tags for transferring files between content generators/distrubutors
and users. 2. The mobile communications services must be able to deliver
the data in a usable format to an end user system. 3. Hardware and
software must be able to make use of the documents sent and play them
for a user. Included in this is the further development of a voice
processing browser.

The second and third requirements are outside the scope of this chapter
on XML. However, work is being done on them. The W3C (World Wide Web
Consortium) is currently working on the Mobile Web Initiative which
would set some standards for software vendors, content providers,
hardware (handset) manufacturers, browser developers and mobile service
operators. One suggestion being considered is a maximum page weight of
10K (a typical magazine article fits within that range). The
availability of advertising being embedded and what form it would take
is under debate. Delivery protocol is expected to be http. The
connection for a mobile device can be slow but the audio files do not
have to stream. Current vendors involved include Nokia, Ericsson, HP,
France Telecom and Opera.

The first requirement would include a set of XML tags that all text file
content generators (such as news services, governments, educational
institutions and official records generators) could use to generate
files of their content. Thus their content could be accessed and stored
in a searchable database and requested for downloading and playback at
any time from anywhere that supports a mobile browser device.\
\
![](webRadioDiagram.png "webRadioDiagram.png")

\
\

### The Existing Tag Set:

There is an existing set of XML tags called SSML (Synthesized Speech
Markup Language). This set enables control of enough aspects of speech
generation that a personable voice can be generated and manipulated by a
user. A Text-to-Speech system uses the tags to take a text file and
generate audible text in a voice.

**Document Structure, Text Processing and Pronunciation Elements and
Attributes:**

*speak - Root Element*

`   `*`xml:lang - Attribute`*` `\
`                Language (indicates the natural language of the file, such as “en-US”); this `\
`                is preferred to be indicated only on the voice element so as to eliminate `\
`                changes in a voice in the midst of a voice file.`\
`   `*`xml:base - Attribute`*` `\
`                base URI Attribute (optional)`

**EXAMPLE:**

`<speak version="1.0"
         xmlns="http://www.w3.org/2001/10/synthesis"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
                   http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
         xml:lang="en-US">`{=html}

` ... the body ...`

`</speak>`{=html}

*lexicon - Element*

`       for pronunciation, (an empty element)`

*meta - Element*

`       (an empty element); includes a string that contains some information about the  `\
`       ensuing data; it can declare a content type of “http” in the case of a file that `\
`       doesn’t have generated header fields from the originating server.`

*metadata - Element*

`       can provide broader information about data as it accesses a metadata schema.`

*p - Element*

`       text structure, represents a paragraph. It can only contain the following elements:   `\
`       audio, break, emphasis, mark, phoneme, prosody, say-as, sub, s, voice.`

*s - Element*

`       text structure, Element; represents a sentence. It can only contain the following   `\
`       elements: audio, break, emphasis, mark, phoneme, prosody, say-as, sub, voice.`

*say-as - Element*

`       available attributes: interpret-as, format, and detail phoneme with interpret-as being `\
`       the only required one. The tag set may only contain text to be rendered by a voice    `\
`       synthesizer. This tag helps a browser to know more about the manner in which the  `\
`       enclosed text is to be voiced.`\
`   `*`format - Attribute`*` `\
`               this attribute gives additional hints as to the rendering of voiced text.   `*`detail - Attribute`*\
`               this attribute is for indicating the level of detail to be applied to voiced  `\
`               text. An example would be a special form of emphasis such as the reading of `\
`               computer code in a block of text.`

*Phoneme - Element*

`       a pronunciation indicator for the text to speech engine. The engine does not render `\
`       the contents of the tag, thus the tag can be empty. The attributes for the tag provide `\
`       what the engine will use to help with language specific pronunciation factors.     `\
`       However, any text between the tag set will be rendered on screen in  a visual browser  `\
`       for hearing impaired users. This tag can only contain text, no elements.`\
`       `*`alphabet - attribute`*` `\
`               for Phoneme, used to specify a particular version of an alphabet, optional`\
`       `*`ph - Attribute`*\
`               a required attribute for phoneme, used to specify the string to be pronounced.`

*EXAMPLE:*

`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
                   http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
         xml:lang="en-US">`{=html}

` ``<phoneme alphabet="ipa" ph="təmei̥ɾou̥">`{=html}` pomegranate ``</phoneme>`{=html}\
` `\
`  `

`</speak>`{=html}

*sub - Element*

`       an element used to specify within its “alias” attribute the pronounced version of some `\
`       written text that is between the tag set. Example:`\
`   AARP```{=html}` `

Prosody and Style - prosody covers such things as tone, intonation,
conversational pacing, pitch of voice, loudness, duration of sound,
chunking (units of words, not necessarily sentences).

*voice - Element*

`       indicates the type of voice to use, all the attributes are optional, however, not `\
`       indicating any attributes at all is considered an error. The “lang” attribute takes  `\
`       precedence; all other attributes are equal.`\
`   `*`lang - attribute`*` `\
`                for voice element, indicates the language for the voice.`\
`   `*`gender - Attribute`*\
`   `*`age - Attributte`*`''`\
`   `*`variant - Attributte`*\
`   `*`name - Attribute`*

*EXAMPLE:*

`<voice gender="male">`{=html}Show me a person without a
goal`</voice>`{=html}

` ``<voice gender="male" variant="2">`{=html}\
` and I'll show you a stock clerk.`\
` ``</voice>`{=html}\
` `\
` ``<voice name="James">`{=html}`Show me a stock clerk with a goal and I'll show you someone who will change the world.``</voice>`{=html}

*emphasis - Element*

`       contains text to be emphasized by the speech processor (with stress or intensity). It  `\
`       has one attribute:`\
`   `*`level - Attribute`*\
`                indicating the degree of emphasis.`

*EXAMPLE:*

Geniuses themselves don\'t talk about the gift of genius, they just talk
about

`<emphasis level="strong">`{=html}` hard work and long hours. ``</emphasis>`{=html}

The \"emphasis\" element can contain text and the following elements:

`   `*`audio - Element`*\
`   `*`desc - Element`*\
`                if the content is not speech then the “desc” tag should be used to describe   `\
`                the content. This description can be used in a text output for the hearing   `\
`                impaired.`\
`   `*`break - Element`*\
`   `*`emphasis - Element`*` `\
`   `*`mark - Element`*\
`   `*`phoneme - Element`*\
`   `*`prosody - Element`*\
`   `*`say-as - Element`*\
`   `*`sub - Element`*\
`   `*`voice - Element`*

*break - Element*

`       wherever the element is used between words it indicates a pause in the reading of the  `\
`       text; attributes are: “strength” with values of: none (meaning no pause even if the `\
`       system would normally put one there), x-weak, weak, medium, strong, x-strong; “time” `\
`       with values of either milliseconds: 250ms or seconds: 2s. `

*prosody - Element*

`       controls the pitch, speaking rate and volume of a generated voice. Attributes   `\
`       are optional but it is considered an error if no attributes are set. `\
`       pitch - Attribute`\
`       contour - Attribute`\
`       range - Attribute`\
`       rate - Attribute`\
`       duration - Attribute`\
`       volume - Attribute`

Other elements that allow the insertion of audio files in addition to
generated voice content.

*audio - Element*

`       may be empty but if it contains anything it should be the text that the speech `\
`       generator could convert to a voice in place of the audio file. `

*EXAMPLE:*

```{=html}
<audio src="JCPennyQuote.au">
```
Every business is built on friendship.

```{=html}
</audio>
```
*mark - Element*

`       an empty tag that places a named marker into the content. When the processor  `\
`       reaches a “mark” element one of two things happens. One, the processor is provided `\
`       with the info to retrieve the desired position in the content, two, an event is issued `\
`       that includes the content at the desired position. It has one attribute which is:`\
`       `*`name - Attribute`*\
`                `

*desc - Element*

### Potential Future of XML Web Audio:

Additional tags could be introduced to contain dates, titles of files,
authors, originating language and other metadata about the files.
Expanding the set of existing tags would enable the files to be stored
and searched in databases using multiple methods. They would enable
storing of data related to the actual text/audio files that would be
valuable to potential users. A user could search based on originating
date of the file, the originating country of the file and subject or
title of files.

### Conclusion

Using SSML, a subset of XML, audio files can be generated from any text
file such as news reports, government documents, educational materials
or official records. This content could be delivered via mobile
communication services and over the web. The files could be played on
mobile browser devices. This could constitute a much larger market for
internet radio than the strictly music or programmed content form it
exists in today. This could generate many uses for on-demand access to
many sources of information for travelling users.


# XML - Managing Data Exchange/OpenOffice.org & OpenDocument Format

+------------------------------------------------------------+
| **Learning objectives**                                    |
|                                                            |
| -   Learn how OpenOffice.org uses OpenDocument Format      |
| -   Learn about the zip archive                            |
| -   Learn about OpenOffice capabilites and how to download |
| -   Learn about the future of OpenDocument Format          |
+------------------------------------------------------------+
|                                                            |
+------------------------------------------------------------+

## Introduction

OpenOffice.org is exactly what its title suggests: an open source office
applications suite. It is based on the source of Sun Microsystems\'
StarOffice, which was donated to the open source community in 2000.
OpenOffice.org will read and save files in several formats used by other
office applications, but its default format is OpenDocument, which is an
XML format standardized by OASIS (Organization for the Advancement of
Structured Information Standards). Because of these two factors, an open
source editor and XML-based files, OpenOffice.org is poised to be of
great importance in the very near future as the trend continues for
national governments, particularly in the European Union, to require
that all electronic government documents be saved in an open source
format.

## OpenDocument Format

As stated in the introduction, OpenDocument is an XML format
standardized by OASIS. An OpenDocument file takes the form of a
compressed zip archive with one of the following extensions:

-   .odt (text)
-   .ott (text template)
-   .odm (master document)
-   .oth (HTML template)
-   .ods (spreadsheet)
-   .ots (spreadsheet template)
-   .odg (drawing)
-   .otg (drawing template)
-   .odp (presentation)
-   .otp (presentation template)
-   .odf (formula)
-   .odb (database)

(Note that all of these extensions are version 2.0 only)

The zip archive contains the following files and directories (from
OpenOffice.org Help documentation):

-   The actual text of the document is stored in
    `<b>`{=html}content.xml`</b>`{=html}. By default this is a
    stripped-down version of the document that leaves out formatting
    elements such as indentation or line breaks in order to streamline
    saving and opening the document.

**content.xml Example**

+-------------------------------------------------+
| ``` xml                                         |
| <office:document-content namespace declarations |
|   office:version="1.0"                          |
|   office:class="document type">                 |
|                                                 |
|     <office:scripts/>                           |
|                                                 |
|     <office:font-face-decls>                    |
|         <!-- font specifications -->            |
|     </office:font-decls>                        |
|                                                 |
|     <office:styles>                             |
|         <office:automatic-styles>               |
|             <!-- style information -->          |
|         </office:automatic-styles>              |
|     </office:styles>                            |
|                                                 |
|     <office:body>                               |
|         <office:documentType>                   |
|             <!-- actual content here -->        |
|         </office:documentType>                  |
|     </office:body>                              |
| </office:document-content>                      |
| ```                                             |
+-------------------------------------------------+
|                                                 |
+-------------------------------------------------+

-   **meta.xml** contains the meta information of the document, which
    can be edited in File -- Properties. If a document is saved with a
    password, meta.xml will not be encrypted.

**meta.xml Example**

+----------------------------------------------------------------------+
| ``` xml                                                              |
|  <?xml version="1.0" encoding="UTF-8" ?>                             |
| <office:document-meta xmlns:                                         |
| office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlin |
| k="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elemen |
| ts/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" |
|  xmlns:ooo="http://openoffice.org/2004/office" office:version="1.0"> |
| <office:meta>                                                        |
|   <meta:generator>OpenOffice.org                                     |
| /2.0$Win32 OpenOffice.org_project/680m1$Build-8990</meta:generator>  |
|   <meta:initial-creator>Creator Name</meta:initial-creator>          |
|   <meta:creation-date>2006-03-27T19:17:57</meta:creation-date>       |
|   <dc:creator>Creator Name</dc:creator>                              |
|   <dc:date>2006-03-27T20:58:06</dc:date>                             |
|   <dc:language>en-US</dc:language>                                   |
|   <meta:editing-cycles>2</meta:editing-cycles>                       |
|   <meta:editing-duration>PT1H40M37S</meta:editing-duration>          |
|   <meta:user-defined meta:name="Info 1" />                           |
|   <meta:user-defined meta:name="Info 2" />                           |
|   <meta:user-defined meta:name="Info 3" />                           |
|   <meta:user-defined meta:name="Info 4" />                           |
|   <meta:document-statistic meta:table-count="0" meta:                |
| image-count="0" meta:object-count="0" meta:page-count="2" meta:parag |
| raph-count="6" meta:word-count="567" meta:character-count="3550" />  |
|   </office:meta>                                                     |
|   </office:document-meta>                                            |
| ```                                                                  |
+----------------------------------------------------------------------+
|                                                                      |
+----------------------------------------------------------------------+

-   **settings.xml** contains further information about the settings for
    this document.

**settings.xml Example**

+----------------------------------------------------------------------+
| ``` xml                                                              |
|   <?xml version="1.0" encoding="UTF-8" ?>                            |
| - <office:document-settings xmlns:office="urn:oasis:names:tc:o       |
| pendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xl |
| ink" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" |
|  xmlns:ooo="http://openoffice.org/2004/office" office:version="1.0"> |
| - <office:settings>                                                  |
| - <config:config-item-set config:name="ooo:view-settings">           |
|   <config:config-item c                                              |
| onfig:name="ViewAreaTop" config:type="int">635</config:config-item>  |
|   <config:config-item                                                |
| config:name="ViewAreaLeft" config:type="int">0</config:config-item>  |
|   <config:config-item confi                                          |
| g:name="ViewAreaWidth" config:type="int">25852</config:config-item>  |
|   <config:config-item config                                         |
| :name="ViewAreaHeight" config:type="int">14818</config:config-item>  |
|   <config:config-item config:name="                                  |
| ShowRedlineChanges" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:n                                       |
| ame="InBrowseMode" config:type="boolean">false</config:config-item>  |
| - <config:config-item-map-indexed config:name="Views">               |
| - <config:config-item-map-entry>                                     |
|   <config:config-item c                                              |
| onfig:name="ViewId" config:type="string">view2</config:config-item>  |
|   <config:config-item                                                |
| config:name="ViewLeft" config:type="int">17549</config:config-item>  |
|   <config:config-ite                                                 |
| m config:name="ViewTop" config:type="int">4949</config:config-item>  |
|   <config:config-item                                                |
|  config:name="VisibleLeft" config:type="int">0</config:config-item>  |
|   <config:config-item                                                |
| config:name="VisibleTop" config:type="int">635</config:config-item>  |
|   <config:config-item conf                                           |
| ig:name="VisibleRight" config:type="int">25850</config:config-item>  |
|   <config:config-item confi                                          |
| g:name="VisibleBottom" config:type="int">15452</config:config-item>  |
|   <config:config-ite                                                 |
| m config:name="ZoomType" config:type="short">0</config:config-item>  |
|   <config:config-item co                                             |
| nfig:name="ZoomFactor" config:type="short">100</config:config-item>  |
|   <config:config-item config:name                                    |
| ="IsSelectedFrame" config:type="boolean">false</config:config-item>  |
|   </config:config-item-map-entry>                                    |
|   </config:config-item-map-indexed>                                  |
|   </config:config-item-set>                                          |
| - <config:config-item-set config:name="ooo:configuration-settings">  |
|   <config:config-item config:name="A                                 |
| ddParaTableSpacing" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:na                                      |
| me="PrintReversed" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="OutlineLev                        |
| elYieldsNumbering" config:type="boolean">false</config:config-item>  |
|   <config:config-item conf                                           |
| ig:name="LinkUpdateMode" config:type="short">1</config:config-item>  |
|   <config:config-item config:name="IgnoreFirstLine                   |
| IndentInNumbering" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="C                                 |
| haracterCompressionType" config:type="short">0</config:config-item>  |
|   <config:config-item config:name                                    |
| ="PrintSingleJobs" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="U                                 |
| pdateFromTemplate" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="Pr                                |
| intPaperFromSetup" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name                                    |
| ="AddFrameOffsets" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:na                                      |
| me="PrintLeftPages" config:type="boolean">true</config:config-item>  |
|   <config:config-it                                                  |
| em config:name="RedlineProtectionKey" config:type="base64Binary" />  |
|   <config:config-item config                                         |
| :name="PrintTables" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:nam                                     |
| e="ChartAutoUpdate" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:n                                       |
| ame="PrintControls" config:type="boolean">true</config:config-item>  |
|   <config:c                                                          |
| onfig-item config:name="PrinterSetup" config:type="base64Binary" />  |
|   <config:config-item config:na                                      |
| me="PrintAnnotationMode" config:type="short">0</config:config-item>  |
|   <config:config-item config:n                                       |
| ame="LoadReadonly" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="AddParaS                          |
| pacingToTableCells" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:name="                                  |
| AddExternalLeading" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:n                                       |
| ame="ApplyUserData" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:nam                                     |
| e="FieldAutoUpdate" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:name="S                                 |
| aveVersionOnClose" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="SaveGl                            |
| obalDocumentLinks" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="IsKer                             |
| nAsianPunctuation" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="Al                                |
| ignTabStopPosition" config:type="boolean">true</config:config-item>  |
|   <config:config-i                                                   |
| tem config:name="CurrentDatabaseDataSource" config:type="string" />  |
|   <c                                                                 |
| onfig:config-item config:name="PrinterName" config:type="string" />  |
|   <co                                                                |
| nfig:config-item config:name="PrintFaxName" config:type="string" />  |
|   <config:config-item config:name="Conside                           |
| rTextWrapOnObjPos" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:nam                                     |
| e="PrintRightPages" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:name                                    |
| ="IsLabelDocument" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="Use                               |
| FormerLineSpacing" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="AddParaT                          |
| ableSpacingAtStart" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:name="UseF                              |
| ormerTextWrapping" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="DoNotResetPa                      |
| raAttrsForNumFont" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:na                                      |
| me="PrintProspect" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:n                                       |
| ame="PrintGraphics" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:name="A                                 |
| llowPrintJobCancel" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:name="C                                 |
| urrentDatabaseCommandType" config:type="int">0</config:config-item>  |
|   <config:config-item config:name="DoNotJustifyLin                   |
| esWithManualBreak" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="UseFormer                         |
| ObjectPositioning" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="PrinterIndepende                  |
| ntLayout" config:type="string">high-resolution</config:config-item>  |
|   <config:config-item config:name                                    |
| ="UseOldNumbering" config:type="boolean">false</config:config-item>  |
|   <config:config-item config:name="P                                 |
| rintPageBackground" config:type="boolean">true</config:config-item>  |
|   <config:confi                                                      |
| g-item config:name="CurrentDatabaseCommand" config:type="string" />  |
|   <config:config-item config:n                                       |
| ame="PrintDrawings" config:type="boolean">true</config:config-item>  |
|   <config:config-item config:name                                    |
| ="PrintBlackFonts" config:type="boolean">false</config:config-item>  |
|   </config:config-item-set>                                          |
|   </office:settings>                                                 |
|   </office:document-settings>                                        |
| ```                                                                  |
+----------------------------------------------------------------------+
|                                                                      |
+----------------------------------------------------------------------+

-   **styles.xml** contains the styles applied to the document that can
    be seen in the Styles and Formatting window.

**styles.xml Example**

+----------------------------------------------------------------------+
| ``` xml                                                              |
|                                                                      |
| <?xml version="1.0" encoding="UTF-8" ?>                              |
|  <office:document-styles xmlns:of                                    |
| fice="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style= |
| "urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oa |
| sis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:nam |
| es:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:o |
| pendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocu |
| ment:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/199 |
| 9/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn |
| :oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis |
| :names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:nam |
| es:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis: |
| names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:t |
| c:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Ma |
| th/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1. |
| 0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" x |
| mlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://open |
| office.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" |
|  xmlns:dom="http://www.w3.org/2001/xml-events" office:version="1.0"> |
| - <office:font-face-decls>                                           |
|   <style:font-face style:name="Tahoma1" svg:font-family="Tahoma" />  |
|   <style:font-face style:name="Arial Unicode MS"                     |
| svg:font-family="'Arial Unicode MS'" style:font-pitch="variable" />  |
|   <style:font-face style:na                                          |
| me="Tahoma" svg:font-family="Tahoma" style:font-pitch="variable" />  |
|   <style:font                                                        |
| -face style:name="Times New Roman" svg:font-family="'Times New Roman |
| '" style:font-family-generic="roman" style:font-pitch="variable" />  |
|   <style:font-face style:name="Arial" svg:font-family="Aria          |
| l" style:font-family-generic="swiss" style:font-pitch="variable" />  |
|   </office:font-face-decls>                                          |
| - <office:styles>                                                    |
| - <style:default-style style:family="graphic">                       |
|   <style:graphic-properties                                          |
| draw:shadow-offset-x="0.1181in" draw:shadow-offset-y="0.1181in" draw |
| :start-line-spacing-horizontal="0.1114in" draw:start-line-spacing-ve |
| rtical="0.1114in" draw:end-line-spacing-horizontal="0.1114in" draw:e |
| nd-line-spacing-vertical="0.1114in" style:flow-with-text="false" />  |
| - <style:paragraph-properties                                        |
| style:text-autospace="ideograph-alpha" style:line-break="strict" sty |
| le:writing-mode="lr-tb" style:font-independent-line-spacing="false"> |
|   <style:tab-stops />                                                |
|   </style:paragraph-properties>                                      |
|   <style:text-prop                                                   |
| erties style:use-window-font-color="true" fo:font-size="12pt" fo:lan |
| guage="en" fo:country="US" style:font-size-asian="12pt" style:langua |
| ge-asian="none" style:country-asian="none" style:font-size-complex=" |
| 12pt" style:language-complex="none" style:country-complex="none" />  |
|   </style:default-style>                                             |
| - <style:default-style style:family="paragraph">                     |
|   <style:paragraph-properti                                          |
| es fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideo |
| graph-alpha" style:punctuation-wrap="hanging" style:line-break="stri |
| ct" style:tab-stop-distance="0.4925in" style:writing-mode="page" />  |
|   <style:text-p                                                      |
| roperties style:use-window-font-color="true" style:font-name="Times  |
| New Roman" fo:font-size="12pt" fo:language="en" fo:country="US" styl |
| e:font-name-asian="Arial Unicode MS" style:font-size-asian="12pt" st |
| yle:language-asian="none" style:country-asian="none" style:font-name |
| -complex="Tahoma" style:font-size-complex="12pt" style:language-comp |
| lex="none" style:country-complex="none" fo:hyphenate="false" fo:hyph |
| enation-remain-char-count="2" fo:hyphenation-push-char-count="2" />  |
|   </style:default-style>                                             |
| - <style:default-style style:family="table">                         |
|   <style:table-properties table:border-model="collapsing" />         |
|   </style:default-style>                                             |
| - <style:default-style style:family="table-row">                     |
|   <style:table-row-properties fo:keep-together="auto" />             |
|   </style:default-style>                                             |
|   <style:style s                                                     |
| tyle:name="Standard" style:family="paragraph" style:class="text" />  |
| - <style:style                                                       |
| style:name="Text_20_body" style:display-name="Text body" style:famil |
| y="paragraph" style:parent-style-name="Standard" style:class="text"> |
|   <style:para                                                        |
| graph-properties fo:margin-top="0in" fo:margin-bottom="0.0835in" />  |
|   </style:style>                                                     |
| - <style:style s                                                     |
| tyle:name="Heading" style:family="paragraph" style:parent-style-name |
| ="Standard" style:next-style-name="Text_20_body" style:class="text"> |
|   <style:paragraph-properties fo:margin-top="                        |
| 0.1665in" fo:margin-bottom="0.0835in" fo:keep-with-next="always" />  |
|                                                                      |
| <style:text-properties style:font-name="Arial" fo:font-size="14pt" s |
| tyle:font-name-asian="Arial Unicode MS" style:font-size-asian="14pt" |
|  style:font-name-complex="Tahoma" style:font-size-complex="14pt" />  |
|   </style:style>                                                     |
| - <style:style style:name="List" style:family="p                     |
| aragraph" style:parent-style-name="Text_20_body" style:class="list"> |
|   <style:text-properties style:font-name-complex="Tahoma1" />        |
|   </style:style>                                                     |
| - <style:style style:name="Caption" style:family                     |
| ="paragraph" style:parent-style-name="Standard" style:class="extra"> |
|   <style:paragraph-properties fo:margin-top="0.0835in" fo:margin-    |
| bottom="0.0835in" text:number-lines="false" text:line-number="0" />  |
|   <style:text-properties fo                                          |
| :font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt |
| " style:font-style-asian="italic" style:font-name-complex="Tahoma1"  |
| style:font-size-complex="12pt" style:font-style-complex="italic" />  |
|   </style:style>                                                     |
| - <style:style style:name="Index" style:family                       |
| ="paragraph" style:parent-style-name="Standard" style:class="index"> |
|   <style:par                                                         |
| agraph-properties text:number-lines="false" text:line-number="0" />  |
|   <style:text-properties style:font-name-complex="Tahoma1" />        |
|   </style:style>                                                     |
| - <text:outline-style>                                               |
| - <text:outline-level-style text:level="1" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="2" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="3" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="4" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="5" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="6" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="7" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="8" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="9" style:num-format="">      |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
| - <text:outline-level-style text:level="10" style:num-format="">     |
|   <style:list-level-properties text:min-label-distance="0.15in" />   |
|   </text:outline-level-style>                                        |
|   </text:outline-style>                                              |
|   <text:notes-configuration te                                       |
| xt:note-class="footnote" style:num-format="1" text:start-value="0" t |
| ext:footnotes-position="page" text:start-numbering-at="document" />  |
|   <text:notes-configuration tex                                      |
| t:note-class="endnote" style:num-format="i" text:start-value="0" />  |
|   <text:linenumberin                                                 |
| g-configuration text:number-lines="false" text:offset="0.1965in" sty |
| le:num-format="1" text:number-position="left" text:increment="5" />  |
|   </office:styles>                                                   |
| - <office:automatic-styles>                                          |
| - <style:page-layout style:name="pm1">                               |
| - <style:page-layout-prop                                            |
| erties fo:page-width="8.5in" fo:page-height="11in" style:num-format= |
| "1" style:print-orientation="portrait" fo:margin-top="0.7874in" fo:m |
| argin-bottom="0.7874in" fo:margin-left="0.7874in" fo:margin-right="0 |
| .7874in" style:writing-mode="lr-tb" style:footnote-max-height="0in"> |
|   <style:footnote-sep style:width="0.0071in" style:di                |
| stance-before-sep="0.0398in" style:distance-after-sep="0.0398in" sty |
| le:adjustment="left" style:rel-width="25%" style:color="#000000" />  |
|   </style:page-layout-properties>                                    |
|   <style:header-style />                                             |
|   <style:footer-style />                                             |
|   </style:page-layout>                                               |
|   </office:automatic-styles>                                         |
| - <office:master-styles>                                             |
|   <styl                                                              |
| e:master-page style:name="Standard" style:page-layout-name="pm1" />  |
|   </office:master-styles>                                            |
|   </office:document-styles>                                          |
| ```                                                                  |
+----------------------------------------------------------------------+
|                                                                      |
+----------------------------------------------------------------------+

-   **manifest.xml** in the meta-inf directory describes the structure
    of the XML file.

**manifest.xml Example**

+--------------------------------------------------------------------------+
| ``` xml                                                                  |
| <?xml version="1.0" encoding="UTF-8"?>                                   |
| <!DOCTYPE manifest:manifest                                              |
|     PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">     |
| <manifest:manifest                                                       |
|     xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"> |
|  <manifest:file-entry                                                    |
|     manifest:media-type="application/vnd.oasis.opendocument.text"        |
|     manifest:full-path="/"/>                                             |
|  <manifest:file-entry                                                    |
|     manifest:media-type="application/vnd.sun.xml.ui.configuration"       |
|     manifest:full-path="Configurations2/"/>                              |
|  <manifest:file-entry                                                    |
|     manifest:media-type="" manifest:full-path="Pictures/"/>              |
|  <manifest:file-entry                                                    |
|     manifest:media-type="text/xml" manifest:full-path="content.xml"/>    |
|  <manifest:file-entry                                                    |
|     manifest:media-type="text/xml" manifest:full-path="styles.xml"/>     |
|  <manifest:file-entry                                                    |
|     manifest:media-type="text/xml" manifest:full-path="meta.xml"/>       |
|  <manifest:file-entry                                                    |
|     manifest:media-type=""                                               |
|     manifest:full-path="Thumbnails/thumbnail.png"/>                      |
|  <manifest:file-entry                                                    |
|     manifest:media-type="" manifest:full-path="Thumbnails/"/>            |
|  <manifest:file-entry                                                    |
|     manifest:media-type="text/xml" manifest:full-path="settings.xml"/>   |
| </manifest:manifest>                                                     |
| ```                                                                      |
+--------------------------------------------------------------------------+
|                                                                          |
+--------------------------------------------------------------------------+

-   Other files and folders may be included in the archive if necessary.

The schema for the OpenDocument formats may be found at
<http://www.oasis-open.org/committees/download.php/12572/OpenDocument-v1.0-os.pdf>
(caution: 706 pages).

## Open Office Capabilites

OpenOffice contains WRITER which is OpenOffice.org's word processor.
CALC is a powerful spreadsheet that has all the tools needed to
calculate, analyze, summarize, and present data. IMPRESS is a fast and
powerful way to create effective multimedia presentations. DRAW will
produce everything from simple diagrams to dynamic 3D illustrations and
special effects. New to Version 2, BASE enables you to manipulate
database data seamlessly within OpenOffice.org. It allows the creation
and modification of tables, forms, queries, and reports.

Download at <http://download.openoffice.org/>

## The Future of OpenDocument

Government and business leaders alike are beginning to realize the
importance of open source document formats and to act upon this
realization. In July 2005, Norway\'s Minister of Modernization, Morton
A. Meyer, presented a plan for information technology in Norway called
"eNorge---the digital leap," in which open standards and open source are
addressed. Meyer\'s objectives for open standards and open source are as
follows:

-   Within 2009 all new ICT- and information systems in the public
    sector shall use open standards.
-   Within 2006 a set of management/administrative standards for data
    and document exchange should be established.
-   Within 2006 all operations in the public sector should have
    introduced plans for how they will use open standards, service
    oriented architecture and open source.
-   Within 2008 all data and document exchange in the public sector
    shall satisfy the management/administrative standards.
-   Within 2008 all public forms shall be built on a common interface.

Also, Meyer said "Proprietary formats will no longer be acceptable in
communication between citizens and government."

In the US, IBM\'s Vice President of Standards and Open Source, Bob
Sutor, made the following recommendations to users in his blog as part
of an "Open Document Commitment to Action":

-   Insist today that the provider of your office applications (word
    processor, spreadsheet, presentation software) is committed to
    support the OASIS OpenDocument Format for Office Applications
    standard in their products by January 1, 2007.
-   Insist today that the office applications you deploy allow users to
    easily set the OASIS OpenDocument standard as the default \"save\"
    format for your documents. That is, you should not have to go to a
    lot of trouble to avoid using proprietary formats.
-   Get a commitment from your office applications provider to join and
    contribute to the OASIS OpenDocument standard technical committee.
-   Ask your CIO when you will be able to use office applications that
    support the OASIS OpenDocument standard.
-   Ask your local and federal governments when they will be supporting
    the OASIS OpenDocument standard.
-   Insist that any XML document format you use is not encumbered by
    proprietary extensions, and that the format is freely available for
    anyone to implement without restrictions, including open source
    communities that use a GPL license. Ensure that if implementers must
    accept a license covering the format, the license is clear and
    unambiguous on these important issues.
-   **\"They are your documents: you should be able to do whatever you
    want with them, whenever you want, with whatever application you
    wish to use\"**

The implications are clear. The computing world is moving toward open
source software and file types for information exchange, especially in
business and government, and OpenOffice.org, with its XML-based format,
stands to be at the front of the pack.

## Additional Links

<http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office>

<http://www.sun.com/software/star/staroffice/index.jsp>

<http://www.koffice.org/>

## Works Cited

"Norwegian Minister says that all public sectors need to make a plan for
the use of Open Source by 2005." Europa---IDABC. July 6, 2005.
<http://ec.europa.eu/idabc/en/document/4403/469>.

Bob Sutor. "Open standards, open source, open minds, open
opportunities." IBM developerWorks. October 11, 2005.
<http://www-128.ibm.com/developerworks/blogs/dw_blog_comments.jspa?blog=384&entry=97126>.

"XML File Formats." Help documentation, Sun Microsystems, Inc.,
OpenOffice.org version 2.0, 2000-2005.


# XML - Managing Data Exchange/Google earth

## KML Introduction

(most content here is directly quoted from the KML wikipedia
article)

**KML** (**K**eyhole **M**arkup **L**anguage) is an XML-based Markup
language for managing the display of three-dimensional geospatial data
in the programs Google Earth, Google Maps, Google Mobile, ArcGIS
Explorer and World Wind. (The word *Keyhole* is an earlier name for the
software that became Google Earth; the software was produced in turn by
Keyhole, Inc, which was acquired by Google in 2004. The term \"Keyhole\"
actually honors the KH-11\|KH reconnaissance satellites, the original
eye-in-the-sky military reconnaissance system now some 30 years old.)

The KML file specifies a set of features (placemarks, images, polygons,
3D models, textual descriptions, etc.) for display in Google Earth, Maps
and Mobile. Each place always has a longitude and a latitude. Other data
can make the view more specific, such as tilt, heading, altitude, which
together define a \"camera view\". KML shares some of the same
structural grammar as Geography Markup
Language\|GML1. Some KML information
cannot be viewed in Google Maps or Mobile
2.

KML files are very often distributed as **KMZ** files, which are Data
compression\|zipped KML files with a .kmz extension. When a KMZ file is
unzipped, a single \"doc.kml\" is found along with any overlay and icon
images referenced in the KML.

Example KML document:

``\
` <?xml version="1.0" encoding="UTF-8"?>`\
` <kml xmlns="http://earth.google.com/kml/2.0">`\
` <Placemark>`\
`   <description>New York City</description>`\
`   <name>New York City</name>`\
`   <Point>`\
`     <coordinates>-74.006393,40.714172,0</coordinates>`\
`   </Point>`\
` </Placemark>`\
` </kml>`

The MIME type associated to KML is
*application/vnd.google-earth.kml+xml*.\
The MIME type associated to KMZ is *application/vnd.google-earth.kmz* .

## Basic KML Document Types

For an XML document to recognize KML specific tags you must declare the
KML namespace (listed below).

`<kml xmlns="http://earth.google.com/kml/2.0">`{=html}

You will see this declaration in all the example files listed.

In order to see use the examples provided in this chapter you will need
to copy and paste the text into any text editor. Next you will save the
file as a .kml. This can be done by choosing \"save as\" and naming the
file with a .kml extension (You might have to surround the name in
quotes ie \"test.kml\").

### Placemarks

Placemarks simply make a clickable pinpoint inside Google Earth at an
exact location based on coordinates. This can be useful for marking a
point of interest or a beginning and ending destination to a trip.

The example KML document in the introduction uses the Placemark tag. If
you want to move the placemark to a different location all you would
change are the coordinates.

### Paths

Paths are a series of connected coordinates that can be edited with line
styles for a more bold appearance inside Google Earth. The height and
color can be adjusted for a more exaggerated appearance and better
clarity.

The following example is a path from Atlanta, Georgia to Nashville,
Tennessee. The code may look a bit complicated but it is mostly just
styling/formatting tags with the 4 actual coordinates at near the end.
So if you wanted to use the same style wall but just make a different
path, all you would do is change the coordinates.

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://earth.google.com/kml/2.1">

      <Document>
        <name>Paths</name>
        <description>Path from Atlanta to Nashville</description>

        <Style id="yellowLineGreenPoly">
          <LineStyle>
            <color>7f00ffff</color>
            <width>4</width>
          </LineStyle>
          <PolyStyle>
            <color>7f00ff00</color>
          </PolyStyle>
        </Style>

        <Placemark>
          <name>Atlanta to Nashville</name>
          <description>Wall structured path</description>
          <styleUrl>#yellowLineGreenPoly</styleUrl>
          <LineString>
            <extrude>1</extrude>
            <tessellate>1</tessellate>
            <altitudeMode>absolute</altitudeMode>
            <coordinates>
            -84.40204442007513,33.75488573910702,83269
            -84.37837132006098,33.82567285375923,83269
            -84.79700041857893,35.30711817667424,83269
            -86.79210094043326,36.15389499208452,83269
            </coordinates>
          </LineString>

        </Placemark>
      </Document>
    </kml>

### Overlays

Overlays are graphics that can be placed over an area in Google Earth
marked by coordinates. These graphics can show how an area looked at a
different point in time or during a special event (like a volcanic
eruption).

This overlay example comes from Google\'s KML samples webpage and shows
what Mt. Etna looked like during an actual eruption.

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://earth.google.com/kml/2.1">
      <Folder>
        <name>Ground Overlays</name>
        <description>Examples of ground overlays</description>
        <GroundOverlay>
          <name>Large-scale overlay on terrain</name>
          <description>Overlay shows Mount Etna erupting
              on July 13th, 2001.</description>
          <Icon>
            <href>http://code.google.com/apis/kml/documentation/etna.jpg</href>
          </Icon>
          <LatLonBox>
            <north>37.91904192681665</north>
            <south>37.46543388598137</south>
            <east>15.35832653742206</east>
            <west>14.60128369746704</west>
            <rotation>-0.1556640799496235</rotation>
          </LatLonBox>
        </GroundOverlay>
      </Folder>
    </kml>

You can see from the code that it takes the image etna.jpg and places it
over the coordinates listed.

### Polygons

Polygons are a neat feature of Google Earth that allow 3-D shapes to be
molded anywhere in Google Earth. These shapes can be useful for making
neat presentations or just showing the world a structure actually looks.

This example is a polygon of Turner Field (The Atlanta Braves\' home
stadium) in Georgia. There is no styling on the polygon to keep the code
simple.

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://earth.google.com/kml/2.1">

      <Placemark>
        <name>Turner Field</name>
        <Polygon>
          <extrude>1</extrude>
          <altitudeMode>relativeToGround</altitudeMode>
          <outerBoundaryIs>
            <LinearRing>
              <coordinates>
                    -84.39024224888713,33.73459764262901,28
            -84.38961532726215,33.73451197628319,28
            -84.38830478530726,33.7350571795205,28
            -84.38811742696677,33.73579651137399,28
            -84.38856034410841,33.73618350237595,28
            -84.38930790023139,33.73647497375488,28
            -84.38997872537549,33.73655338302832,28
            -84.39051294303495,33.73605785090994,28
            -84.39056804786146,33.73528763589146,28
            -84.39024224888713,33.73459764262901,28
         </coordinates>

            </LinearRing>
          </outerBoundaryIs>
        </Polygon>
      </Placemark>
    </kml>

As you can see from the code, the polygon\'s 3-D shape is made up from
the latitude and longitude coordinates with the height being determined
by the 3rd column value inside the coordinates tag (28 in this case).

## Google Earth

Google Earth is the name of Google\'s free software that is responsible
for handling these KML documents. It is a virtual world created by a
collage of satellite images where a user can manipulate the Earth in any
way to see its landscapes, oceans, and cities.

You can find more information and download the software
here.

### Basic Interface Navigation

The user interface is fairly straight forward and is extremely easy for
computer illiterate users to just jump right in and start exploring. You
can completely ignore the toolbars and buttons if you want and just
click and grab on the Earth to shake, spin, or roll it as you please. To
zoom in, simply right-click and pull down or up depending on the speed
which you prefer to \"fall\" toward the surface.

If you would like help finding a location you can type in the location
(in the form of City, State) in the \"Fly to..\" search box. Google
Earth will then spin around and zoom in to the location entered. If you
want to take a virtual vacation, Google has some preset locations saved
in the window below \"Fly to\...\" labeled \"Sightseeing.\" Simply click
on one of these locations and be taken to the location where pictures,
articles, and comments can be all be viewed.

### Points of Interest

Points of interest that Google has already marked for users are marked
with different color dots and icons. These can be clicked on for a
variety of information ranging from a simple comment, to a panoramic
photograph of that exact location. Advanced users, interested in the
code make-up of such a feature, can right click on any of Google\'s
marks and choose \"Copy.\" This will copy all the code for that feature
where you can just paste it into a text document to see all of the tags
and references.

## More References

### External links

-   KML Documentation
-   Developer Knowledge Base: KML in Google
    Earth
-   KML Developer Support
    group
-   KMLImporter
    importing placemarks into NASA World
    Wind
-   Use hierarchical maps (Mindmaps) to create
    and manage KML files and convert Excel
    data to KML.
-   Google Earth Connectivity
    Add-on
    for ArchiCAD 9

### Other notes

-   Point of Interest
-   Geography Markup
    Language

### Wikipedia in other languages

-   w:ar:كيه إم إل (Arabian)
-   w:de:Keyhole Markup
    Language (German)
-   w:es:KML (Spanish)
-   w:it:Keyhole Markup
    Language (Italian)
-   w:hu:Keyhole Markup
    Language (Hungarian)
-   w:nl:Keyhole Markup
    Language (Dutch)
-   w:pl:Keyhole Markup
    Language (Polish)
-   w:ru:KML (Russian)

:   /Exercises/