Runmyprocess - freemarker and xpath

36 views
Skip to first unread message

somesh.m...@gmail.com

unread,
Apr 24, 2013, 12:14:58 PM4/24/13
to runmyp...@googlegroups.com
Hi

I am trying to use a xpath expression in freemarker code to grab a particular node element. For example:

My input contains multiple address information out of which only a single address is primary (indicated by the IsPrinary flag as highlighted below):

<v2:Addresses>

              <v21:Address xmlns:v21="http://xmlns.xxxx.org/Internal/BOD/Common/CoreComponents/V2">

                 <v21:Id>1-126-4112</v21:Id>

                 <v21:IntegrationId/>

                 <v21:ContactAddressId>xxx</v21:ContactAddressId>

                 <v21:LineOne>xxxxx xxxx</v21:LineOne>

                 <v21:LineTwo/>

                 <v21:LineThree/>

                 <v21:CityName>Smyrna</v21:CityName>

                 <v21:State>

                    <v21:Code>GA</v21:Code>

                    <v21:Description>Georgia</v21:Description>

                 </v21:State>

                 <v21:Province>

                    <v21:Code/>

                    <v21:Description/>

                 </v21:Province>

                 <v21:CountyName>Cobb</v21:CountyName>

                 <v21:Country>

                    <v21:Code>US</v21:Code>

                    <v21:Description>USA</v21:Description>

                 </v21:Country>

                 <v21:PostalCode>xxxx-4006</v21:PostalCode>

                 <v21:ShippingLabelName>XXXX  XXX</v21:ShippingLabelName>

                 <v21:OrganizationName/>

                 <v21:IsInMemDirectory>false</v21:IsInMemDirectory>

                 <v21:IsPrimary>true</v21:IsPrimary>

              </v21:Address>

              <v21:Address xmlns:v21="http://xmlns.ieee.org/Internal/BOD/Common/CoreComponents/V2">

                 <v21:Id>AAAAA</v21:Id>

                 <v21:IntegrationId/>

                 <v21:ContactAddressId>AAAA</v21:ContactAddressId>

                 <v21:LineOne>AAAA Rd SE</v21:LineOne>

                 <v21:LineTwo/>

                 <v21:LineThree/>

                 <v21:CityName>Smyrna</v21:CityName>

                 <v21:State>

                    <v21:Code>GA</v21:Code>

                    <v21:Description>Georgia</v21:Description>

                 </v21:State>

                 <v21:Province>

                    <v21:Code/>

                    <v21:Description/>

                 </v21:Province>

                 <v21:CountyName>Cobb</v21:CountyName>

                 <v21:Country>

                    <v21:Code>US</v21:Code>

                    <v21:Description>USA</v21:Description>

                 </v21:Country>

                 <v21:PostalCode>AAAA-1041</v21:PostalCode>

                 <v21:AddressType>

                    <v21:Code>Work</v21:Code>

                    <v21:Description>Work</v21:Description>

                 </v21:AddressType>

                 <v21:ShippingLabelName>AAAA AA</v21:ShippingLabelName>

                 <v21:OrganizationName>Ga Tech Res. Inst Atasl</v21:OrganizationName>

                 <v21:IsInMemDirectory>false</v21:IsInMemDirectory>

                 <v21:IsPrimary>false</v21:IsPrimary>

              </v21:Address>

</v2:Addresses>


My freemarker code with the xpath to read LineOne of the Primary Address from above is as follows:

<#assign looked_up_addr_line_one=Addresses.Address["IsPrimary='true'"].LineOne>

This seems to be not working. I know I can build a freemarker list and iterate through it to find the required info, but trying to understand the capability of the platform and the option of using XPATH expressions within freemarker if RMP supports it at all.

Thanks in advance!
Reply all
Reply to author
Forward
0 new messages