Namespace URI: http://www.xchain.org/core/1.0
The base core commands for xchains. These commands provide flow control and value management in the current context.
A general container for xchain commands. Children of a chain are executed, in order, until one of them returns true or throws an exception.
If one of the chain's children returns true , then each child that was executed will have its post process executed and then the chain will return true .
If one of the chain's children throws an exception, then each children that was executed, including the command that threw the exception, will have its post process executed with the exception that was thrown. If none of the children's post process returns true , then the exception will be rethrown by this chain. If any of the childrens post process returns true , then this chain will return false and its next sibling will execute.
<xchain:chain xmlns:xchain="http://www.xchain.org/core/1.0"> ... </xchain:chain>
The choose command allows the execution of one chain based on tested conditions. Only when and otherwise commands can be direct children of the choose command. Each when command has a test attribute. The first when command whose test attribute evaluates to true will be executed and no other child when or otherwise commands will be executed or have their test condition evaluated. otherwise commands will always be executed if encountered.
<xchain:choose xmlns:xchain="http://www.xchain.org/core/1.0"> <xchain:when test="/some/xpath"> ... </xchain:when> <xchain:when test="/some/other/xpath"> ... </xchain:when> <xchain:otherwise> ... </xchain:otherwise> </xchain:choose>
choose commands can include an otherwise command. This command will be executed if none of the when clauses associated with the same choose command executed.
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
test | The test for this when clause. If the test evaluates to true, then the when clause is executed. If the test evaluates to false, then the next when or otherwise command in the choose will be tested. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Boolean |
choose commands can have one or more when commands nested in it. The first when command whose test evaluates to true will be executed.
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
message | org.xchain.annotations.AttributeType.ATTRIBUTE_VALUE_TEMPLATE | Empty Message | String | |
level | org.xchain.annotations.AttributeType.ATTRIBUTE_VALUE_TEMPLATE | debug | String | |
logger | org.xchain.annotations.AttributeType.ATTRIBUTE_VALUE_TEMPLATE | org.xchain.namespaces.core.DebugMessageCommand | String |
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
expression | The xpath expression to be evaluated using context.getValue(context, Object.class); | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Object |
The eval command will evaluate an xpath expression.
<xchain:eval xmlns:xchain="http://www.xchain.org/core/1.0" expression="/some/xpath"/>
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
system-id | The system id of the catalog to search for the command. If no system id is provided, then the current catalog is searched. If the system id is relative, then it is resolved against the current catalog's system id. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | String |
name | The qname of the command to execute. The qname is required. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | QName |
The execute command can execute another command chain. The command can be in the current catalog or in a different catalog. The command chain will continue if and only if the referenced command would continue the command chain.
<xchain:chain xmlns:xchain="http://www.xchain.org/core/1.0"> ... <xchain:execute system-id="$myCatalog" name="$myCommand"> ... </xchain:choose>
A general container for xchain commands. Children of a chain are executed, in order, until one of them returns true or throws an exception.
If one of the chain's children returns true , then each child that was executed will have its post process executed and then the chain will return true .
If one of the chain's children throws an exception, then each children that was executed, including the command that threw the exception, will have its post process executed with the exception that was thrown. If none of the children's post process returns true , then the exception will be rethrown by this chain. If any of the children's post process returns true , then this chain will return false and its next sibling will execute.
If post process is run on this chain then the post process will be run on it's children in reverse order of their original execution.
<xchain:filter-chain xmlns:xchain="http://www.xchain.org/core/1.0"> ... </xchain:filter-chain>
The choose command implemented as a filter. This command allows the execution of one chain based on tested conditions. Only when and otherwise commands can be direct children of the choose command. Each when command has a test attribute. The first when command whose test attribute evaluates to true will be executed and no other child when or otherwise commands will be executed or have their test condition evaluated. otherwise commands will always be executed if encountered.
<xchain:filter-choose xmlns:xchain="http://www.xchain.org/core/1.0"> <xchain:when test="/some/xpath"> ... </xchain:when> <xchain:when test="/some/other/xpath"> ... </xchain:when> <xchain:otherwise> ... </xchain:otherwise> </xchain:filter-choose>
filter-choose commands can include an otherwise command. This command will be executed if none of the when clauses associated with the same filter-choose command executed.
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
test | The test for this when clause. If the test evaluates to true, then the when clause is executed. If the test evaluates to false, then the next when or otherwise command in the filter-choose will be tested. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Boolean |
filter-choose commands can have one or more when commands nested in it. The first when command whose test evaluates to true will be executed.
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
test | The test for the if command. This should evaluate to a boolean. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Boolean |
The if command implemented as a filter. This command will execute its child commands if the test attribute evaluates to true .
<xchain:filter-if xmlns:xchain="http://www.xchain.org/core/1.0" test="/some/xpath"> ... </xchain:filter-if>
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
name | The QName of the variable. | org.xchain.annotations.AttributeType.QNAME | N/A | QName |
select | The value of the variable. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Object |
select-nodes | The value of the variable. | org.xchain.annotations.AttributeType.JXPATH_SELECT_NODES | N/A | List |
select-single-node | The value of the variable. | org.xchain.annotations.AttributeType.JXPATH_SELECT_SINGLE_NODE | N/A | Object |
scope | The scope of the variable. Can either be the literal request, exeuction or chain. | org.xchain.annotations.AttributeType.LITERAL | request | Scope |
The variable command implemented as a filter. The filter-variable will declare and set a variable in the context. The name attribute is the QName of the variable. The select , select-nodes , or select-single-node attribute will be the value of the variable. The scope attribute will determine the scope of the variable. A 'chain' scope variable will only exist in the current context. A 'request' scope variable will exist for every context. A request scope is assumed if no scope attribute is provided.
During post process the original value at the QName will be restored. If no value existed at the QName then the variable will be undeclared.
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
select | An XPath to a list. | org.xchain.annotations.AttributeType.JXPATH_ITERATE_POINTERS | N/A | Iterator |
<xchain:for-each xmlns:xchain="http://www.xchain.org/core/1.0" select="/some/xpath"> ... </xchain:for-each>
<xchain:for-each xmlns:xchain="http://www.xchain.org/core/1.0" select-nodes="/some/xpath"> ... </xchain:for-each>
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
test | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Boolean |
A command that can stop the execution of an xchain by reporting that it handled the request. The command will return true when its test condition is true.
<xchain:chain xmlns:xchain="http://www.xchain.org/core/1.0"> <xchain:handled test="true()"/> <-- A command here will never execute --> </xchain:chain>
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
test | The test for the if command. This should evaluate to a boolean. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Boolean |
<xchain:if xmlns:xchain="http://www.xchain.org/core/1.0" test="/some/xpath"> ... </xchain:if>
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
variable | The QName of the variable. | org.xchain.annotations.AttributeType.QNAME | N/A | QName |
iterator | The JXPath of the java.util.Iterator object. This method is provided for backwards compatiblity, the select attribute should be used instead. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Iterator |
select | The JXPath of the object to iterate. The object can be of type java.util.Iterator, java.util.Enumeration, java.util.Collection, java.util.Map, or an array. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Object |
scope | The scope of the variable. Can either be the literal global or local. | org.xchain.annotations.AttributeType.LITERAL | request | Scope |
<xchain:iterate xmlns:xchain="http://www.xchain.org/core/1.0" select="/some/xpath" variable="name"> ... </xchain:iterate>
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
select | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Exception |
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
message | org.xchain.annotations.AttributeType.ATTRIBUTE_VALUE_TEMPLATE | Beginning XChain Stack trace | String | |
level | org.xchain.annotations.AttributeType.ATTRIBUTE_VALUE_TEMPLATE | debug | String | |
logger | org.xchain.annotations.AttributeType.ATTRIBUTE_VALUE_TEMPLATE | org.xchain.namespaces.core.TraceCommand | String |
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
name | The QName of the variable. | org.xchain.annotations.AttributeType.QNAME | N/A | QName |
select | The value of the variable. | org.xchain.annotations.AttributeType.JXPATH_VALUE | N/A | Object |
select-nodes | The value of the variable. | org.xchain.annotations.AttributeType.JXPATH_SELECT_NODES | N/A | List |
select-single-node | The value of the variable. | org.xchain.annotations.AttributeType.JXPATH_SELECT_SINGLE_NODE | N/A | Object |
scope | The scope of the variable. Can either be the literal request, execution or chain. | org.xchain.annotations.AttributeType.LITERAL | request | Scope |
The variable command will declare and set a variable in the context. The name attribute is the QName of the variable. The select , select-nodes , or select-single-node attribute will be the value of the variable. The scope attribute will determine the scope of the variable. A 'chain' scope variable will only exist if the current context. A 'request' scope variable will exist for every context. A request scope is assumed if no scope attribute is provided.
<xchain:variable xmlns:xchain="http://www.xchain.org/core/1.0" name="/some/xpath" select="/some/xpath"/ scope="chain"/>
Name | Description | Type | Default Value | Java Return Type |
---|---|---|---|---|
select | The XPath use as the root context. | org.xchain.annotations.AttributeType.JXPATH_POINTER | N/A | Pointer |
The with command will execute its child commands with the selected element as the root context.
<xchain:with xmlns:xchain="http://www.xchain.org/core/1.0" select="/some/xpath"> ... </xchain:with>