Overview
This article will guide you along to check that the states are correct. After you set up lines and parameters, and configure the states, you can test the output.
Requirements
You need the following files to test:
- Your eFORMz project (.efz) file that includes the Text to XML preprocessor section.
- Any required subproject files.
- A data file.
Procedure
A thorough test of the Text to XML output usually requires multiple documents, especially those that present edge cases, including very long strings or numeric values.
- Start the eFORMz Composer and load the data file.
- The data is displayed in the Viewer window.
- Look over the data.
- Is it formatted correctly?
- Are all values present?
- Find the Text to XML Preprocessor step (labeled in later versions as Text to XML Converter) right-click > Edit > Text to XML Editor to open the editor.
- If any values were missing in Step 1, find the value in the Lines list, and click the name. The line that contains the values will be colored in, and the values highlighted, as shown below. If the text is cut off (and extends beyond the highlighted area), increase the Length value. If the highlight does not begin where the data begins, change the Column value to start where the data starts.
- If values that are selected by regular expression (regex) are incorrect, you must update the expression to capture the data correctly.
- If all the data appears correct, you are finished. Formatting issues, missing data, or other problems that remain point to a problem with the XML states. Next to Lines, click States to start checking states.
- All states require an end state. Simple data that appears once on a line, such as a sales order number, usually have an end state of (empty):
Click on (empty), and the EndState Editor at the bottom of the page shows no values because the value appears only once in the page.
Data that appears multiple times should have start and stop states that tell the parser when to start and stop looking for values. For example, the line ItemNumberStart is a series of lines that are used in the Code field. The Column field says these lines begin on Column 0. You can see the data has these lines on data line 395:
Back on the States tab, the ItemNumberStart state identifies where ItemDetails begins.
The Text to XML parser iterates through each item until it reaches the ItemNumberStop state. This line has the text Shipment Weight Summary. This tells the parser it is finished with all of the item detail lines.
Check that every start state has a stop state, and that both the start and stop states can be identified within the data. In the example above, if the section that includes Shipment Weight Summary is missing, the parser never exits the ItemNumberStart state.
Assistance
If any further assistance is needed, please contact our Support team.
Related Articles
Converting Text Files to XML with the Text to XML Preprocessor
Comments
0 comments
Article is closed for comments.