JSP Tag Library for Generating XML Dynamically
Action | Description |
document |
Outputs a DOM tree or just sets the context for generating
an XML document dynamically. |
fragment |
Outputs a DOM fragment/sub-tree. |
element |
Outputs an XML element. |
start |
Outputs an XML start tag. |
end |
Outputs an XML end tag. |
attributes |
Exports a variable holding a SAX list of attributes. |
attribute |
Adds an attribute to a variable exported by
<o:attributes>. |
data |
Outputs XML character data. |
comment |
Outputs an XML comment. |
pi |
Outputs an XML processing instruction. |
Outputs a DOM tree or just sets the context for generating
an XML document dynamically.
Syntax: Serializing a DOM tree
<o:document
dom="DOM node"
[xmldecl="true|false"]
[standalone="true|false"]
[version="1.0"]
[encoding="string"]
[systemId="string"]
[publicId="string"]
[method="xml|html|text"]
[indent="number"]/>
Syntax: Generating a document dynamically
<o:document
[xmldecl="true|false"]
[standalone="true|false"]
[version="1.0"]
[encoding="string"]
[systemId="string"]
[publicId="string"]
[method="xml|html|text"]
[indent="number"]>
...actions that generate XML content...
</o:document>
Attribute | Dynamic | Type | Default | Description |
dom | yes | org.w3c.dom.Node | null |
DOM tree that must be serialized to the JSP output.
|
xmldecl | yes | boolean | true |
Flag indicating if the XML declaration should be included
at the beginning of the produced XML document.
|
standalone | yes | boolean | false |
Flag indicating if the document should be declared standalone.
|
version | yes | String | 1.0 |
XML version.
|
encoding | yes | String | UTF-8 |
XML encoding.
|
publicId | yes | String | null |
Public doctype identifier of the produced XML document.
|
systemId | yes | String | null |
System doctype identifier of the produced XML document.
|
method | yes | String | xml |
Output method: xml, html, text.
|
indent | yes | int | 0 |
Number of spaces used for indenting.
|
Outputs a DOM fragment/sub-tree.
Syntax:
<o:fragment
dom="DOM node"
[method="xml|html|text"]
[indent="number"]/>
Attribute | Dynamic | Type | Default | Description |
dom | yes | org.w3c.dom.Node | null |
DOM sub-tree that must be serialized to the JSP output.
|
method | yes | String | xml |
Output method: xml, html, text.
|
indent | yes | int | 0 |
Number of spaces used for indenting.
|
Outputs an XML element.
Syntax:
<o:element
name="string"
[uri="string"]
[attr="attributes"]
[empty="true|false"]>
...actions that generate the element's content...
<o:/element>
Attribute | Dynamic | Type | Default | Description |
name | yes | String | null |
Name of the element.
|
uri | yes | String | null |
Namespace URI of the element, which will be the value
of an XMLNS attribute.
|
attr | yes | String org.xml.sax.helpers.AttributesImpl | null |
Attributes of the element.
The value of the evaluated expression is expected to be
a SAX AttributesImpl object or a list of names of JSP variables
separated by spaces. In the latter case, the attributes will
have the names and values of the JSP variables.
|
empty | yes | boolean | false |
Flag indicating if the produced element must be empty.
|
Outputs an XML start tag.
Syntax:
<o:start
name="string"
[uri="string"]
[attr="attributes"]/>
Attribute | Dynamic | Type | Default | Description |
name | yes | String | null |
Name of the XML tag.
|
uri | yes | String | null |
Namespace URI of the XML tag, which will be the value
of an XMLNS attribute.
|
attr | yes | String org.xml.sax.helpers.AttributesImpl | null |
Attributes of the XML tag.
The value of the evaluated expression is expected to be
a SAX AttributesImpl object or a list of names of JSP variables
separated by spaces. In the latter case, the attributes will
have the names and values of the JSP variables.
|
Outputs an XML end tag.
Syntax:
<o:end
name="string"/>
Attribute | Dynamic | Type | Default | Description |
name | yes | String | null |
Name of the XML tag.
|
Exports a variable holding a SAX list of attributes.
Syntax:
<o:attributes
var="name"
[scope="page|request|session|application"]
[copy="attributes"]>
...</o:attribute> actions...
</o:attributes>
Attribute | Dynamic | Type | Default | Description |
var | no | String | null |
Name of the variable exported by this action.
The value of the variable will be the SAX object that holds
the attributes.
|
scope | no | String | page |
Scope of the variable exported by this action.
|
copy | yes | org.xml.sax.helpers.AttributesImpl | null |
Initial attribute list, which is empty by default.
The value of the evaluated expression is expected to be
a org.xml.sax.helpers.AttributesImpl object.
The list of attributes exported by this action
will contain copies of all attributes of the given initial list.
|
Adds an attribute to a variable exported by
<o:attributes>.
Syntax: Value specified via an attribute
<o:attribute
name="string"
value="string"/>
Syntax: Value specified via the body content
<o:attribute
name="string">
...value...
</o:attribute>
Attribute | Dynamic | Type | Default | Description |
name | yes | String | null |
Attribute name.
|
value | yes | String | null |
Attribute value.
|
Outputs XML character data.
Syntax: Data specified via an attribute
<o:data
value="string"
[section="boolean"]/>
Syntax: Data specified via the body content
<o:data
[section="boolean]">
...value...
</o:data>
Attribute | Dynamic | Type | Default | Description |
value | yes | String | null |
Character data.
|
section | yes | boolean | false |
Flag indicating if the character data should be produced
as a CDATA section.
|
Outputs an XML comment.
Syntax: Comment specified via an attribute
<o:comment
text="string"/>
Syntax: Comment specified via the body content
<o:comment>
...text...
</o:comment>
Attribute | Dynamic | Type | Default | Description |
text | yes | String | null |
Text of the comment.
|
Outputs an XML processing instruction.
Syntax: Data specified via an attribute
<o:pi
target="string"
data="string"/>
Syntax: Data specified via the body content
<o:pi
target="string">
...data...
</o:pi>
Attribute | Dynamic | Type | Default | Description |
target | yes | String | null |
Target of the processing instruction.
|
data | yes | String | null |
Data of the processing instruction.
|
|