|
Home > Archive > BizTalk Server General > November 2004 > Promoting optional fields
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Promoting optional fields
|
|
| Claudio Sale 2004-11-09, 5:49 pm |
| I have promoted as distinguished field an attribute of my xsd that is
optional (not required).
If I use the expression myMessage.myDistinguishedField, I have an error if
the optional field doesn't exist in the xml document.
How can I check if the field exists before using the distinguished field?
Thanks
Claudio
| |
| Stephen W. Thomas 2004-11-09, 5:49 pm |
| I do not know how to check the value before hard.
But, as an alternative you could do direct XPath inside an expression shape
to get the value. This way, if it is not in the message you do not get an
error. The XPath would look like this:
sYourString = xpath(InMessage,"string(//*[local-name()='NodeName'])");
Stephen W. Thomas
http://www.geekswithblogs.net/sthomas
"Claudio Sale" wrote:
> I have promoted as distinguished field an attribute of my xsd that is
> optional (not required).
> If I use the expression myMessage.myDistinguishedField, I have an error if
> the optional field doesn't exist in the xml document.
> How can I check if the field exists before using the distinguished field?
>
> Thanks
> Claudio
| |
| Claudio Sale 2004-11-10, 2:47 am |
| Thank you Stephen, I will try this way.
Best regards
Claudio
"Stephen W. Thomas" wrote:
[vbcol=seagreen]
> I do not know how to check the value before hard.
>
> But, as an alternative you could do direct XPath inside an expression shape
> to get the value. This way, if it is not in the message you do not get an
> error. The XPath would look like this:
>
> sYourString = xpath(InMessage,"string(//*[local-name()='NodeName'])");
>
> Stephen W. Thomas
> http://www.geekswithblogs.net/sthomas
>
>
>
> "Claudio Sale" wrote:
>
|
|
|
|
|