Xml Output

Top Previous Topic Next Topic  Print this topic

The Xml Output element describes the structure of the resulting XML.

 

output-with-attribute-and-seq

 

Initially, the output contains one ns:root element which is the root of the output XML. To add new elements or attributes, the ns:root element must be right clicked and the required fields filled in.

 

Note:

The output is the only element that cannot be removed from a Data Architect diagram.

 

Terminology

In Data Architect terminology, the Xml Output can contain elements, element sequences, elements sub-trees, attributes and text. For example, in the diagram above there are:

 

- one element (ns:root)

- one element sequence (ns:emp)

- two attributes (first-name and last-name)

 

Elements are constructs that will generate only one XML element in the output. The generated XML element can have attributes and text. For example, the following XML is an example of output:

 

 

       <ns:book title="Fahrenheit 451" author="Ray Bradbury">

               The short novel presents a future American society in which reading is outlawed.

       </ns:book>

 

 

In this example, there is one element, "book" with a text content ("The short novel ...") and two attributes: "title" and "author".

 

Element Sequences are constructs that can generate multiple XML elements at runtime; in the example above, the resulting XML will contain one or more employees:

 

 

       <ns:emp first-name="John" last-name="Brown"/>

       <ns:emp first-name="Mary" last-name="Jane"/>

 

 

 

Advanced Note

The "ns" prefix is called a namespace prefix and is used to collect all elements in a namespace, for name resolution purposes.

 

See Also: XML Output in Working with Documents