This project has moved. For the latest updates, please go here.

XPath usage to construct a string

Mar 23, 2015 at 1:12 PM
Hi,
I am trying to use XPath for constructing file name on Send side at Pre-Assemble stage.
I am using GetXPathResult from HelperMetaInstructions BRE library.

Xpath looks like this /[local-name()='ICustomers']/@[local-name()='Id']

but it's returning no value in Pipeline.. any ideas? (i am using execute policy)
Coordinator
Mar 24, 2015 at 12:31 AM
Hi Secrets,

Can you provide the example XML document please?

Cheers
Johann



Mar 25, 2015 at 2:27 PM
Edited Mar 25, 2015 at 2:27 PM
<?xml version="1.0"?>
<Customers xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="be39e39a-89d4-41e7-b3ac-0df5feaabebc" LoadType="Full" GeneratedOn="2015-03-16T12:50:37.7365133+02:00" OwnerCountry="NP" xmlns="http://internal.Country.Customer/v2">
<Customer xmlns="">
<CustomerId>10001</CustomerId>
<Active>1</Active>
<Blocked>0</Blocked>
<Name>CGI Suomi Oy</Name>
<Name2 />
<TaxNumber>46464</TaxNumber>
<CurrencyId>EUR</CurrencyId>
<PayVAT>1</PayVAT>
<PayShipping>1</PayShipping>
<PayCreditCard>0</PayCreditCard>
<CreditBlock>1</CreditBlock>
<CustomerGroup>WM</CustomerGroup>
<BusinessPhone />
<SalesManager Type="Email">
  <Id>Jukka.Haikonen@test.com</Id>
</SalesManager>
<Fax />
<Email />
<LastUpdate>2014-12-30T00:00:00</LastUpdate>
<ParentCustomer />
<Address>
  <Name1>CGI Suomi Oy</Name1>
  <Name2 />
  <Street1>Valimotie 15a</Street1>
  <Street2 />
  <City>SINI</City>
  <PostalCode>00380</PostalCode>
  <Region />
  <PoBox />
  <PoBoxPostalCode />
  <Country>NP</Country>
</Address>
<BillingParty>
  <CustomerId>999914315</CustomerId>
  <Id>L14315</Id>
  <Name1>Logica Suomi Oy</Name1>
  <Name2 />
  <Street1>PL 64</Street1>
  <Street2 />
  <City>SINI</City>
  <PostalCode>00521</PostalCode>
  <Region />
  <Attention />
  <AddressName>marja-leena.suomela@test.com</AddressName>
  <PoBox>PL 64</PoBox>
  <PoBoxPostalCode>00521</PoBoxPostalCode>
  <Country>NP</Country>
</BillingParty>    
<Default>999923797</Default>
</Customer>
</Customers>
Coordinator
Apr 21, 2015 at 4:03 AM
Hi Secrets,

Sorry for the delay. It looks like this is a know issue #1841 - https://brepipelineframework.codeplex.com/workitem/1841

Seems the problem is in the XPathReader class that I use under the hood (or in the way I've used it). Sorry but I won't get a chance to investigate further until May, but will try to look into this then. Until then you would have to use Regex or similar to get the value you're after.

Cheers
Johann