1

I have a message (MsgPortConfig):

<NewTable>
  <InternalID>1</InternalID> 
  <InterfaceId>INT079</InterfaceId> 
  <PortName>PortArchiveNewStartersDestination</PortName> 
  <Type>FILE</Type> 
  <Address>file://c:\test\out\archive\destination\NewStarters%MessageID%.txt</Address> 
</NewTable>

When I try to access a value via xpath using the following it always returns null.

VarXPath = "/*[local-name()='NewTable']/*[local-name()='Address']/text()";
VarDynamicPortFilePath = xpath(MsgPortConfig, VarXPath);

I don't know how else I can do this, checking the syntax with an application like XPathBuilder works fine but not in BizTalk. what am I missing? thanks.

Nigel B
  • 3,577
  • 3
  • 34
  • 52
  • 3
    It could be the same as this problem: http://www.wadewegner.com/2007/04/biztalk-2006-xpath-expression-gotcha/ – toniedzwiedz May 28 '12 at 09:13
  • That was absolutely it Tom, thanks, I've been going round & round in circles with that one. – Nigel B May 28 '12 at 09:58
  • Is there some explaination as to why this works? I noticed, for example, this isn't needed when assigning values to the message (MsgPortConfig); only when extracting values out of it. – Jeyenne Oct 04 '13 at 20:25

1 Answers1

3

Use:

VarXPath = "string(/*[local-name()='NewTable' and namespace-uri()='']/*[local-name()='Address' and namespace-uri()=''])";
tom redfern
  • 30,562
  • 14
  • 91
  • 126