JSP Tag Library for Fast and Easy XML Parsing
Action | Description |
parse |
Parses an XML document using SAX internally. |
element |
Exports variables that hold an element's namespace URI, local
name, qualified name and attributes. |
start |
Can be placed within <p:parse> or <p:element>
in order to handle a startDocument() or startElement() SAX event. |
end |
Can be placed within <p:parse> or <p:element>
in order to handle an endDocument() or endElement() SAX event. |
data |
Can be placed within <p:element> in order to handle
characters() SAX events. |
pi |
Can be placed within <p:parse> or <p:element>
in order to handle processingInstruction() SAX events. |
Parses an XML document using SAX internally. The body may contain
a <p:start> action for processing the startDocument() SAX event,
followed by a <p:element> action for processing the document's
root element, followed by an optional <p:end> action for
processing the endDocument() SAX event.
Syntax: XML content specified via an input source
<p:parse
xml="XML content"
[systemId="string"]
[validate="true|false"]
[ignoreSpaces="true|false"]>
....actions that process the XML content...
</p:parse>
Syntax: XML content specified via a system identifier
<p:parse
systemId="string"
[validate="true|false"]
[ignoreSpaces="true|false"]>
...actions that process the XML content...
</p:parse>
Attribute | Dynamic | Type | Default | Description |
xml | yes |
org.xml.sax.InputSource
java.io.InputStream
java.io.Reader
String
| null |
XML input source that must be parsed.
|
systemId | yes | String | null |
System identifier of the XML input source that must be parsed.
|
validate | yes | boolean | false |
Flag indicating if the parser should validate the XML input
source.
|
ignoreSpaces | yes | boolean | false |
Flag indicating if space character data should be ignored.
|
Exports variables that hold an element's namespace URI, local
name, qualified name and attributes. The body may process a DOM
sub-tree or may contain sub-actions that process the SAX events that
are generated between a startElement() event and an endElement()
event. If the varDom attribute is present, this action exports a
variable holding the root element of a DOM sub-tree and the body
may not contain any actions of this library. If the varDom attribute
isn't present, no DOM variable is exported and the body may contain
a <p:start> action for processing the startElement() SAX event,
followed by one or more <p:element> and <p:data> actions
for processing the sub-elements and the character data, followed
by an optional <p:end> action for processing the endElement()
SAX event.
Syntax: Processing a DOM sub-tree
<p:element
varDom="name"
[scopeDom="page|request|session|application"]
[varName="name"]
[scopeName="page|request|session|application"]
[testName="string"]
[varQname="name"]
[scopeQname="page|request|session|application"]
[testQname="string"]
[varUri="name"]
[scopeUri="page|request|session|application"]
[testUri="string"]
[varAttr="name"]
[scopeAttr="page|request|session|application"]
[scope="page|request|session|application"]
[test="boolean"]>
...scripting code that processes the DOM sub-tree...
</p:element>
Syntax: Processing a sequence of SAX events
<p:element
[varName="name"]
[scopeName="page|request|session|application"]
[testName="string"]
[varQname="name"]
[scopeQname="page|request|session|application"]
[testQname="string"]
[varUri="name"]
[scopeUri="page|request|session|application"]
[testUri="string"]
[varAttr="name"]
[scopeAttr="page|request|session|application"]
[scope="page|request|session|application"]
[test="boolean"]>
...actions that process the SAX events...
</p:element>
Attribute | Dynamic | Type | Default | Description |
varDom | no | String | null |
Name of the dom variable exported by this action.
The presence of this variable indicates that the application
wants a DOM tree for processing rather than a sequence of SAX
events. The root node of the DOM sub-tree will be the value of
the dom variable.
|
scopeDom | no | String | page |
Scope of the dom variable exported by this action.
|
varName | no | String | name |
Name of the name variable exported by this action.
The element's local name will be the value of the name variable.
|
scopeName | no | String | page |
Scope of the name variable exported by this action.
|
testName | yes | String | null |
If this attribute is present and its value is not the same
as the local name of the current parsed element, the body
content of <p:element> will not be evaluated.
|
varQname | no | String | qname |
Name of the qname variable exported by this action.
The element's qualified name will be the value of the qname
variable.
|
scopeQname | no | String | page |
Scope of the qname variable exported by this action.
|
testQname | yes | String | null |
If this attribute is present and its value is not the same as
the qualified name of the current parsed element, the body
content of <p:element> will not be evaluated.
|
varUri | no | String | uri |
Name of the uri variable exported by this action.
The element's namespace URI will be the value of the uri
variable.
|
scopeUri | no | String | page |
Scope of the uri variable exported by this action.
|
testUri | yes | String | null |
If this attribute is present and its value is not the same as
the namespace URI of the current parsed element, the body
content of <p:element> will not be evaluated.
|
varAttr | no | String | attr |
Name of the attr variable exported by this action.
The element's attributes will be the value of the attr variable.
|
scopeAttr | no | String | page |
Scope of the attr variable exported by this action.
|
scope | no | String | page |
Default scope for the variables exported by this action.
|
test | yes | boolean | true |
If this attribute is present and it evaluates to false,
the body of <p:element> will not be evaluated.
|
Can be placed within <p:parse> or <p:element>
in order to handle a startDocument() or startElement() SAX event.
Syntax:
<p:start>
...scripting code that processes the SAX event...
</p:parse>
Can be placed within <p:parse> or <p:element>
in order to handle an endDocument() or endElement() SAX event.
Syntax:
<p:end>
...scripting code that processes the SAX event...
</p:end>
Can be placed within <p:element> in order to handle
characters() SAX events. It exports a variable that holds
the character data.
Syntax:
<p:data
[varData="name"]
[scopeData="page|request|session|application"]
[scope="page|request|session|application"]>
...scripting code that processes the SAX event...
</p:data>
Attribute | Dynamic | Type | Default | Description |
varData | no | String | data |
Name of the data variable exported by this action.
The value of the data variable will be the XML character data.
|
scopeData | no | String | page |
Scope of the data variable exported by this action.
|
scope | no | String | page |
Default scope for the variables exported by this action.
|
Can be placed within <p:parse> or <p:element>
in order to handle processingInstruction() SAX events.
It exports two variables that hold the target and data of
the processing instruction.
Syntax:
<p:pi
[varTarget="name"]
[scopeTarget="page|request|session|application"]
[testTarget="string"]
[varData="name"]
[scopeData="page|request|session|application"]
[scope="page|request|session|application"]
[test="boolean"]>
...scripting code that processes the SAX event...
</p:pi>
Attribute | Dynamic | Type | Default | Description |
varTarget | no | String | target |
Name of the target variable exported by this action.
The processing instruction's target will be the value of the
target variable.
|
scopeTarget | no | String | page |
Scope of the target variable exported by this action.
|
testTarget | yes | String | null |
If this attribute is present and its value is not the same
as the target of the current processing instruction, the body
content of <p:pi> will not be evaluated.
|
varData | no | String | data |
Name of the data variable exported by this action.
The processing instruction's data will be the value of the
data variable.
|
scopeData | no | String | page |
Scope of the data variable exported by this action.
|
scope | no | String | page |
Default scope for the variables exported by this action.
|
test | yes | boolean | true |
If this attribute is present and it evaluates to false,
the body of <p:pi> will not be evaluated.
|
|