����������: - atomic evaluation of (translate($name_41, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case($find_42)) - inline $ret_43 - simplify gflwor - remove type check: xs:boolean - rewrite ($tmparr_40)[((count($tmparr_40) - $n_37) + 1)] to util:item-at(items,pos) - inline Q{common}findnode#2 - inline $find_104 - atomic evaluation of (translate($name_103, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at($tmparr_40, ((count($tmparr_40) - $n_37) + 1)))) - rewrite descendant-or-self step(s) - rewrite ($tmparr_40)[((count($tmparr_40) - $n_37) + 1)] to util:item-at(items,pos) - inline Q{common}findnode#2 - inline $find_106 - atomic evaluation of (translate($name_105, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at($tmparr_40, ((count($tmparr_40) - $n_37) + 1)))) - rewrite descendant-or-self step(s) - rewrite ($tmparr_40)[((count($tmparr_40) - $n_37) + 1)] to util:item-at(items,pos) - inline Q{common}findnode#2 - inline $find_108 - atomic evaluation of (translate($name_107, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at($tmparr_40, ((count($tmparr_40) - $n_37) + 1)))) - mark as tail call: $f_39(($n_37 - 1), $s_38/descendant::*[let $name_105 := local-name() return (translate($name_105, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at($tmparr_40, ((count($tmparr_40) - $n_37) + 1))))], $f_39) - mark as tail call: $f_39(($n_37 - 1), $s_38/*[let $name_107 := local-name() return (translate($name_107, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at($tmparr_40, ((count($tmparr_40) - $n_37) + 1))))], $f_39) - remove type check: item()* - mark as tail call: $findnext_36(count($tmparr_35), $seq_33, $findnext_36) - inline $decs_14 - inline $pic_16 - pre-evaluate db:open("sirukov") to document-node() - rewrite ((*:REGNUM/text() != "") and (*:envelopeid/text() != "")) to predicate(s) - rewrite boolean((*:REGNUM/text() != "")) to '!=' operator - rewrite boolean((*:envelopeid/text() != "")) to '!=' operator - pre-evaluate db:open("sirukov") to document-node() - rewrite ((*:REGNUM/text() != "") and (*:envelopeid/text() != "") and (*:PARENT_ID/text() != "")) to predicate(s) - rewrite boolean((*:REGNUM/text() != "")) to '!=' operator - rewrite boolean((*:envelopeid/text() != "")) to '!=' operator - rewrite boolean((*:PARENT_ID/text() != "")) to '!=' operator - pre-evaluate db:open("000999") to document-node() sequence - apply text index for $envs_49 - rewrite where clause(s) - simplify gflwor - pre-evaluate db:open("000999") to document-node() sequence - apply text index for $invenvs_51 - rewrite where clause(s) - simplify gflwor - pre-evaluate db:open("sirukov") to document-node() - rewrite ((*:REGNUM/text() != "") and (*:envelopeid/text() = $xml_58/*:Envelope/*:Header/*:RoutingInf/*:EnvelopeID/text())) to predicate(s) - rewrite boolean((*:REGNUM/text() != "")) to '!=' operator - rewrite boolean((*:envelopeid/text() = $xml_58/*:Envelope/*:Header/*:RoutingInf/*:EnvelopeID/text())) to '=' operator - inline Q{common}findpath#2 - inline $seq_111 - inline $find_112 - pre-evaluate tokenize("esadout_cugoodsshipment/esadout_cuconsignor/organizationname", "/") to xs:string sequence - inline $tmparr_113 - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_122, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_115) + 1)))) - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - pre-evaluate (3 - 1) to xs:integer - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_123, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_115) + 1)))) - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_124, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_115) + 1)))) - pre-evaluate function($n_115 as xs:integer, $s_116 as node()*, $f_117 as function(*)) { if(($n_115 eq 1)) then $s_116/descendant::*[let $name_122 := local-name() return (translate($name_122, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_115) + 1))))] else if(($n_115 eq 2)) then $f_117(($n_115 - 1), $s_116/descendant::*[let $name_123 := local-name() return (translate($name_123, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_115) + 1))))], $f_117) else $f_117(($n_115 - 1), $s_116/*[let $name_124 := local-name() return (translate($name_124, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_115) + 1))))], $f_117) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - inline $findnext_114 - inline function($n_115 as xs:integer,$s_116 as node()*,$f_117 as function(*)) as item()* {...} - remove type check: $n_125 as xs:integer - remove type check: $f_127 as function(*) - inline $n_125 - pre-evaluate (3 eq 1) to xs:boolean - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadout_cugoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadout_cugoodsshipment") to xs:string - atomic evaluation of (translate($name_128, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment") - pre-evaluate (3 eq 2) to xs:boolean - pre-evaluate (3 - 1) to xs:integer - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadout_cugoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadout_cugoodsshipment") to xs:string - atomic evaluation of (translate($name_129, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment") - pre-evaluate (3 - 1) to xs:integer - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadout_cugoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadout_cugoodsshipment") to xs:string - atomic evaluation of (translate($name_130, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment") - rewrite if(false()) then $f_127(2, $s_126/descendant::*[let $name_129 := local-name() return (translate($name_129, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")], $f_127) else $f_127(2, $s_126/*[let $name_130 := local-name() return (translate($name_130, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")], $f_127) to Variable(...) - rewrite if(false()) then $s_126/descendant::*[let $name_128 := local-name() return (translate($name_128, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")] else $f_127(2, $s_126/*[let $name_130 := local-name() return (translate($name_130, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")], $f_127) to Variable(...) - inline $s_126 as node()* - inline $f_127 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_131 - inline $find_132 - pre-evaluate tokenize("esadout_cugoodsshipment/esadout_cuconsignor/organizationname", "/") to xs:string sequence - inline $tmparr_133 - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_142, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_135) + 1)))) - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - pre-evaluate (3 - 1) to xs:integer - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_143, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_135) + 1)))) - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_144, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_135) + 1)))) - pre-evaluate function($n_135 as xs:integer, $s_136 as node()*, $f_137 as function(*)) { if(($n_135 eq 1)) then $s_136/descendant::*[let $name_142 := local-name() return (translate($name_142, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_135) + 1))))] else if(($n_135 eq 2)) then $f_137(($n_135 - 1), $s_136/descendant::*[let $name_143 := local-name() return (translate($name_143, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_135) + 1))))], $f_137) else $f_137(($n_135 - 1), $s_136/*[let $name_144 := local-name() return (translate($name_144, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadout_cugoodsshipment", ...), ((3 - $n_135) + 1))))], $f_137) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("esadout_cugoodsshipment", ...)) to xs:integer - inline $findnext_134 - inline function($n_135 as xs:integer,$s_136 as node()*,$f_137 as function(*)) as item()* {...} - remove type check: $n_145 as xs:integer - remove type check: $f_147 as function(*) - inline $n_145 - pre-evaluate (3 eq 1) to xs:boolean - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadout_cugoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadout_cugoodsshipment") to xs:string - atomic evaluation of (translate($name_148, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment") - pre-evaluate (3 eq 2) to xs:boolean - pre-evaluate (3 - 1) to xs:integer - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadout_cugoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadout_cugoodsshipment") to xs:string - atomic evaluation of (translate($name_149, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment") - pre-evaluate (3 - 1) to xs:integer - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadout_cugoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadout_cugoodsshipment") to xs:string - atomic evaluation of (translate($name_150, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment") - rewrite if(false()) then $f_147(2, $s_146/descendant::*[let $name_149 := local-name() return (translate($name_149, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")], $f_147) else $f_147(2, $s_146/*[let $name_150 := local-name() return (translate($name_150, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")], $f_147) to Variable(...) - rewrite if(false()) then $s_146/descendant::*[let $name_148 := local-name() return (translate($name_148, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")] else $f_147(2, $s_146/*[let $name_150 := local-name() return (translate($name_150, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")], $f_147) to Variable(...) - inline $s_146 as node()* - inline $f_147 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_151 - inline $find_152 - pre-evaluate tokenize("esadoutgoodsshipment/esadoutconsignor/organizationname", "/") to xs:string sequence - inline $tmparr_153 - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_162, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_155) + 1)))) - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - pre-evaluate (3 - 1) to xs:integer - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_163, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_155) + 1)))) - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_164, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_155) + 1)))) - pre-evaluate function($n_155 as xs:integer, $s_156 as node()*, $f_157 as function(*)) { if(($n_155 eq 1)) then $s_156/descendant::*[let $name_162 := local-name() return (translate($name_162, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_155) + 1))))] else if(($n_155 eq 2)) then $f_157(($n_155 - 1), $s_156/descendant::*[let $name_163 := local-name() return (translate($name_163, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_155) + 1))))], $f_157) else $f_157(($n_155 - 1), $s_156/*[let $name_164 := local-name() return (translate($name_164, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_155) + 1))))], $f_157) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - inline $findnext_154 - inline function($n_155 as xs:integer,$s_156 as node()*,$f_157 as function(*)) as item()* {...} - remove type check: $n_165 as xs:integer - remove type check: $f_167 as function(*) - inline $n_165 - pre-evaluate (3 eq 1) to xs:boolean - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadoutgoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadoutgoodsshipment") to xs:string - atomic evaluation of (translate($name_168, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment") - pre-evaluate (3 eq 2) to xs:boolean - pre-evaluate (3 - 1) to xs:integer - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadoutgoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadoutgoodsshipment") to xs:string - atomic evaluation of (translate($name_169, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment") - pre-evaluate (3 - 1) to xs:integer - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadoutgoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadoutgoodsshipment") to xs:string - atomic evaluation of (translate($name_170, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment") - rewrite if(false()) then $f_167(2, $s_166/descendant::*[let $name_169 := local-name() return (translate($name_169, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")], $f_167) else $f_167(2, $s_166/*[let $name_170 := local-name() return (translate($name_170, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")], $f_167) to Variable(...) - rewrite if(false()) then $s_166/descendant::*[let $name_168 := local-name() return (translate($name_168, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")] else $f_167(2, $s_166/*[let $name_170 := local-name() return (translate($name_170, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")], $f_167) to Variable(...) - inline $s_166 as node()* - inline $f_167 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_171 - inline $find_172 - pre-evaluate tokenize("esadoutgoodsshipment/esadoutconsignor/organizationname", "/") to xs:string sequence - inline $tmparr_173 - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_182, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_175) + 1)))) - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - pre-evaluate (3 - 1) to xs:integer - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_183, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_175) + 1)))) - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - atomic evaluation of (translate($name_184, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_175) + 1)))) - pre-evaluate function($n_175 as xs:integer, $s_176 as node()*, $f_177 as function(*)) { if(($n_175 eq 1)) then $s_176/descendant::*[let $name_182 := local-name() return (translate($name_182, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_175) + 1))))] else if(($n_175 eq 2)) then $f_177(($n_175 - 1), $s_176/descendant::*[let $name_183 := local-name() return (translate($name_183, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_175) + 1))))], $f_177) else $f_177(($n_175 - 1), $s_176/*[let $name_184 := local-name() return (translate($name_184, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("esadoutgoodsshipment", ...), ((3 - $n_175) + 1))))], $f_177) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("esadoutgoodsshipment", ...)) to xs:integer - inline $findnext_174 - inline function($n_175 as xs:integer,$s_176 as node()*,$f_177 as function(*)) as item()* {...} - remove type check: $n_185 as xs:integer - remove type check: $f_187 as function(*) - inline $n_185 - pre-evaluate (3 eq 1) to xs:boolean - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadoutgoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadoutgoodsshipment") to xs:string - atomic evaluation of (translate($name_188, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment") - pre-evaluate (3 eq 2) to xs:boolean - pre-evaluate (3 - 1) to xs:integer - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadoutgoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadoutgoodsshipment") to xs:string - atomic evaluation of (translate($name_189, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment") - pre-evaluate (3 - 1) to xs:integer - pre-evaluate (3 - 3) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("esadoutgoodsshipment", ...), 1) to xs:string - pre-evaluate lower-case("esadoutgoodsshipment") to xs:string - atomic evaluation of (translate($name_190, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment") - rewrite if(false()) then $f_187(2, $s_186/descendant::*[let $name_189 := local-name() return (translate($name_189, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")], $f_187) else $f_187(2, $s_186/*[let $name_190 := local-name() return (translate($name_190, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")], $f_187) to Variable(...) - rewrite if(false()) then $s_186/descendant::*[let $name_188 := local-name() return (translate($name_188, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")] else $f_187(2, $s_186/*[let $name_190 := local-name() return (translate($name_190, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")], $f_187) to Variable(...) - inline $s_186 as node()* - inline $f_187 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findnode#2 - inline $find_192 - pre-evaluate lower-case("block") to xs:string - atomic evaluation of (translate($name_191, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "block") - rewrite descendant-or-self step(s) - rewrite ($goods_72)[$i_73] to util:item-at(items,pos) - inline Q{common}findnode#2 - inline $find_194 - pre-evaluate lower-case("G_32_TOVNUM") to xs:string - atomic evaluation of (translate($name_193, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_32_tovnum") - inline Q{common}findnode#2 - inline $find_196 - pre-evaluate lower-case("G_32_TOVNUM") to xs:string - atomic evaluation of (translate($name_195, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_32_tovnum") - inline Q{common}findnode#2 - inline $find_198 - pre-evaluate lower-case("G_32_NUM") to xs:string - atomic evaluation of (translate($name_197, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_32_num") - rewrite exists($good_74/*[let $name_193 := local-name() return (translate($name_193, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_32_tovnum")]) to iterpath - inline Q{common}findnode#2 - inline $find_200 - pre-evaluate lower-case("G_31_ARTICUL") to xs:string - atomic evaluation of (translate($name_199, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_articul") - inline Q{common}findnode#2 - inline $find_202 - pre-evaluate lower-case("G_31_QUNT") to xs:string - atomic evaluation of (translate($name_201, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_qunt") - inline Q{common}findnode#2 - inline $find_204 - pre-evaluate lower-case("G_31_TEXT") to xs:string - atomic evaluation of (translate($name_203, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_text") - inline Q{common}findnode#2 - inline $find_206 - pre-evaluate lower-case("G_42_ZASUM") to xs:string - atomic evaluation of (translate($name_205, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_42_zasum") - inline Q{common}findnode#2 - inline $find_208 - pre-evaluate lower-case("G_38_1") to xs:string - atomic evaluation of (translate($name_207, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_38_1") - inline Q{common}findnode#2 - inline $find_210 - pre-evaluate lower-case("G_35_1") to xs:string - atomic evaluation of (translate($name_209, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_35_1") - inline Q{common}findnode#2 - inline $find_212 - pre-evaluate lower-case("esadoutgoods") to xs:string - atomic evaluation of (translate($name_211, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods") - rewrite descendant-or-self step(s) - inline Q{common}findnode#2 - inline $find_214 - pre-evaluate lower-case("esadoutgoods") to xs:string - atomic evaluation of (translate($name_213, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods") - rewrite descendant-or-self step(s) - inline Q{common}findnode#2 - inline $find_216 - pre-evaluate lower-case("esadout_cugoods") to xs:string - atomic evaluation of (translate($name_215, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods") - rewrite descendant-or-self step(s) - inline Q{common}findnode#2 - inline $find_218 - pre-evaluate lower-case("esadout_cugoods") to xs:string - atomic evaluation of (translate($name_217, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods") - rewrite descendant-or-self step(s) - rewrite exists($xml_58/descendant::*[let $name_215 := local-name() return (translate($name_215, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")]) to iterpath - rewrite exists($xml_58/descendant::*[let $name_211 := local-name() return (translate($name_211, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")]) to iterpath - inline Q{common}findpath#2 - inline $seq_219 - inline $find_220 - pre-evaluate tokenize("Preferencii/CustomsTax", "/") to xs:string sequence - inline $tmparr_221 - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - atomic evaluation of (translate($name_230, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_223) + 1)))) - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - pre-evaluate (2 - 1) to xs:integer - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - atomic evaluation of (translate($name_231, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_223) + 1)))) - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - atomic evaluation of (translate($name_232, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_223) + 1)))) - pre-evaluate function($n_223 as xs:integer, $s_224 as node()*, $f_225 as function(*)) { if(($n_223 eq 1)) then $s_224/descendant::*[let $name_230 := local-name() return (translate($name_230, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_223) + 1))))] else if(($n_223 eq 1)) then $f_225(($n_223 - 1), $s_224/descendant::*[let $name_231 := local-name() return (translate($name_231, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_223) + 1))))], $f_225) else $f_225(($n_223 - 1), $s_224/*[let $name_232 := local-name() return (translate($name_232, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_223) + 1))))], $f_225) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - inline $findnext_222 - inline function($n_223 as xs:integer,$s_224 as node()*,$f_225 as function(*)) as item()* {...} - remove type check: $n_233 as xs:integer - remove type check: $f_235 as function(*) - inline $n_233 - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsTax"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_236, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsTax"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_237, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsTax"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_238, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite if(false()) then $f_235(1, $s_234/descendant::*[let $name_237 := local-name() return (translate($name_237, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_235) else $f_235(1, $s_234/*[let $name_238 := local-name() return (translate($name_238, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_235) to Variable(...) - rewrite if(false()) then $s_234/descendant::*[let $name_236 := local-name() return (translate($name_236, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")] else $f_235(1, $s_234/*[let $name_238 := local-name() return (translate($name_238, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_235) to Variable(...) - inline $s_234 as node()* - inline $f_235 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_239 - inline $find_240 - pre-evaluate tokenize("Preferencii/CustomsDuty", "/") to xs:string sequence - inline $tmparr_241 - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - atomic evaluation of (translate($name_250, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_243) + 1)))) - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - pre-evaluate (2 - 1) to xs:integer - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - atomic evaluation of (translate($name_251, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_243) + 1)))) - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - atomic evaluation of (translate($name_252, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_243) + 1)))) - pre-evaluate function($n_243 as xs:integer, $s_244 as node()*, $f_245 as function(*)) { if(($n_243 eq 1)) then $s_244/descendant::*[let $name_250 := local-name() return (translate($name_250, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_243) + 1))))] else if(($n_243 eq 1)) then $f_245(($n_243 - 1), $s_244/descendant::*[let $name_251 := local-name() return (translate($name_251, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_243) + 1))))], $f_245) else $f_245(($n_243 - 1), $s_244/*[let $name_252 := local-name() return (translate($name_252, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_243) + 1))))], $f_245) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - inline $findnext_242 - inline function($n_243 as xs:integer,$s_244 as node()*,$f_245 as function(*)) as item()* {...} - remove type check: $n_253 as xs:integer - remove type check: $f_255 as function(*) - inline $n_253 - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsDuty"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_256, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsDuty"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_257, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsDuty"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_258, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite if(false()) then $f_255(1, $s_254/descendant::*[let $name_257 := local-name() return (translate($name_257, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_255) else $f_255(1, $s_254/*[let $name_258 := local-name() return (translate($name_258, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_255) to Variable(...) - rewrite if(false()) then $s_254/descendant::*[let $name_256 := local-name() return (translate($name_256, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")] else $f_255(1, $s_254/*[let $name_258 := local-name() return (translate($name_258, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_255) to Variable(...) - inline $s_254 as node()* - inline $f_255 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_259 - inline $find_260 - pre-evaluate tokenize("Preferencii/Excise", "/") to xs:string sequence - inline $tmparr_261 - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - atomic evaluation of (translate($name_270, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_263) + 1)))) - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - pre-evaluate (2 - 1) to xs:integer - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - atomic evaluation of (translate($name_271, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_263) + 1)))) - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - atomic evaluation of (translate($name_272, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_263) + 1)))) - pre-evaluate function($n_263 as xs:integer, $s_264 as node()*, $f_265 as function(*)) { if(($n_263 eq 1)) then $s_264/descendant::*[let $name_270 := local-name() return (translate($name_270, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_263) + 1))))] else if(($n_263 eq 1)) then $f_265(($n_263 - 1), $s_264/descendant::*[let $name_271 := local-name() return (translate($name_271, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_263) + 1))))], $f_265) else $f_265(($n_263 - 1), $s_264/*[let $name_272 := local-name() return (translate($name_272, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_263) + 1))))], $f_265) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - inline $findnext_262 - inline function($n_263 as xs:integer,$s_264 as node()*,$f_265 as function(*)) as item()* {...} - remove type check: $n_273 as xs:integer - remove type check: $f_275 as function(*) - inline $n_273 - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Excise"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_276, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Excise"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_277, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Excise"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_278, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite if(false()) then $f_275(1, $s_274/descendant::*[let $name_277 := local-name() return (translate($name_277, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_275) else $f_275(1, $s_274/*[let $name_278 := local-name() return (translate($name_278, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_275) to Variable(...) - rewrite if(false()) then $s_274/descendant::*[let $name_276 := local-name() return (translate($name_276, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")] else $f_275(1, $s_274/*[let $name_278 := local-name() return (translate($name_278, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_275) to Variable(...) - inline $s_274 as node()* - inline $f_275 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_279 - inline $find_280 - pre-evaluate tokenize("Preferencii/Rate", "/") to xs:string sequence - inline $tmparr_281 - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - atomic evaluation of (translate($name_290, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_283) + 1)))) - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - pre-evaluate (2 - 1) to xs:integer - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - atomic evaluation of (translate($name_291, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_283) + 1)))) - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - atomic evaluation of (translate($name_292, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_283) + 1)))) - pre-evaluate function($n_283 as xs:integer, $s_284 as node()*, $f_285 as function(*)) { if(($n_283 eq 1)) then $s_284/descendant::*[let $name_290 := local-name() return (translate($name_290, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_283) + 1))))] else if(($n_283 eq 1)) then $f_285(($n_283 - 1), $s_284/descendant::*[let $name_291 := local-name() return (translate($name_291, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_283) + 1))))], $f_285) else $f_285(($n_283 - 1), $s_284/*[let $name_292 := local-name() return (translate($name_292, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_283) + 1))))], $f_285) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - inline $findnext_282 - inline function($n_283 as xs:integer,$s_284 as node()*,$f_285 as function(*)) as item()* {...} - remove type check: $n_293 as xs:integer - remove type check: $f_295 as function(*) - inline $n_293 - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Rate"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_296, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Rate"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_297, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Rate"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_298, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite if(false()) then $f_295(1, $s_294/descendant::*[let $name_297 := local-name() return (translate($name_297, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_295) else $f_295(1, $s_294/*[let $name_298 := local-name() return (translate($name_298, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_295) to Variable(...) - rewrite if(false()) then $s_294/descendant::*[let $name_296 := local-name() return (translate($name_296, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")] else $f_295(1, $s_294/*[let $name_298 := local-name() return (translate($name_298, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_295) to Variable(...) - inline $s_294 as node()* - inline $f_295 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}utext#2 - inline $seq_299 - inline $delim_300 - simplify gflwor - inline Q{common}text#1 - inline $seq_302 - simplify gflwor - inline Q{common}text#1 - inline $seq_304 - simplify gflwor - inline Q{common}text#1 - inline $seq_306 - simplify gflwor - inline Q{common}text#1 - inline $seq_308 - simplify gflwor - inline Q{common}text#1 - inline $seq_310 - simplify gflwor - inline Q{common}text#1 - inline $seq_312 - simplify gflwor - inline Q{common}sum#1 - inline $seq_314 - simplify gflwor - inline Q{common}sum#2 - inline $seq_316 - inline $dec_317 - pre-evaluate (1 to 3) to xs:integer sequence - simplify gflwor - inline Q{common}sum#2 - inline $seq_320 - inline $dec_321 - pre-evaluate (1 to 3) to xs:integer sequence - simplify gflwor - inline Q{common}utext#2 - inline $seq_324 - inline $delim_325 - simplify gflwor - hoist let clause: let $gtdgood_82 := if($xml_58/descendant::*[let $name_211 := local-name() return (translate($name_211, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")]) then $xml_58/descendant::*[let $name_213 := local-name() return (translate($name_213, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")] else if($xml_58/descendant::*[let $name_215 := local-name() return (translate($name_215, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")]) then $xml_58/descendant::*[let $name_217 := local-name() return (translate($name_217, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")] else () - inline $art_76 - atomic evaluation of (translate($name_327, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_articul") - inline $kolvo_77 - atomic evaluation of (translate($name_328, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_qunt") - inline $edizm_78 - atomic evaluation of (translate($name_329, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_text") - inline $cost_79 - atomic evaluation of (translate($name_330, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_42_zasum") - inline $netto_80 - atomic evaluation of (translate($name_331, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_38_1") - inline $brutto_81 - atomic evaluation of (translate($name_332, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_35_1") - inline $pref_84 - atomic evaluation of (translate($name_333, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - atomic evaluation of (translate($name_334, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - atomic evaluation of (translate($name_335, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - atomic evaluation of (translate($name_336, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite where clause(s) - hoist let clause: let $gtdgood_82 := if($xml_58/descendant::*[let $name_211 := local-name() return (translate($name_211, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")]) then $xml_58/descendant::*[let $name_213 := local-name() return (translate($name_213, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")] else if($xml_58/descendant::*[let $name_215 := local-name() return (translate($name_215, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")]) then $xml_58/descendant::*[let $name_217 := local-name() return (translate($name_217, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")] else () - inline Q{common}findnode#2 - inline $find_338 - pre-evaluate lower-case("esadoutgoods") to xs:string - atomic evaluation of (translate($name_337, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods") - rewrite descendant-or-self step(s) - inline Q{common}findnode#2 - inline $find_340 - pre-evaluate lower-case("esadoutgoods") to xs:string - atomic evaluation of (translate($name_339, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods") - rewrite descendant-or-self step(s) - inline Q{common}findnode#2 - inline $find_342 - pre-evaluate lower-case("esadout_cugoods") to xs:string - atomic evaluation of (translate($name_341, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods") - rewrite descendant-or-self step(s) - inline Q{common}findnode#2 - inline $find_344 - pre-evaluate lower-case("esadout_cugoods") to xs:string - atomic evaluation of (translate($name_343, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods") - rewrite descendant-or-self step(s) - rewrite exists($xml_58/descendant::*[let $name_341 := local-name() return (translate($name_341, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")]) to iterpath - rewrite exists($xml_58/descendant::*[let $name_337 := local-name() return (translate($name_337, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")]) to iterpath - rewrite ($goods_85)[$i_86] to util:item-at(items,pos) - inline Q{common}findpath#2 - inline $seq_345 - inline $find_346 - pre-evaluate tokenize("GoodsNumeric", "/") to xs:string - inline $tmparr_347 - pre-evaluate count("GoodsNumeric") to xs:integer - atomic evaluation of (translate($name_356, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsNumeric", ((1 - $n_349) + 1)))) - pre-evaluate count("GoodsNumeric") to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate count("GoodsNumeric") to xs:integer - atomic evaluation of (translate($name_357, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsNumeric", ((1 - $n_349) + 1)))) - pre-evaluate count("GoodsNumeric") to xs:integer - atomic evaluation of (translate($name_358, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsNumeric", ((1 - $n_349) + 1)))) - pre-evaluate function($n_349 as xs:integer, $s_350 as node()*, $f_351 as function(*)) { if(($n_349 eq 1)) then $s_350/descendant::*[let $name_356 := local-name() return (translate($name_356, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsNumeric", ((1 - $n_349) + 1))))] else if(($n_349 eq 0)) then $f_351(($n_349 - 1), $s_350/descendant::*[let $name_357 := local-name() return (translate($name_357, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsNumeric", ((1 - $n_349) + 1))))], $f_351) else $f_351(($n_349 - 1), $s_350/*[let $name_358 := local-name() return (translate($name_358, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsNumeric", ((1 - $n_349) + 1))))], $f_351) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count("GoodsNumeric") to xs:integer - inline $findnext_348 - inline function($n_349 as xs:integer,$s_350 as node()*,$f_351 as function(*)) as item()* {...} - remove type check: $n_359 as xs:integer - remove type check: $f_361 as function(*) - inline $n_359 - pre-evaluate (1 eq 1) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsNumeric", 1) to xs:string - pre-evaluate lower-case("GoodsNumeric") to xs:string - atomic evaluation of (translate($name_362, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsnumeric") - pre-evaluate (1 eq 0) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsNumeric", 1) to xs:string - pre-evaluate lower-case("GoodsNumeric") to xs:string - atomic evaluation of (translate($name_363, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsnumeric") - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsNumeric", 1) to xs:string - pre-evaluate lower-case("GoodsNumeric") to xs:string - atomic evaluation of (translate($name_364, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsnumeric") - rewrite if(false()) then $f_361(0, $s_360/descendant::*[let $name_363 := local-name() return (translate($name_363, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsnumeric")], $f_361) else $f_361(0, $s_360/*[let $name_364 := local-name() return (translate($name_364, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsnumeric")], $f_361) to Variable(...) - rewrite if(true()) then $s_360/descendant::*[let $name_362 := local-name() return (translate($name_362, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsnumeric")] else $f_361(0, $s_360/*[let $name_364 := local-name() return (translate($name_364, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsnumeric")], $f_361) to iterpath - inline $s_360 as node()* - inline $f_361 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_365 - inline $find_366 - pre-evaluate tokenize("InvoicedCost", "/") to xs:string - inline $tmparr_367 - pre-evaluate count("InvoicedCost") to xs:integer - atomic evaluation of (translate($name_376, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("InvoicedCost", ((1 - $n_369) + 1)))) - pre-evaluate count("InvoicedCost") to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate count("InvoicedCost") to xs:integer - atomic evaluation of (translate($name_377, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("InvoicedCost", ((1 - $n_369) + 1)))) - pre-evaluate count("InvoicedCost") to xs:integer - atomic evaluation of (translate($name_378, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("InvoicedCost", ((1 - $n_369) + 1)))) - pre-evaluate function($n_369 as xs:integer, $s_370 as node()*, $f_371 as function(*)) { if(($n_369 eq 1)) then $s_370/descendant::*[let $name_376 := local-name() return (translate($name_376, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("InvoicedCost", ((1 - $n_369) + 1))))] else if(($n_369 eq 0)) then $f_371(($n_369 - 1), $s_370/descendant::*[let $name_377 := local-name() return (translate($name_377, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("InvoicedCost", ((1 - $n_369) + 1))))], $f_371) else $f_371(($n_369 - 1), $s_370/*[let $name_378 := local-name() return (translate($name_378, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("InvoicedCost", ((1 - $n_369) + 1))))], $f_371) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count("InvoicedCost") to xs:integer - inline $findnext_368 - inline function($n_369 as xs:integer,$s_370 as node()*,$f_371 as function(*)) as item()* {...} - remove type check: $n_379 as xs:integer - remove type check: $f_381 as function(*) - inline $n_379 - pre-evaluate (1 eq 1) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("InvoicedCost", 1) to xs:string - pre-evaluate lower-case("InvoicedCost") to xs:string - atomic evaluation of (translate($name_382, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "invoicedcost") - pre-evaluate (1 eq 0) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("InvoicedCost", 1) to xs:string - pre-evaluate lower-case("InvoicedCost") to xs:string - atomic evaluation of (translate($name_383, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "invoicedcost") - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("InvoicedCost", 1) to xs:string - pre-evaluate lower-case("InvoicedCost") to xs:string - atomic evaluation of (translate($name_384, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "invoicedcost") - rewrite if(false()) then $f_381(0, $s_380/descendant::*[let $name_383 := local-name() return (translate($name_383, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "invoicedcost")], $f_381) else $f_381(0, $s_380/*[let $name_384 := local-name() return (translate($name_384, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "invoicedcost")], $f_381) to Variable(...) - rewrite if(true()) then $s_380/descendant::*[let $name_382 := local-name() return (translate($name_382, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "invoicedcost")] else $f_381(0, $s_380/*[let $name_384 := local-name() return (translate($name_384, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "invoicedcost")], $f_381) to iterpath - inline $s_380 as node()* - inline $f_381 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_385 - inline $find_386 - pre-evaluate tokenize("NetWeightQuantity", "/") to xs:string - inline $tmparr_387 - pre-evaluate count("NetWeightQuantity") to xs:integer - atomic evaluation of (translate($name_396, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("NetWeightQuantity", ((1 - $n_389) + 1)))) - pre-evaluate count("NetWeightQuantity") to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate count("NetWeightQuantity") to xs:integer - atomic evaluation of (translate($name_397, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("NetWeightQuantity", ((1 - $n_389) + 1)))) - pre-evaluate count("NetWeightQuantity") to xs:integer - atomic evaluation of (translate($name_398, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("NetWeightQuantity", ((1 - $n_389) + 1)))) - pre-evaluate function($n_389 as xs:integer, $s_390 as node()*, $f_391 as function(*)) { if(($n_389 eq 1)) then $s_390/descendant::*[let $name_396 := local-name() return (translate($name_396, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("NetWeightQuantity", ((1 - $n_389) + 1))))] else if(($n_389 eq 0)) then $f_391(($n_389 - 1), $s_390/descendant::*[let $name_397 := local-name() return (translate($name_397, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("NetWeightQuantity", ((1 - $n_389) + 1))))], $f_391) else $f_391(($n_389 - 1), $s_390/*[let $name_398 := local-name() return (translate($name_398, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("NetWeightQuantity", ((1 - $n_389) + 1))))], $f_391) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count("NetWeightQuantity") to xs:integer - inline $findnext_388 - inline function($n_389 as xs:integer,$s_390 as node()*,$f_391 as function(*)) as item()* {...} - remove type check: $n_399 as xs:integer - remove type check: $f_401 as function(*) - inline $n_399 - pre-evaluate (1 eq 1) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("NetWeightQuantity", 1) to xs:string - pre-evaluate lower-case("NetWeightQuantity") to xs:string - atomic evaluation of (translate($name_402, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "netweightquantity") - pre-evaluate (1 eq 0) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("NetWeightQuantity", 1) to xs:string - pre-evaluate lower-case("NetWeightQuantity") to xs:string - atomic evaluation of (translate($name_403, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "netweightquantity") - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("NetWeightQuantity", 1) to xs:string - pre-evaluate lower-case("NetWeightQuantity") to xs:string - atomic evaluation of (translate($name_404, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "netweightquantity") - rewrite if(false()) then $f_401(0, $s_400/descendant::*[let $name_403 := local-name() return (translate($name_403, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "netweightquantity")], $f_401) else $f_401(0, $s_400/*[let $name_404 := local-name() return (translate($name_404, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "netweightquantity")], $f_401) to Variable(...) - rewrite if(true()) then $s_400/descendant::*[let $name_402 := local-name() return (translate($name_402, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "netweightquantity")] else $f_401(0, $s_400/*[let $name_404 := local-name() return (translate($name_404, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "netweightquantity")], $f_401) to iterpath - inline $s_400 as node()* - inline $f_401 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_405 - inline $find_406 - pre-evaluate tokenize("GrossWeightQuantity", "/") to xs:string - inline $tmparr_407 - pre-evaluate count("GrossWeightQuantity") to xs:integer - atomic evaluation of (translate($name_416, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GrossWeightQuantity", ((1 - $n_409) + 1)))) - pre-evaluate count("GrossWeightQuantity") to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate count("GrossWeightQuantity") to xs:integer - atomic evaluation of (translate($name_417, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GrossWeightQuantity", ((1 - $n_409) + 1)))) - pre-evaluate count("GrossWeightQuantity") to xs:integer - atomic evaluation of (translate($name_418, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GrossWeightQuantity", ((1 - $n_409) + 1)))) - pre-evaluate function($n_409 as xs:integer, $s_410 as node()*, $f_411 as function(*)) { if(($n_409 eq 1)) then $s_410/descendant::*[let $name_416 := local-name() return (translate($name_416, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GrossWeightQuantity", ((1 - $n_409) + 1))))] else if(($n_409 eq 0)) then $f_411(($n_409 - 1), $s_410/descendant::*[let $name_417 := local-name() return (translate($name_417, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GrossWeightQuantity", ((1 - $n_409) + 1))))], $f_411) else $f_411(($n_409 - 1), $s_410/*[let $name_418 := local-name() return (translate($name_418, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GrossWeightQuantity", ((1 - $n_409) + 1))))], $f_411) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count("GrossWeightQuantity") to xs:integer - inline $findnext_408 - inline function($n_409 as xs:integer,$s_410 as node()*,$f_411 as function(*)) as item()* {...} - remove type check: $n_419 as xs:integer - remove type check: $f_421 as function(*) - inline $n_419 - pre-evaluate (1 eq 1) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GrossWeightQuantity", 1) to xs:string - pre-evaluate lower-case("GrossWeightQuantity") to xs:string - atomic evaluation of (translate($name_422, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "grossweightquantity") - pre-evaluate (1 eq 0) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GrossWeightQuantity", 1) to xs:string - pre-evaluate lower-case("GrossWeightQuantity") to xs:string - atomic evaluation of (translate($name_423, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "grossweightquantity") - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GrossWeightQuantity", 1) to xs:string - pre-evaluate lower-case("GrossWeightQuantity") to xs:string - atomic evaluation of (translate($name_424, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "grossweightquantity") - rewrite if(false()) then $f_421(0, $s_420/descendant::*[let $name_423 := local-name() return (translate($name_423, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "grossweightquantity")], $f_421) else $f_421(0, $s_420/*[let $name_424 := local-name() return (translate($name_424, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "grossweightquantity")], $f_421) to Variable(...) - rewrite if(true()) then $s_420/descendant::*[let $name_422 := local-name() return (translate($name_422, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "grossweightquantity")] else $f_421(0, $s_420/*[let $name_424 := local-name() return (translate($name_424, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "grossweightquantity")], $f_421) to iterpath - inline $s_420 as node()* - inline $f_421 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_425 - inline $find_426 - pre-evaluate tokenize("Preferencii/CustomsTax", "/") to xs:string sequence - inline $tmparr_427 - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - atomic evaluation of (translate($name_436, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_429) + 1)))) - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - pre-evaluate (2 - 1) to xs:integer - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - atomic evaluation of (translate($name_437, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_429) + 1)))) - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - atomic evaluation of (translate($name_438, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_429) + 1)))) - pre-evaluate function($n_429 as xs:integer, $s_430 as node()*, $f_431 as function(*)) { if(($n_429 eq 1)) then $s_430/descendant::*[let $name_436 := local-name() return (translate($name_436, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_429) + 1))))] else if(($n_429 eq 1)) then $f_431(($n_429 - 1), $s_430/descendant::*[let $name_437 := local-name() return (translate($name_437, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_429) + 1))))], $f_431) else $f_431(($n_429 - 1), $s_430/*[let $name_438 := local-name() return (translate($name_438, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsTax"), ((2 - $n_429) + 1))))], $f_431) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("Preferencii", "CustomsTax")) to xs:integer - inline $findnext_428 - inline function($n_429 as xs:integer,$s_430 as node()*,$f_431 as function(*)) as item()* {...} - remove type check: $n_439 as xs:integer - remove type check: $f_441 as function(*) - inline $n_439 - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsTax"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_442, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsTax"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_443, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsTax"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_444, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite if(false()) then $f_441(1, $s_440/descendant::*[let $name_443 := local-name() return (translate($name_443, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_441) else $f_441(1, $s_440/*[let $name_444 := local-name() return (translate($name_444, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_441) to Variable(...) - rewrite if(false()) then $s_440/descendant::*[let $name_442 := local-name() return (translate($name_442, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")] else $f_441(1, $s_440/*[let $name_444 := local-name() return (translate($name_444, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_441) to Variable(...) - inline $s_440 as node()* - inline $f_441 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_445 - inline $find_446 - pre-evaluate tokenize("Preferencii/CustomsDuty", "/") to xs:string sequence - inline $tmparr_447 - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - atomic evaluation of (translate($name_456, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_449) + 1)))) - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - pre-evaluate (2 - 1) to xs:integer - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - atomic evaluation of (translate($name_457, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_449) + 1)))) - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - atomic evaluation of (translate($name_458, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_449) + 1)))) - pre-evaluate function($n_449 as xs:integer, $s_450 as node()*, $f_451 as function(*)) { if(($n_449 eq 1)) then $s_450/descendant::*[let $name_456 := local-name() return (translate($name_456, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_449) + 1))))] else if(($n_449 eq 1)) then $f_451(($n_449 - 1), $s_450/descendant::*[let $name_457 := local-name() return (translate($name_457, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_449) + 1))))], $f_451) else $f_451(($n_449 - 1), $s_450/*[let $name_458 := local-name() return (translate($name_458, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "CustomsDuty"), ((2 - $n_449) + 1))))], $f_451) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("Preferencii", "CustomsDuty")) to xs:integer - inline $findnext_448 - inline function($n_449 as xs:integer,$s_450 as node()*,$f_451 as function(*)) as item()* {...} - remove type check: $n_459 as xs:integer - remove type check: $f_461 as function(*) - inline $n_459 - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsDuty"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_462, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsDuty"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_463, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "CustomsDuty"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_464, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite if(false()) then $f_461(1, $s_460/descendant::*[let $name_463 := local-name() return (translate($name_463, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_461) else $f_461(1, $s_460/*[let $name_464 := local-name() return (translate($name_464, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_461) to Variable(...) - rewrite if(false()) then $s_460/descendant::*[let $name_462 := local-name() return (translate($name_462, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")] else $f_461(1, $s_460/*[let $name_464 := local-name() return (translate($name_464, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_461) to Variable(...) - inline $s_460 as node()* - inline $f_461 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_465 - inline $find_466 - pre-evaluate tokenize("Preferencii/Excise", "/") to xs:string sequence - inline $tmparr_467 - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - atomic evaluation of (translate($name_476, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_469) + 1)))) - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - pre-evaluate (2 - 1) to xs:integer - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - atomic evaluation of (translate($name_477, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_469) + 1)))) - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - atomic evaluation of (translate($name_478, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_469) + 1)))) - pre-evaluate function($n_469 as xs:integer, $s_470 as node()*, $f_471 as function(*)) { if(($n_469 eq 1)) then $s_470/descendant::*[let $name_476 := local-name() return (translate($name_476, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_469) + 1))))] else if(($n_469 eq 1)) then $f_471(($n_469 - 1), $s_470/descendant::*[let $name_477 := local-name() return (translate($name_477, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_469) + 1))))], $f_471) else $f_471(($n_469 - 1), $s_470/*[let $name_478 := local-name() return (translate($name_478, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Excise"), ((2 - $n_469) + 1))))], $f_471) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("Preferencii", "Excise")) to xs:integer - inline $findnext_468 - inline function($n_469 as xs:integer,$s_470 as node()*,$f_471 as function(*)) as item()* {...} - remove type check: $n_479 as xs:integer - remove type check: $f_481 as function(*) - inline $n_479 - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Excise"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_482, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Excise"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_483, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Excise"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_484, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite if(false()) then $f_481(1, $s_480/descendant::*[let $name_483 := local-name() return (translate($name_483, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_481) else $f_481(1, $s_480/*[let $name_484 := local-name() return (translate($name_484, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_481) to Variable(...) - rewrite if(false()) then $s_480/descendant::*[let $name_482 := local-name() return (translate($name_482, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")] else $f_481(1, $s_480/*[let $name_484 := local-name() return (translate($name_484, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_481) to Variable(...) - inline $s_480 as node()* - inline $f_481 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_485 - inline $find_486 - pre-evaluate tokenize("Preferencii/Rate", "/") to xs:string sequence - inline $tmparr_487 - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - atomic evaluation of (translate($name_496, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_489) + 1)))) - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - pre-evaluate (2 - 1) to xs:integer - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - atomic evaluation of (translate($name_497, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_489) + 1)))) - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - atomic evaluation of (translate($name_498, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_489) + 1)))) - pre-evaluate function($n_489 as xs:integer, $s_490 as node()*, $f_491 as function(*)) { if(($n_489 eq 1)) then $s_490/descendant::*[let $name_496 := local-name() return (translate($name_496, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_489) + 1))))] else if(($n_489 eq 1)) then $f_491(($n_489 - 1), $s_490/descendant::*[let $name_497 := local-name() return (translate($name_497, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_489) + 1))))], $f_491) else $f_491(($n_489 - 1), $s_490/*[let $name_498 := local-name() return (translate($name_498, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at(("Preferencii", "Rate"), ((2 - $n_489) + 1))))], $f_491) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count(("Preferencii", "Rate")) to xs:integer - inline $findnext_488 - inline function($n_489 as xs:integer,$s_490 as node()*,$f_491 as function(*)) as item()* {...} - remove type check: $n_499 as xs:integer - remove type check: $f_501 as function(*) - inline $n_499 - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Rate"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_502, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 eq 1) to xs:boolean - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Rate"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_503, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - pre-evaluate (2 - 1) to xs:integer - pre-evaluate (2 - 2) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at(("Preferencii", "Rate"), 1) to xs:string - pre-evaluate lower-case("Preferencii") to xs:string - atomic evaluation of (translate($name_504, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii") - rewrite if(false()) then $f_501(1, $s_500/descendant::*[let $name_503 := local-name() return (translate($name_503, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_501) else $f_501(1, $s_500/*[let $name_504 := local-name() return (translate($name_504, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_501) to Variable(...) - rewrite if(false()) then $s_500/descendant::*[let $name_502 := local-name() return (translate($name_502, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")] else $f_501(1, $s_500/*[let $name_504 := local-name() return (translate($name_504, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], $f_501) to Variable(...) - inline $s_500 as node()* - inline $f_501 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_505 - inline $find_506 - pre-evaluate tokenize("GoodsGroupDescription", "/") to xs:string - inline $tmparr_507 - pre-evaluate count("GoodsGroupDescription") to xs:integer - atomic evaluation of (translate($name_516, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsGroupDescription", ((1 - $n_509) + 1)))) - pre-evaluate count("GoodsGroupDescription") to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate count("GoodsGroupDescription") to xs:integer - atomic evaluation of (translate($name_517, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsGroupDescription", ((1 - $n_509) + 1)))) - pre-evaluate count("GoodsGroupDescription") to xs:integer - atomic evaluation of (translate($name_518, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsGroupDescription", ((1 - $n_509) + 1)))) - pre-evaluate function($n_509 as xs:integer, $s_510 as node()*, $f_511 as function(*)) { if(($n_509 eq 1)) then $s_510/descendant::*[let $name_516 := local-name() return (translate($name_516, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsGroupDescription", ((1 - $n_509) + 1))))] else if(($n_509 eq 0)) then $f_511(($n_509 - 1), $s_510/descendant::*[let $name_517 := local-name() return (translate($name_517, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsGroupDescription", ((1 - $n_509) + 1))))], $f_511) else $f_511(($n_509 - 1), $s_510/*[let $name_518 := local-name() return (translate($name_518, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsGroupDescription", ((1 - $n_509) + 1))))], $f_511) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count("GoodsGroupDescription") to xs:integer - inline $findnext_508 - inline function($n_509 as xs:integer,$s_510 as node()*,$f_511 as function(*)) as item()* {...} - remove type check: $n_519 as xs:integer - remove type check: $f_521 as function(*) - inline $n_519 - pre-evaluate (1 eq 1) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsGroupDescription", 1) to xs:string - pre-evaluate lower-case("GoodsGroupDescription") to xs:string - atomic evaluation of (translate($name_522, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsgroupdescription") - pre-evaluate (1 eq 0) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsGroupDescription", 1) to xs:string - pre-evaluate lower-case("GoodsGroupDescription") to xs:string - atomic evaluation of (translate($name_523, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsgroupdescription") - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsGroupDescription", 1) to xs:string - pre-evaluate lower-case("GoodsGroupDescription") to xs:string - atomic evaluation of (translate($name_524, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsgroupdescription") - rewrite if(false()) then $f_521(0, $s_520/descendant::*[let $name_523 := local-name() return (translate($name_523, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsgroupdescription")], $f_521) else $f_521(0, $s_520/*[let $name_524 := local-name() return (translate($name_524, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsgroupdescription")], $f_521) to Variable(...) - rewrite if(true()) then $s_520/descendant::*[let $name_522 := local-name() return (translate($name_522, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsgroupdescription")] else $f_521(0, $s_520/*[let $name_524 := local-name() return (translate($name_524, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsgroupdescription")], $f_521) to iterpath - inline $s_520 as node()* - inline $f_521 - simplify gflwor - simplify gflwor - simplify gflwor - rewrite ($tovgs_93)[$j_94] to util:item-at(items,pos) - inline Q{common}findpath#2 - inline $seq_525 - inline $find_526 - pre-evaluate tokenize("GoodsMarking", "/") to xs:string - inline $tmparr_527 - pre-evaluate count("GoodsMarking") to xs:integer - atomic evaluation of (translate($name_536, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsMarking", ((1 - $n_529) + 1)))) - pre-evaluate count("GoodsMarking") to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate count("GoodsMarking") to xs:integer - atomic evaluation of (translate($name_537, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsMarking", ((1 - $n_529) + 1)))) - pre-evaluate count("GoodsMarking") to xs:integer - atomic evaluation of (translate($name_538, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsMarking", ((1 - $n_529) + 1)))) - pre-evaluate function($n_529 as xs:integer, $s_530 as node()*, $f_531 as function(*)) { if(($n_529 eq 1)) then $s_530/descendant::*[let $name_536 := local-name() return (translate($name_536, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsMarking", ((1 - $n_529) + 1))))] else if(($n_529 eq 0)) then $f_531(($n_529 - 1), $s_530/descendant::*[let $name_537 := local-name() return (translate($name_537, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsMarking", ((1 - $n_529) + 1))))], $f_531) else $f_531(($n_529 - 1), $s_530/*[let $name_538 := local-name() return (translate($name_538, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsMarking", ((1 - $n_529) + 1))))], $f_531) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count("GoodsMarking") to xs:integer - inline $findnext_528 - inline function($n_529 as xs:integer,$s_530 as node()*,$f_531 as function(*)) as item()* {...} - remove type check: $n_539 as xs:integer - remove type check: $s_540 as node()* - remove type check: $f_541 as function(*) - inline $n_539 - pre-evaluate (1 eq 1) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsMarking", 1) to xs:string - pre-evaluate lower-case("GoodsMarking") to xs:string - atomic evaluation of (translate($name_542, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking") - pre-evaluate (1 eq 0) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsMarking", 1) to xs:string - pre-evaluate lower-case("GoodsMarking") to xs:string - atomic evaluation of (translate($name_543, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking") - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsMarking", 1) to xs:string - pre-evaluate lower-case("GoodsMarking") to xs:string - atomic evaluation of (translate($name_544, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking") - rewrite if(false()) then $f_541(0, $s_540/descendant::*[let $name_543 := local-name() return (translate($name_543, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking")], $f_541) else $f_541(0, $s_540/*[let $name_544 := local-name() return (translate($name_544, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking")], $f_541) to Variable(...) - rewrite if(true()) then $s_540/descendant::*[let $name_542 := local-name() return (translate($name_542, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking")] else $f_541(0, $s_540/*[let $name_544 := local-name() return (translate($name_544, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking")], $f_541) to iterpath - inline $s_540 - inline $f_541 - simplify gflwor - simplify gflwor - simplify gflwor - rewrite ($j_94 > 1) to range comparison - rewrite ($j_94 > 1) to range comparison - rewrite ($j_94 > 1) to range comparison - inline Q{common}findpath#2 - inline $seq_545 - inline $find_546 - pre-evaluate tokenize("GoodsQuantity", "/") to xs:string - inline $tmparr_547 - pre-evaluate count("GoodsQuantity") to xs:integer - atomic evaluation of (translate($name_556, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsQuantity", ((1 - $n_549) + 1)))) - pre-evaluate count("GoodsQuantity") to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate count("GoodsQuantity") to xs:integer - atomic evaluation of (translate($name_557, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsQuantity", ((1 - $n_549) + 1)))) - pre-evaluate count("GoodsQuantity") to xs:integer - atomic evaluation of (translate($name_558, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsQuantity", ((1 - $n_549) + 1)))) - pre-evaluate function($n_549 as xs:integer, $s_550 as node()*, $f_551 as function(*)) { if(($n_549 eq 1)) then $s_550/descendant::*[let $name_556 := local-name() return (translate($name_556, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsQuantity", ((1 - $n_549) + 1))))] else if(($n_549 eq 0)) then $f_551(($n_549 - 1), $s_550/descendant::*[let $name_557 := local-name() return (translate($name_557, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsQuantity", ((1 - $n_549) + 1))))], $f_551) else $f_551(($n_549 - 1), $s_550/*[let $name_558 := local-name() return (translate($name_558, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("GoodsQuantity", ((1 - $n_549) + 1))))], $f_551) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count("GoodsQuantity") to xs:integer - inline $findnext_548 - inline function($n_549 as xs:integer,$s_550 as node()*,$f_551 as function(*)) as item()* {...} - remove type check: $n_559 as xs:integer - remove type check: $s_560 as node()* - remove type check: $f_561 as function(*) - inline $n_559 - pre-evaluate (1 eq 1) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsQuantity", 1) to xs:string - pre-evaluate lower-case("GoodsQuantity") to xs:string - atomic evaluation of (translate($name_562, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity") - pre-evaluate (1 eq 0) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsQuantity", 1) to xs:string - pre-evaluate lower-case("GoodsQuantity") to xs:string - atomic evaluation of (translate($name_563, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity") - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("GoodsQuantity", 1) to xs:string - pre-evaluate lower-case("GoodsQuantity") to xs:string - atomic evaluation of (translate($name_564, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity") - rewrite if(false()) then $f_561(0, $s_560/descendant::*[let $name_563 := local-name() return (translate($name_563, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity")], $f_561) else $f_561(0, $s_560/*[let $name_564 := local-name() return (translate($name_564, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity")], $f_561) to Variable(...) - rewrite if(true()) then $s_560/descendant::*[let $name_562 := local-name() return (translate($name_562, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity")] else $f_561(0, $s_560/*[let $name_564 := local-name() return (translate($name_564, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity")], $f_561) to iterpath - inline $s_560 - inline $f_561 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}findpath#2 - inline $seq_565 - inline $find_566 - pre-evaluate tokenize("MeasureUnitQualifierName", "/") to xs:string - inline $tmparr_567 - pre-evaluate count("MeasureUnitQualifierName") to xs:integer - atomic evaluation of (translate($name_576, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("MeasureUnitQualifierName", ((1 - $n_569) + 1)))) - pre-evaluate count("MeasureUnitQualifierName") to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate count("MeasureUnitQualifierName") to xs:integer - atomic evaluation of (translate($name_577, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("MeasureUnitQualifierName", ((1 - $n_569) + 1)))) - pre-evaluate count("MeasureUnitQualifierName") to xs:integer - atomic evaluation of (translate($name_578, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("MeasureUnitQualifierName", ((1 - $n_569) + 1)))) - pre-evaluate function($n_569 as xs:integer, $s_570 as node()*, $f_571 as function(*)) { if(($n_569 eq 1)) then $s_570/descendant::*[let $name_576 := local-name() return (translate($name_576, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("MeasureUnitQualifierName", ((1 - $n_569) + 1))))] else if(($n_569 eq 0)) then $f_571(($n_569 - 1), $s_570/descendant::*[let $name_577 := local-name() return (translate($name_577, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("MeasureUnitQualifierName", ((1 - $n_569) + 1))))], $f_571) else $f_571(($n_569 - 1), $s_570/*[let $name_578 := local-name() return (translate($name_578, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = lower-case(util:item-at("MeasureUnitQualifierName", ((1 - $n_569) + 1))))], $f_571) } to function(xs:integer, node()*, function(*)) as item()* - pre-evaluate count("MeasureUnitQualifierName") to xs:integer - inline $findnext_568 - inline function($n_569 as xs:integer,$s_570 as node()*,$f_571 as function(*)) as item()* {...} - remove type check: $n_579 as xs:integer - remove type check: $s_580 as node()* - remove type check: $f_581 as function(*) - inline $n_579 - pre-evaluate (1 eq 1) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("MeasureUnitQualifierName", 1) to xs:string - pre-evaluate lower-case("MeasureUnitQualifierName") to xs:string - atomic evaluation of (translate($name_582, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername") - pre-evaluate (1 eq 0) to xs:boolean - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("MeasureUnitQualifierName", 1) to xs:string - pre-evaluate lower-case("MeasureUnitQualifierName") to xs:string - atomic evaluation of (translate($name_583, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername") - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (1 - 1) to xs:integer - pre-evaluate (0 + 1) to xs:integer - pre-evaluate util:item-at("MeasureUnitQualifierName", 1) to xs:string - pre-evaluate lower-case("MeasureUnitQualifierName") to xs:string - atomic evaluation of (translate($name_584, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername") - rewrite if(false()) then $f_581(0, $s_580/descendant::*[let $name_583 := local-name() return (translate($name_583, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername")], $f_581) else $f_581(0, $s_580/*[let $name_584 := local-name() return (translate($name_584, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername")], $f_581) to Variable(...) - rewrite if(true()) then $s_580/descendant::*[let $name_582 := local-name() return (translate($name_582, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername")] else $f_581(0, $s_580/*[let $name_584 := local-name() return (translate($name_584, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername")], $f_581) to iterpath - inline $s_580 - inline $f_581 - simplify gflwor - simplify gflwor - simplify gflwor - inline Q{common}utext#2 - inline $seq_585 - inline $delim_586 - simplify gflwor - inline Q{common}text#1 - inline $seq_588 - simplify gflwor - inline Q{common}text#1 - inline $seq_590 - simplify gflwor - inline Q{common}text#1 - inline $seq_592 - simplify gflwor - inline Q{common}text#1 - inline $seq_594 - simplify gflwor - inline Q{common}text#1 - inline $seq_596 - simplify gflwor - inline Q{common}text#1 - inline $seq_598 - simplify gflwor - inline Q{common}sum#1 - inline $seq_600 - simplify gflwor - inline Q{common}sum#2 - inline $seq_602 - inline $dec_603 - pre-evaluate (1 to 3) to xs:integer sequence - simplify gflwor - inline Q{common}sum#2 - inline $seq_606 - inline $dec_607 - pre-evaluate (1 to 3) to xs:integer sequence - simplify gflwor - inline Q{common}utext#2 - inline $seq_610 - inline $delim_611 - simplify gflwor - inline $art_96 - atomic evaluation of (translate($name_613, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking") - atomic evaluation of (translate($name_613, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking") - inline $kolvo_100 - atomic evaluation of (translate($name_614, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity") - atomic evaluation of (translate($name_613, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking") - atomic evaluation of (translate($name_614, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity") - inline $edizm_101 - atomic evaluation of (translate($name_615, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername") - atomic evaluation of (translate($name_613, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking") - atomic evaluation of (translate($name_614, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity") - atomic evaluation of (translate($name_615, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername") - inline $invenvs_51 - inline $docs_54 - inline $gtdpost_63 - inline $gtddate_65 - inline $gtdnum_66 - inline $consignor_67 - remove type check: node()* - atomic evaluation of (translate($name_617, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment") - remove type check: node()* - atomic evaluation of (translate($name_618, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment") - remove type check: node()* - atomic evaluation of (translate($name_619, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment") - remove type check: node()* - atomic evaluation of (translate($name_620, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment") - remove variable $pid_61 ���������������� ������: let $envs_49 := for $doc_50 in db:open-pre("sirukov",0)/*:docs/*:doc[(*:REGNUM/text() != "")][(*:envelopeid/text() != "")] return $doc_50/*:envelopeid/text() let $count_53 := count($envs_49) let $invdocs_56 := db:text("000999", for $doc_616 in db:open-pre("sirukov",0)/*:docs/*:doc[(*:REGNUM/text() != "")][(*:envelopeid/text() != "")][(*:PARENT_ID/text() != "")] return $doc_616/*:PARENT_ID/text())/parent::*:EnvelopeID/parent::*:RoutingInf/parent::*:Header/parent::*:Envelope/..[self::document-node()] for $xml_58 in db:text("000999", $envs_49)/parent::*:EnvelopeID/parent::*:RoutingInf/parent::*:Header/parent::*:Envelope/..[self::document-node()] let $doc_59 := db:open-pre("sirukov",0)/*:docs/*:doc[(*:REGNUM/text() != "")][(*:envelopeid/text() = $xml_58/*:Envelope/*:Header/*:RoutingInf/*:EnvelopeID/text())] let $login_60 := $doc_59/*:login/text() let $ngtd_62 := $doc_59/*:REGNUM/text() let $gtddate_64 := substring($ngtd_62, 10, 6) let $consignor_68 := if(exists(function($n_115 as xs:integer,$s_116 as node()*,$f_117 as function(*)) as item()* {...}(2, $xml_58/*[let $name_617 := local-name() return (translate($name_617, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")], function($n_115 as xs:integer,$s_116 as node()*,$f_117 as function(*)) as item()* {...}))) then function($n_135 as xs:integer,$s_136 as node()*,$f_137 as function(*)) as item()* {...}(2, $xml_58/*[let $name_618 := local-name() return (translate($name_618, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoodsshipment")], function($n_135 as xs:integer,$s_136 as node()*,$f_137 as function(*)) as item()* {...}) else if(exists(function($n_155 as xs:integer,$s_156 as node()*,$f_157 as function(*)) as item()* {...}(2, $xml_58/*[let $name_619 := local-name() return (translate($name_619, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")], function($n_155 as xs:integer,$s_156 as node()*,$f_157 as function(*)) as item()* {...}))) then function($n_175 as xs:integer,$s_176 as node()*,$f_177 as function(*)) as item()* {...}(2, $xml_58/*[let $name_620 := local-name() return (translate($name_620, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoodsshipment")], function($n_175 as xs:integer,$s_176 as node()*,$f_177 as function(*)) as item()* {...}) else ()/text() order by substring($ngtd_62, 1, 8) empty least, concat("20", substring($gtddate_64, 5, 2), "-", substring($gtddate_64, 3, 2), "-", substring($gtddate_64, 1, 2)) cast as xs:date empty least, substring($ngtd_62, 17, 7) empty least let $binv_69 := $doc_59/*:PARENT_ID/text() let $ret_70 := if(($binv_69 != "")) then let $gtdgood_82 := if($xml_58/descendant::*[let $name_211 := local-name() return (translate($name_211, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")]) then $xml_58/descendant::*[let $name_213 := local-name() return (translate($name_213, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")] else if($xml_58/descendant::*[let $name_215 := local-name() return (translate($name_215, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")]) then $xml_58/descendant::*[let $name_217 := local-name() return (translate($name_217, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")] else () for $invxml_71 in ($invdocs_56)[(*:Envelope/*:Header/*:RoutingInf/*:EnvelopeID/text() = $binv_69)] let $goods_72 := $invxml_71/descendant::*[let $name_191 := local-name() return (translate($name_191, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "block")] for $i_73 in (1 to count($goods_72)) let $good_74 := util:item-at($goods_72, $i_73) let $ntov_75 := if($good_74/*[let $name_193 := local-name() return (translate($name_193, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_32_tovnum")]) then $good_74/*[let $name_195 := local-name() return (translate($name_195, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_32_tovnum")]/text() else $good_74/*[let $name_197 := local-name() return (translate($name_197, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_32_num")]/text() let $gtdgood_83 := ($gtdgood_82)[(*:GoodsNumeric/text() = $ntov_75)] return map { "ngtd":((: node(), true :) let $node_301 := text { (concat("""", replace(string-join(distinct-values($ngtd_62), ", "), """", "\\"""), """")) } return $node_301), "otpr":((: node(), true :) let $node_303 := text { (concat("""", replace(string-join($consignor_68, " "), """", "\\"""), """")) } return $node_303), "ntov":((: node(), true :) let $node_305 := text { (concat("""", replace(string-join($ntov_75, " "), """", "\\"""), """")) } return $node_305), "pref":((: node(), true :) let $node_307 := text { (concat("""", replace(string-join(concat(function($n_223 as xs:integer,$s_224 as node()*,$f_225 as function(*)) as item()* {...}(1, ((: node()*, true :) $gtdgood_83)/*[let $name_333 := local-name() return (translate($name_333, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], function($n_223 as xs:integer,$s_224 as node()*,$f_225 as function(*)) as item()* {...})/text(), function($n_243 as xs:integer,$s_244 as node()*,$f_245 as function(*)) as item()* {...}(1, ((: node()*, true :) $gtdgood_83)/*[let $name_334 := local-name() return (translate($name_334, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], function($n_243 as xs:integer,$s_244 as node()*,$f_245 as function(*)) as item()* {...})/text(), function($n_263 as xs:integer,$s_264 as node()*,$f_265 as function(*)) as item()* {...}(1, ((: node()*, true :) $gtdgood_83)/*[let $name_335 := local-name() return (translate($name_335, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], function($n_263 as xs:integer,$s_264 as node()*,$f_265 as function(*)) as item()* {...})/text(), function($n_283 as xs:integer,$s_284 as node()*,$f_285 as function(*)) as item()* {...}(1, ((: node()*, true :) $gtdgood_83)/*[let $name_336 := local-name() return (translate($name_336, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], function($n_283 as xs:integer,$s_284 as node()*,$f_285 as function(*)) as item()* {...})/text()), " "), """", "\\"""), """")) } return $node_307), "art":((: node(), true :) let $node_309 := text { (concat("""", replace(string-join($good_74/*[let $name_327 := local-name() return (translate($name_327, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_articul")]/text(), " "), """", "\\"""), """")) } return $node_309), "kolvo":((: node(), true :) let $node_311 := text { (concat("""", replace(string-join($good_74/*[let $name_328 := local-name() return (translate($name_328, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_qunt")]/text(), " "), """", "\\"""), """")) } return $node_311), "edizm":((: node(), true :) let $node_313 := text { (concat("""", replace(string-join($good_74/*[let $name_329 := local-name() return (translate($name_329, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_31_text")]/text(), " "), """", "\\"""), """")) } return $node_313), "cost":((: node(), true :) let $node_315 := text { (concat("""", format-number(sum($good_74/*[let $name_330 := local-name() return (translate($name_330, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_42_zasum")]/text()), "0.00"), """")) } return $node_315), "netto":((: node(), true :) let $node_318 := text { (concat("""", format-number(sum($good_74/*[let $name_331 := local-name() return (translate($name_331, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_38_1")]/text()), concat("0.", string-join(for $i_319 in (1 to 3) return "0"))), """")) } return $node_318), "brutto":((: node(), true :) let $node_322 := text { (concat("""", format-number(sum($good_74/*[let $name_332 := local-name() return (translate($name_332, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "g_35_1")]/text()), concat("0.", string-join(for $i_323 in (1 to 3) return "0"))), """")) } return $node_322), "login":((: node(), true :) let $node_326 := text { (concat("""", replace(string-join(distinct-values($login_60), ", "), """", "\\"""), """")) } return $node_326), "count":$count_53 } else let $goods_85 := if($xml_58/descendant::*[let $name_337 := local-name() return (translate($name_337, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")]) then $xml_58/descendant::*[let $name_339 := local-name() return (translate($name_339, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadoutgoods")] else if($xml_58/descendant::*[let $name_341 := local-name() return (translate($name_341, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")]) then $xml_58/descendant::*[let $name_343 := local-name() return (translate($name_343, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "esadout_cugoods")] else () for $i_86 in (1 to count($goods_85)) let $good_87 := util:item-at($goods_85, $i_86) let $ntov_88 := ((: node()*, true :) $good_87)/descendant::*[let $name_362 := local-name() return (translate($name_362, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsnumeric")]/text() let $cost_89 := ((: node()*, true :) $good_87)/descendant::*[let $name_382 := local-name() return (translate($name_382, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "invoicedcost")]/text() let $netto_90 := ((: node()*, true :) $good_87)/descendant::*[let $name_402 := local-name() return (translate($name_402, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "netweightquantity")]/text() let $brutto_91 := ((: node()*, true :) $good_87)/descendant::*[let $name_422 := local-name() return (translate($name_422, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "grossweightquantity")]/text() let $pref_92 := concat(function($n_429 as xs:integer,$s_430 as node()*,$f_431 as function(*)) as item()* {...}(1, ((: node()*, true :) $good_87)/*[let $name_444 := local-name() return (translate($name_444, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], function($n_429 as xs:integer,$s_430 as node()*,$f_431 as function(*)) as item()* {...})/text(), function($n_449 as xs:integer,$s_450 as node()*,$f_451 as function(*)) as item()* {...}(1, ((: node()*, true :) $good_87)/*[let $name_464 := local-name() return (translate($name_464, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], function($n_449 as xs:integer,$s_450 as node()*,$f_451 as function(*)) as item()* {...})/text(), function($n_469 as xs:integer,$s_470 as node()*,$f_471 as function(*)) as item()* {...}(1, ((: node()*, true :) $good_87)/*[let $name_484 := local-name() return (translate($name_484, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], function($n_469 as xs:integer,$s_470 as node()*,$f_471 as function(*)) as item()* {...})/text(), function($n_489 as xs:integer,$s_490 as node()*,$f_491 as function(*)) as item()* {...}(1, ((: node()*, true :) $good_87)/*[let $name_504 := local-name() return (translate($name_504, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "preferencii")], function($n_489 as xs:integer,$s_490 as node()*,$f_491 as function(*)) as item()* {...})/text()) let $tovgs_93 := ((: node()*, true :) $good_87)/descendant::*[let $name_522 := local-name() return (translate($name_522, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsgroupdescription")] for $j_94 in (1 to count($tovgs_93)) let $tovg_95 := util:item-at($tovgs_93, $j_94) let $cost_97 := if(1.0 < $j_94) then 0 else $cost_89 let $netto_98 := if(1.0 < $j_94) then 0 else $netto_90 let $brutto_99 := if(1.0 < $j_94) then 0 else $brutto_91 let $row_102 := map { "ngtd":((: node(), true :) let $node_587 := text { (concat("""", replace(string-join(distinct-values($ngtd_62), ", "), """", "\\"""), """")) } return $node_587), "otpr":((: node(), true :) let $node_589 := text { (concat("""", replace(string-join($consignor_68, " "), """", "\\"""), """")) } return $node_589), "ntov":((: node(), true :) let $node_591 := text { (concat("""", replace(string-join($ntov_88, " "), """", "\\"""), """")) } return $node_591), "pref":((: node(), true :) let $node_593 := text { (concat("""", replace(string-join($pref_92, " "), """", "\\"""), """")) } return $node_593), "art":((: node(), true :) let $node_595 := text { (concat("""", replace(string-join($tovg_95/descendant::*[let $name_613 := local-name() return (translate($name_613, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsmarking")]/text(), " "), """", "\\"""), """")) } return $node_595), "kolvo":((: node(), true :) let $node_597 := text { (concat("""", replace(string-join($tovg_95/descendant::*[let $name_614 := local-name() return (translate($name_614, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "goodsquantity")]/text(), " "), """", "\\"""), """")) } return $node_597), "edizm":((: node(), true :) let $node_599 := text { (concat("""", replace(string-join($tovg_95/descendant::*[let $name_615 := local-name() return (translate($name_615, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "measureunitqualifiername")]/text(), " "), """", "\\"""), """")) } return $node_599), "cost":if(($cost_97 > 0)) then ((: node(), true :) let $node_601 := text { (concat("""", format-number(sum($cost_97), "0.00"), """")) } return $node_601) else "", "netto":if(($netto_98 > 0)) then ((: node(), true :) let $node_604 := text { (concat("""", format-number(sum($netto_98), concat("0.", string-join(for $i_605 in (1 to 3) return "0"))), """")) } return $node_604) else "", "brutto":if(($brutto_99 > 0)) then ((: node(), true :) let $node_608 := text { (concat("""", format-number(sum($brutto_99), concat("0.", string-join(for $i_609 in (1 to 3) return "0"))), """")) } return $node_608) else "", "login":((: node(), true :) let $node_612 := text { (concat("""", replace(string-join(distinct-values($login_60), ", "), """", "\\"""), """")) } return $node_612), "count":$count_53 } return $row_102 return $ret_70 ������: import module namespace com = "common" at "c:/WebServers/home/er.issa.pro/www/modules/reports/common.xqy"; import module namespace esadout = "esadout" at "c:/WebServers/home/er.issa.pro/www/modules/reports/esadout.xqy"; let $envs := for $doc in db:open('sirukov')/docs/doc[REGNUM/text()!='' and envelopeid/text()!=''] return $doc/envelopeid/text() let $invenvs := for $doc in db:open('sirukov')/docs/doc[REGNUM/text()!='' and envelopeid/text()!='' and PARENT_ID/text()!=''] return $doc/PARENT_ID/text() let $count:=count($envs) let $docs:=(for $qxml in (db:open('000999')) where $qxml/*:Envelope/*:Header/*:RoutingInf/*:EnvelopeID/text() = $envs return $qxml) let $invdocs:=(for $qxml in (db:open('000999')) where $qxml/*:Envelope/*:Header/*:RoutingInf/*:EnvelopeID/text() = $invenvs return $qxml) for $xml in ($docs) let $doc := db:open('sirukov')/docs/doc[REGNUM/text()!='' and envelopeid/text()=$xml/*:Envelope/*:Header/*:RoutingInf/*:EnvelopeID/text()], $login := $doc/login/text(), $pid := $doc/ProccessID/text(), $ngtd := $doc/REGNUM/text(), $gtdpost := fn:substring($ngtd,1,8), $gtddate := fn:substring($ngtd,10,6), $gtddate := xs:date("20" || fn:substring($gtddate,5,2) || "-" || fn:substring($gtddate,3,2) || "-" || fn:substring($gtddate,1,2)), $gtdnum := fn:substring($ngtd,17,7), $consignor := if (exists(com:findpath($xml,'esadout_cugoodsshipment/esadout_cuconsignor/organizationname'))) then ( com:findpath($xml,'esadout_cugoodsshipment/esadout_cuconsignor/organizationname') ) else if (exists(com:findpath($xml,'esadoutgoodsshipment/esadoutconsignor/organizationname'))) then ( com:findpath($xml,'esadoutgoodsshipment/esadoutconsignor/organizationname') ) else ( () ), $consignor := $consignor/text() order by $gtdpost, $gtddate, $gtdnum let $binv := $doc/PARENT_ID/text() let $ret := if ($binv!='') then ( for $invxml in ($invdocs) where $invxml/*:Envelope/*:Header/*:RoutingInf/*:EnvelopeID/text() = $binv let $goods := $invxml//./*[com:findnode(local-name(),'block')] for $i in 1 to count($goods) let $good := $goods[$i] let $ntov := if (exists($good/*[com:findnode(local-name(),'G_32_TOVNUM')])) then ( $good/*[com:findnode(local-name(),'G_32_TOVNUM')]/text() ) else ( $good/*[com:findnode(local-name(),'G_32_NUM')]/text() ), $art := $good/*[com:findnode(local-name(),'G_31_ARTICUL')]/text(), $kolvo := $good/*[com:findnode(local-name(),'G_31_QUNT')]/text(), $edizm := $good/*[com:findnode(local-name(),'G_31_TEXT')]/text(), $cost := $good/*[com:findnode(local-name(),'G_42_ZASUM')]/text(), $netto := $good/*[com:findnode(local-name(),'G_38_1')]/text(), $brutto := $good/*[com:findnode(local-name(),'G_35_1')]/text() let $gtdgood := if (exists($xml//./*[com:findnode(local-name(),'esadoutgoods')])) then ( $xml//./*[com:findnode(local-name(),'esadoutgoods')] ) else if (exists($xml//./*[com:findnode(local-name(),'esadout_cugoods')])) then ( $xml//./*[com:findnode(local-name(),'esadout_cugoods')] ) else ( () ) let $gtdgood := $gtdgood[*:GoodsNumeric/text()=$ntov] let $pref := com:findpath($gtdgood,'Preferencii/CustomsTax')/text() || com:findpath($gtdgood,'Preferencii/CustomsDuty')/text() || com:findpath($gtdgood,'Preferencii/Excise')/text() || com:findpath($gtdgood,'Preferencii/Rate')/text() return map { 'ngtd': com:utext($ngtd, ", "), 'otpr': com:text($consignor), 'ntov': com:text($ntov), 'pref': com:text($pref), 'art': com:text($art), 'kolvo': com:text($kolvo), 'edizm': com:text($edizm), 'cost': com:sum($cost), 'netto': com:sum($netto,3), 'brutto': com:sum($brutto,3), 'login': com:utext($login, ", "), 'count': $count } ) else ( let $goods := if (exists($xml//./*[com:findnode(local-name(),'esadoutgoods')])) then ( $xml//./*[com:findnode(local-name(),'esadoutgoods')] ) else if (exists($xml//./*[com:findnode(local-name(),'esadout_cugoods')])) then ( $xml//./*[com:findnode(local-name(),'esadout_cugoods')] ) else ( () ) for $i in 1 to count($goods) let $good := $goods[$i], $ntov := com:findpath($good,'GoodsNumeric')/text(), $cost := com:findpath($good,'InvoicedCost')/text(), $netto := com:findpath($good,'NetWeightQuantity')/text(), $brutto := com:findpath($good,'GrossWeightQuantity')/text(), $pref := com:findpath($good,'Preferencii/CustomsTax')/text() || com:findpath($good,'Preferencii/CustomsDuty')/text() || com:findpath($good,'Preferencii/Excise')/text() || com:findpath($good,'Preferencii/Rate')/text() let $tovgs := com:findpath($good,'GoodsGroupDescription') for $j in 1 to count($tovgs) let $tovg := $tovgs[$j], $art := com:findpath($tovg,'GoodsMarking')/text(), $cost := if ($j>1) then ( 0 ) else ( $cost ), $netto := if ($j>1) then ( 0 ) else ( $netto ), $brutto := if ($j>1) then ( 0 ) else ( $brutto ), $kolvo := com:findpath($tovg,'GoodsQuantity')/text(), $edizm := com:findpath($tovg,'MeasureUnitQualifierName')/text() let $row := map { 'ngtd': com:utext($ngtd, ", "), 'otpr': com:text($consignor), 'ntov': com:text($ntov), 'pref': com:text($pref), 'art': com:text($art), 'kolvo': com:text($kolvo), 'edizm': com:text($edizm), 'cost': if ($cost>0) then ( com:sum($cost) ) else ( '' ), 'netto': if ($netto>0) then ( com:sum($netto,3) ) else ( '' ), 'brutto': if ($brutto>0) then ( com:sum($brutto,3) ) else ( '' ), 'login': com:utext($login, ", "), 'count': $count } return $row ) return $ret ���������: - ���������: 815 Items - ���������: 0 Items - ��������: 213 kB - ���������� �� ������: 000999,sirukov - ���������� �� ������: (none) ��������: - �������: 8.75 ms - ����������: 39.9 ms - ���������: 2458.84 ms - ����� �� �����: 12.49 ms - �������� �����: 2519.98 ms ���� �������: