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. XMap
  7. Libraries
  8. Schema Object
  9. Command Line Interface
  10. Scripts
  11. Parsers
  12. Script Ports
  13. Document Processors
  14. Formats
  15. Data Holders
  16. Anchors
  17. Transformers
  18. Actions
  19. Serializers
  20. Mappers
  21. Locators, Keys, and Indexing
  22. Streamers
  23. Validators, Notifications, and Failure Handling
  24. Validation Rules
  25. Custom Script Components

Data Transformation User Guide

Data Transformation User Guide

Output XPath Expressions

Output XPath Expressions

The Data Processor transformation accepts a subset of XPath statements in the Output field when the Mode field set to is
Add
or
Match or Add
. When you select these mode settings, the Data Processor transformation creates elements as needed to match the XPath expression in the Output field.
You can use a simple XPath expression in the Output field. A simple expression has child axes, parent axes, or variables. Simple expressions do not have predicates, functions or complex axes. For example, you can use the following Output field expressions:
person/data
/root/ceo/name
$var/name
person/../ceo
You can use a simple predicate with cardinality for an element with several instances. For example, you can use the following Output field expression:
person/phone[4]
You can use a simple predicate with a formula with an equal sign, with simple XPaths on the left-hand side of the equal sign. For example, you can use the following Output field expressions:
Person[id=10]
Person[id=$id]
Person[id=@dp:input()/ID]
Company[name=upper-case($compName)]
Person[role="manager" and id=1]
You can also use a combination of a simple expression with cardinality and a formula that uses a simple XPath on the left-hand side of the equal sign. For example, you can use the following Output field expressions:
company[4]/details[id=$myid]/phone
When the Mode field is set to
Match
, the Output field can also accept complex XPath expressions.