Absolute Path
Starts selection at the XML document root.
/Report/<NodeCollection>/<Node>When to use
Use when the target location is fixed regardless of current context.
Notes
Absolute paths break if the root structure changes.
Phase 4 ยท Reference Material
Phase 4 extends the XPath Library with XPath 1.0 navigation, filtering, duplicate detection, and text functions.
Starts selection at the XML document root.
/Report/<NodeCollection>/<Node>Use when the target location is fixed regardless of current context.
Absolute paths break if the root structure changes.
Starts from the current context node.
Detail/<FieldName>Use inside Transformer actions where the current node is already selected.
Know your current node before writing the expression.
Selects the parent of the current node.
..Use when a field-level match needs to act on the parent record.
Avoid climbing too far without confirming the XML structure.
Selects prior sibling Detail nodes.
preceding-sibling::DetailUseful for duplicate detection and comparing current row to earlier rows.
Only checks siblings at the same level.
Selects following sibling Detail nodes.
following-sibling::DetailUseful when comparing a current line to later lines.
Can be expensive on large XML if overused.
Selects the first matching node.
[position() = 1]Use when only the first occurrence should remain or be processed.
[1] is shorter but context can matter.
Selects every matching node except the first.
[position() > 1]Use for removing repeated nodes when position is enough.
Do not write position()=!1; that is invalid XPath syntax.
Selects the last matching node.
[last()]Use when totals or final records should be processed.
last() is based on the current node set.
Finds rows where the current field value already appeared earlier.
Detail[FIELD_ID = preceding-sibling::Detail/FIELD_ID]Use for deleting duplicate Detail records while keeping the first occurrence.
Only works for duplicates under the same parent.
Trims and collapses internal whitespace.
normalize-space(FIELD_NAME)Use before comparing values that may contain extra spaces.
normalize-space() returns a string, not a node.
Checks whether a field contains text.
contains(FIELD_NAME, "ABC")Use for partial text matching.
Case-sensitive in XPath 1.0.
Checks whether a field starts with text.
starts-with(FIELD_NAME, "ABC")Use for prefix checks such as account, item, or document patterns.
Case-sensitive in XPath 1.0.
XPath 1.0 workaround for suffix matching.
substring(FIELD_NAME, string-length(FIELD_NAME) - string-length("ABC") + 1) = "ABC"Use because XPath 1.0 has no ends-with() function.
Fails if you forget the + 1 offset.
Returns the number of characters in a string.
string-length(FIELD_NAME)Use for testing blank values or fixed-length fields.
Whitespace counts unless normalized first.
Counts matching child nodes.
count(Detail)Use in conditions that depend on number of records.
Make sure the path is relative to the right node.
Checks that a field has content.
normalize-space(FIELD_NAME) != ""Use instead of FIELD_NAME != "" when spaces are possible.
Avoid treating whitespace as meaningful data.
Requires both conditions to be true.
FIELD_A != "" and FIELD_B = "Yes"Use for precise filtering.
Use lowercase and/or in XPath.
Allows either condition to be true.
FIELD_A = "A" or FIELD_A = "B"Use for multiple accepted values.
Parentheses help readability for complex logic.
Phase 5 adds related-topic guidance to reduce duplicate entries and make reusable patterns easier to find.