xml spy
Previous  Top  Next

Inserting XML Content as Text


Data from a node in the XML document is included in the design by dragging the corresponding schema node from the Schema Tree window and dropping it into the design. When the schema node is dropped into the design, a menu pops up with options for how the node is to be created in the design (screenshot below).

 

MnuCreateAs

 

 

Types of schema nodes

Schema nodes that can be dropped from the Schema Tree sidebar into the design are of three types: (i) element nodes; (ii) attribute nodes; and (iii) datatype nodes.

 

 

Outputting text content of nodes

To output the text contents of the node, the node should be created as contents. When a node is created as contents, the node will look something like this in the design document:

 

SSCreateContents

 

In the screenshot above, the Desc element has been created as contents. The output will display the text content of Desc. If Desc has descendant elements, such as Bold and Italic, then the text content of the descendant elements will also be output as part of the contents of Desc. Note that attribute nodes of Desc are not considered its child nodes, and the contents of the attribute nodes will therefore not be output as part of the contents of Desc. Attribute nodes have to be explicitly inserted in order to be processed.

 

 

CDATA sections

If CDATA sections are present in the XML document they will be output, and in Authentic View, are indicated with tags when markup is switched on (using the menu command Authentic | Markup). CDATA sections can also be inserted in the XML document when editing the document in Authentic View (via the context menu).

 

tag_cdata

 

 

In the sub-sections of this section, we describe other aspects of inserting XML content as text:

 

How the text content of a node can be marked up with a predefined format directly when the node is inserted.
How the structure of the source schema determines the effect of Authentic View usage.
How descendant nodes not explicitly included within a node can be included for processing. See Rest-of-Contents.

 

 

Note:You can create an empty template rule by deleting the (content) placeholder of a node. An empty template rule is useful if you wish to define that some node not be processed, i.e. produce no output.

 

 


See also:

 

 


 

 


Previous  Top  Next

© 2008 Altova