2022.2

Table Of Contents
l
Use XPath:EnteranXPathtocreateadelimiterbasedonthenode nameofelements.For
example:./*[starts-with(name(),'inv')]setsadelimiteraftereveryelementofwhich
thenamestartswith'inv'.Notethatstarts-with()isanXPathfunction.Foranoverviewof
XPathfunctions,seeMozilla:XPathFunctions.
TheXPathmayalsocontainJavaScriptcode.InordertouseJavaScript:Notethatsincethe
XPathisastring,thereturnvalueoftheJavaScriptstatementwillbeinterpretedasastring.
l
TheXPathmuststartwith=
l
TheentireJavaScriptstatementmustbeenclosedincurlybrackets:{...}
l
AnyothercurlybracketsthatarenotpartoftheJavaScriptcodemustbeescapedwitha
backslash.
l
Singlelinecomments(//...)inthecodearenotsupported.
Note: Currently,XPathsthatselectelementsbasedonanattribute,attributevalue,node
value,nodecounterornodeindexarenotsupported.
l
Show all elements:WhenthedelimiterissettoaspecificelementorXPath,checkingthis
optionallowstoextractinformationfromhigher-levelnodes,includingthosethatfollowtheele-
mentorpath.Thismightslowdowntheprocessing,soifyoudon'tneedanyinformationfromthe
higher-levelnodesthatfollowthatspecificelement,itisrecommendedtoleavethisoption
unchecked.
Whenthisoptionisusedincombinationwithatriggerelementthatisnotrepeatedatthesame
nodelevel(inotherwords,itdoesn'thaveasiblingwiththesamename),theentireXMLdoc-
umentwillbeshownforeachrecord,exceptthetriggerelement,whichwillonlybeshownforthe
recordthatiscurrentlyselectedintheDataModelpane.
ThiscouldleadtoaproblemwithsomestepsthatuseanXPathwithabsoluteindexes,suchasa
location-basedExtractstep.UsingadynamicindexintheXPathwillfixtheproblem.For
example,inthecaseofalocation-basedExtractstep,switchtoextractingthedataviaJavaScript
(see"Expression-basedfield"onpage265);intheJavaScriptexpression,replacetheindexof
theelement'sparentintheXPathwithrecord.index.
Note: Theinformationcontainedinalloftheselectedparentnodeswillbecopiedforeach
instanceofthatnode.Forexample,ifaclientnodecontainsmultipleinvoicenodes,theinform-
ationfortheclientnodecanbeduplicatedforeachinvoice.
TheDataMapperonlyextractselementsforwhichatleastonevalueorattributevalueisdefined
inthefile.
Page 312