The problem is with three Empty-Null cases.
Is it possible to separate all these cases in Expression shapes of the Orchestration?
For example, we have the record with <name> element, in such flawors:

case: “NonEmpty”

<ns0:People>
<
ns0:Name>Name_0</ns0:Name>
<
ns0:IsDependent>IsDependent_0</ns0:IsDependent>
..

case: “Empty”

<ns0:People>
<
ns0:Name></ns0:Name>
<
ns0:IsDependent>IsDependent_0</ns0:IsDependent>
..

case: “OneTag”

<ns0:People>
<
ns0:Name/>
<
ns0:IsDependent>IsDependent_0</ns0:IsDependent>
..

case: “Null”

<ns0:People>
<!– NO NODE: <ns0:Name>Name_0</ns0:Name>–>
<ns0:IsDependent>IsDependent_0</ns0:IsDependent>
..

Is it possible to separate all these cases in Expression shapes of the Orchestration?

There is no informationinto theMSDN about this [http://msdn.microsoft.com/en-us/library/aa561906(BTS.10).aspx]

I tried to use the xpath() function in two variants, one with “string(xpath_expression)” second with “xpath_expression”

Expression Shape:
[
System.Diagnostics.Trace.WriteLine(“======================================================================”);
System.Diagnostics.Trace.WriteLine(“[” + System.Convert.ToString(xpath (msg_SourceRoot, “string(/*[local-name()=’Root’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’People’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’Name’ and namespace-uri()=’http://MapTest.IncPerson’])”)) + “]”);

if ( xpath (msg_SourceRoot, “string(/*[local-name()=’Root’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’People’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’Name’ and namespace-uri()=’http://MapTest.IncPerson’])”) == null)
{ System.Diagnostics.Trace.WriteLine(“Name == null”); }

else if ( xpath (msg_SourceRoot, “string(/*[local-name()=’Root’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’People’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’Name’ and namespace-uri()=’http://MapTest.IncPerson’])”) == “”)
{ System.Diagnostics.Trace.WriteLine(“Name == Empty”);}

else
{ System.Diagnostics.Trace.WriteLine(“Name != null && Name != Empty”); }
System.Diagnostics.Trace.WriteLine(“———————————————————————-“);
System.Diagnostics.Trace.WriteLine(“[” + System.Convert.ToString(xpath (msg_SourceRoot, “/*[local-name()=’Root’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’People’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’Name’ and namespace-uri()=’http://MapTest.IncPerson’]”)) + “]”);

if ( xpath (msg_SourceRoot, “/*[local-name()=’Root’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’People’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’Name’ and namespace-uri()=’http://MapTest.IncPerson’]”) == null)
{ System.Diagnostics.Trace.WriteLine(“Name == null”); }

else if ( xpath (msg_SourceRoot, “/*[local-name()=’Root’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’People’ and namespace-uri()=’http://MapTest.IncPerson’]/*[local-name()=’Name’ and namespace-uri()=’http://MapTest.IncPerson’]”) == “”)
{ System.Diagnostics.Trace.WriteLine(“Name == Empty”); }
else
{ System.Diagnostics.Trace.WriteLine(“Name != null && Name != Empty”);}
]

I.e. in thefirs section used the “string(xpath_expression)” expression, in thesecond used the”xpath_expression”

Result is:

“NonEmpty” ======================================================================
[Name_0]
Name != null && Name != Empty
———————————————————————-
[Microsoft.XLANGs.Core.Part+ArrayBasedXmlNodeList]
Name != null && Name != Empty

“Empty”======================================================================
[]
Name == Empty
———————————————————————-
[Microsoft.XLANGs.Core.Part+ArrayBasedXmlNodeList]
Name != null && Name != Empty

“OneTag”======================================================================
[]
Name == Empty
———————————————————————-
[Microsoft.XLANGs.Core.Part+ArrayBasedXmlNodeList]
Name != null && Name != Empty

“Null”======================================================================
[]
Name == Empty
———————————————————————-
[]
Name == null

Conclusion:
* I cannot separate the cases “Empty” and “OneTag”
* I can separate the cases “Empty and “Null” with “xpath_expression”, not with “string(xpath_expression)” expression
* “Null” case does not throw an exception.