You are here: Job and Form Set Rules Reference > JDT Rules Reference > UseXMLExtract

UseXMLExtract

Use this form set level rule when the extract list loaded by the transaction is also the source of the XML tree.

Note

The extract list and the XML tree are separate items. Even if you are only using an XML file as the source of the transaction, there will be two copies of the information in memory — one as the extract list and one as the XML tree.

If you are running Documaker from IDS, use the ImportXMLExtract rule to bring in XML in standard Documaker XML format, such as from Documaker Desktop or iDocumaker. Use the UseXMLExtract rule to convert a loaded extract file into an XML tree, which you can then use to query data.

Syntax

;UseXMLExtract;;

Each XML transaction must begin with the XML declaration. The system assumes each transaction is a separate entity and requires that each transaction begin with an XML declaration.

Keep in mind that you will not be able to load this appended file as one large XML file. The system does not load the entire file before it processes the first transaction. Instead, it loads one transaction and then processes that transaction. Make sure there are line feeds between transactions. The line feed requirement is not an XML issue, but rather tells the system where one transaction ends and the next begins.

You place the rule in different locations in the AFGJOB.JDT file, depending on the mode in which you are running. For multi-step mode, place the XMLFileExtract rule after the LoadExtractData rule, as shown here:

;LoadExtractData;;

;UseXMLExtract;;;

For single or two-step mode, place the XMLFileExtract rule after the NoGenTrnTransactionProc rule, as shown here:

;NoGenTrnTransactionProc;;

;UseXMLExtract;;;

Remember that the system decides whether to search the extract list or the XML tree by checking to see if the search mask starts with an exclamation mark (!). The exclamation mark indicates that this is an XML path string. The system ignores the exclamation mark when it performs the XML path search.

To preserve the space when mapping data, use two exclamation marks (!!). Otherwise, the system assumes it should remove the leading white space.

Use these INI options with this rule:

< TRN_File >

MaxExRecLen =

< Data >

ExtrFile = .\extract\Sample.xml

< ExtractKeyField >

SearchMask = 1,<?xml

< RunMode >

XMLExtract = Yes