|
| <option> |
|
Description
-
Option node is a top-level only node (child of ejen) and may only
appear before all other child nodes. It may be used either in order to
specify a namespace or in order to register a new protocol handler.
...
<ejen>
<option name="namespace" value="var=org.ejen.ext.ThreadGlobalVariables"/>
<option value="inv=http://www.ejen.org/ns/2002/invoice"/>
<option name="handler" value="jdbc=org.ejen.protocols.jdbc.Handler"/>
<option name="catalog" value="dtd/catalog.txt"/>
...
</ejen>
... |
The first option instruction declares an extension namespace that
may be used later in XPath expressions like
var:remove('my-variable') (see exec
node).
The second option instruction declares a namespace that may be used
later in expressions like select="doc/inv:client". This is only useful
if the "inv" namespace is not declared in the current XML node or in any ancestor
of the current XML node. Suppose we load this kind of XML source:
<?xml version="1.0" encoding="iso-8859-1"?>
<doc>
<inv:client xmlns:inv="http://www.ejen.org/ns/2002/invoice">
...
</inv:client>
...
</doc> |
If we use directly an expression like select="doc/inv:client" in an
Ejen foreach node, this will fail since the current XML node is "doc"
and this current node does not declare the "inv" namespace: namespace resolution
is always relative to the current node and the "inv" namespace must be declared
either in the current node or in any ancestor of this current node. If you do
not understand the meaning of this feature, you probably do not need it...
The third option instruction declares a handler for a "jdbc" protocol.
First, you must note that this "jdbc" protocol handler is not implemented in
Ejen. If it was implemented, this declaration could be used later in expressions
like uri="jdbc:hsqldb:hsql://localhost:1476?driver=org.hsqldb.jdbcDriver&user=su&pass=&query=SELECT xmldata FROM xmltable WHERE id=1" or
whatever (depending on how you have
implemented this protocol handler). Again, if you do not understand the meaning
of this feature, you probably do not need it...
The last option instruction declares an
Oasis catalog
for entity resolution. This can be very useful if you need to validate an XML file
against a DTD without a network connection: with a catalog, you may use a local version
of the DTD. You may have several option nodes with different catalogs.
Attribute Summary
Name | Default Value | Optional | Accepted Values |
---|
name | namespace | true | namespace | handler | catalog | value | | false | |
Attribute Detail
- name
-
either "namespace", "handler" or "catalog". If this attribute is not set, "namespace"
is used as default.
- value
-
any string with the format "[key]=[value]". Either a prefix-URI Namespace mapping
if the name attribute is set to "namespace" or a prefix-handler class
mapping if the name attribute is set to "handler".
Children
-
No.
|
|