DOMToDoc Parameter Definitions

All parameters, except the XPath parameter, are optional and create different results for DOMToDoc.

XPath

The xpath parameter is the only required parameter. It is an xpath to the xml node in the business process instance data (ProcessData) that you want extracted into the document.

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode)" />

Document Name

The document name value, if specified is the name the document in process data is given, with the data from the xpath node specified. If none is specified the default value of “Document” is used.

Usage Example:

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode,’DOMToDoc_Document’)" />

Stand Alone

The values allowed for this option is “YES” or “NO”. It tells the function which value to use in the xml declaration line of the document. (<?xml version="1.0" encoding="UTF-8" standalone="YES or NO"?>) The default value is “no”.

Usage Example:

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode,’’,’YES’)" />

Root Name

The root name sets the root xml element, to wrap the data specified by the XPath in the xml document created, and will specify it in the DOCTYPE declaration. The default value is null, which means the xml document will contain just the nodes specified in the XPath without any root element wrapping that data.

Usage Example:

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode,’’,’’,’docroot’)" />

Default Behavior with XPath = /ProcessData/test


<ProcessData>
<test>
<data>123</data>
</test>
</ProcessData>
Becomes….
<?xml version=”1.0” encoding=”UTF-8” standalone=”no”?>
<test>
<data>123</data>
</test>
Behavior when specified
<ProcessData>
<test>
<data>123</data>
</test>
</ProcessData>
Becomes….
<?xml version=”1.0” encoding=”UTF-8” standalone=”no”?>
<docroot>
<test>
<data>123</data>
</test>
</docroot>

Encoding

The encoding parameter sets the documents character encoding. This is a string value, and will set the character encoding to any string passed, so it is important that you pass a valid encoding. No validation is done against this parameter. The default value is “UTF-8”.

Usage Example:

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode,’’,’’,’’,’UTF-16’)" />

System URL

Specifying this parameter will create a document type declaration in the xml document and set it to SYSTEM with the url being the string specified. The default is null, meaning no declaration of system will be done.

Usage Example:

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode,’’,’’,’’,’’,’http://stercomm.com/xml/example’)" />

This will result in the document having <!DOCTYPE SYSTEM "http://stercomm.com/xml/example">

DTD Name

Specifying this parameter will create a document type declaration in the xml document and set it to PUBLIC with the value being the dtd name specified in the value of this parameter. The default is null, meaning no declaration of PUBLIC will be done.

Usage Example:

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode,’’,’’,’’,’’,’’,’testdtd’)" />

This will result in the document having <!DOCTYPE PUBLIC "testdtd">

Public URL

Specifying this parameter will create a document type declaration in the xml document and set it to PUBLIC with the value being the dtd name specified in the value of this parameter. The default is null, meaning no declaration of PUBLIC will be done.

Usage Example:

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode,’’,’’,’’,’’,’’,’’,’publicurl’)" />

This will result in the document having <!DOCTYPE PUBLIC "publicurl">

Attribute Quoting

This parameter specifies whether to wrap xml attributes in single quotes or double quotes. Both are completely valid xml. The parameter takes a value of “single” or “double” with single quotes as the default behavior.

Usage Example:

<assign to="." from="DOMToDoc(/ProcessData/beginningxmlnode,’’,’’,’’,’’,’’,’’,’’,’double’)" />

This will result in the document having <test name=”testattribute”> instead of <test name=’testattribute’>