Table of Contents

Search

  1. Preface
  2. Introduction to Data Transformation
  3. Data Processor Transformation
  4. Wizard Input and Output Formats
  5. Relational Input and Output
  6. Using the IntelliScript Editor
  7. XMap
  8. Libraries
  9. Schema Object
  10. Command Line Interface
  11. Scripts
  12. Parsers
  13. Script Ports
  14. Document Processors
  15. Formats
  16. Data Holders
  17. Anchors
  18. Transformers
  19. Actions
  20. Serializers
  21. Mappers
  22. Locators, Keys, and Indexing
  23. Streamers
  24. Validators, Notifications, and Failure Handling
  25. Validation Rules
  26. Custom Script Components

User Guide

User Guide

Phase Property

Phase Property

If a
Content
anchor lies between two
Marker
anchors, then by default, the search scope for the
Content
is the segment between the
Marker
anchors.
If you change all the anchors to the same phase, the search scope of the
Content
is no longer bounded by the second
Marker
. It is from the end of the first
Marker
to the end of the document.
As an example, consider the following source document:
Tree Fig Date<tab>October 27, 2003 (pruned) Tree Date Palm Date April 27, 2003<tab>(planted)
The example assumes that the source document has a loose structure, containing varying numbers of spaces, tabs, or other symbols interspersed in the text, so we cannot easily use the spaces and tabs as delimiters. An example like this might arise in parsing word-processor documents.
We can parse this document using a
RepeatingGroup
anchor, which contains nested
Marker
and
Content
anchors. The
Marker
anchors are the strings
Tree
and
Date
. The
Content
anchors are everything between the
Marker
anchors, including the spaces and tabs.
The problem in parsing this document is in the second iteration of the
RepeatingGroup
, which parses the second line. If we leave the
Marker
anchors in the initial phase, the Script incorrectly considers the first instance of the word
Date
to be a
Marker
. In the main phase, it fails to find
Date Palm
because the search scope is between the two
Marker
anchors, and there is no text between them.
A possible solution is to move the
Marker
for
Date
to the main phase, and to define the
Content
anchor,
Date Palm
, using an expression that searches for a tree name of one or two words. In the initial phase of the
RepeatingGroup
, the Script finds the
Marker
for
Tree
. In the main phase, it finds
Date Palm
followed by the
Marker
for
Date
.
With the new phase setting, we have changed the search scope for the tree name. The scope is now from
Tree
to the end of the iteration, and the Script finds
Date Palm
successfully.

0 COMMENTS

We’d like to hear from you!