xpath - How to find the last element -
i trying find imd in last line element in edifact file, using xpath in biztalk - orchestration. xpath:
lastlinename = xpath(message_2,"/*[local-name()='efact_d96a_invoic' , namespace-uri()='http://schemas.microsoft.com/biztalk/edi/edifact/2006']/*[local-name()='linloop1' , namespace-uri()='http://schemas.microsoft.com/biztalk/edi/edifact/2006']/*[local-name()='imd_2' , namespace-uri()='http://schemas.microsoft.com/biztalk/edi/edifact/2006']/*[local-name()='c273_2' , namespace-uri()='http://schemas.microsoft.com/biztalk/edi/edifact/2006']/*[local-name()='c27304' , namespace-uri()='']last()");
and edifat-file:
unb+unob:1+bts-sender:zzz+receive-partner:zzz+130418:1513+19++++0++0' unh+19+invoic:d:01b:un:ean010' bgm+380+353795+9' dtm+171:2013-04-18' lin+1++8886419315339:vn' imd+++:::razer sphex - full retai' qty+47:10' pri+aaa:89' lin+3++8886419330028:vn' imd+++:::razer deathadder respawn' qty+47:10' pri+aaa:347' lin+4++8886419330127:vn' imd+++:::razer abyssus gaming mou' qty+47:1' pri+aaa:242,6' lin+5++8886419330660:vn' imd+++:::razer imperator 2012 exp' qty+47:2' pri+aaa:447,5' lin+6++8886419311454:vn' imd+++:::razer lycosa gaming keyb' qty+47:2' pri+aaa:511,5' lin+7++8886419311614:vn' imd+++:::razer arctosa silver key' qty+47:2' pri+aaa:312' lin+10++8886419340317:vn' imd+++:::anansi (mmo keyboard)' qty+47:1' pri+aaa:639' lin+11++8886419330509:vn' imd+++:::razer naga - molten edit' qty+47:2' pri+aaa:479,5' lin+12++8886419330981:vn' imd+++:::razer naga hex moba/ act' qty+47:1' pri+aaa:479,5' lin+13++8886419312277:vn' imd+++:::razer carcharias gaming' qty+47:2' pri+aaa:479,5' lin+14++8886419312628:vn' imd+++:::razer electra headset' qty+47:4' pri+aaa:383,5' uns+s' moa+139:790' unt+50+19' unz+1+19'
it returns:
has invalid token
at end, have
last()
positional indexers must enclosed in square brackets.
so make it:
[last()]
Comments
Post a Comment