BizTalk Server Orchestration - Convert Name/Value Pair

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > September 2005 > Convert Name/Value Pair





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 Convert Name/Value Pair
Rich Wallace

2005-09-21, 5:52 pm

I've been trying to get this done with the Value Mapping (Flattening)
functiod within a map, but just can't seem to get it hammered out.

I have an incoming message:
....
<Order>
<Header>
<Details Name="FieldName1" Value="FieldValue1" />
<Details Name="FieldName2" Value="FieldValue2" />
...
</Header>
</Order>

I need to get this converted to:

<Order>
<Header>
<FieldName1>FieldValue1</FieldName1>
<FieldName2>FieldValue2</FieldName2>
</Header>
</Order>

Any ideas?
TIA

-Rich


Rich Wallace

2005-09-21, 8:48 pm

**OR**

Can I successfully use the name-value pair within an Orchestration and pul
values as though they are Distinguished fields?

In the original example:

<Order>
<Header>
<Details Name="FieldName1" Value="FieldValue1" />
<Details Name="FieldName2" Value="FieldValue2" />
....

Can I use the XML within an Orchestration to pick out the "FieldValue2" when
the Name value = 'FieldName1'?


"Rich Wallace" <nobody@nowhere.com> wrote in message
news:uVJnatvvFHA.2960@tk2msftngp13.phx.gbl...
> I've been trying to get this done with the Value Mapping (Flattening)
> functiod within a map, but just can't seem to get it hammered out.
>
> I have an incoming message:
> ...
> <Order>
> <Header>
> <Details Name="FieldName1" Value="FieldValue1" />
> <Details Name="FieldName2" Value="FieldValue2" />
> ...
> </Header>
> </Order>
>
> I need to get this converted to:
>
> <Order>
> <Header>
> <FieldName1>FieldValue1</FieldName1>
> <FieldName2>FieldValue2</FieldName2>
> </Header>
> </Order>
>
> Any ideas?
> TIA
>
> -Rich
>



Rich Wallace

2005-09-21, 8:48 pm

Sorry, I meant...

Can I use the XML within an Orchestration to pick out the "FieldValue2" when
the Name value = 'FieldName2'?

"Rich Wallace" <nobody@nowhere.com> wrote in message
news:%23dEJxCwvFHA.3400@TK2MSFTNGP14.phx.gbl...
> **OR**
>
> Can I successfully use the name-value pair within an Orchestration and pul
> values as though they are Distinguished fields?
>
> In the original example:
>
> <Order>
> <Header>
> <Details Name="FieldName1" Value="FieldValue1" />
> <Details Name="FieldName2" Value="FieldValue2" />
> ...
>
> Can I use the XML within an Orchestration to pick out the "FieldValue2"
> when the Name value = 'FieldName1'?
>
>
> "Rich Wallace" <nobody@nowhere.com> wrote in message
> news:uVJnatvvFHA.2960@tk2msftngp13.phx.gbl...
>
>



Tomas Restrepo \(MVP\)

2005-09-21, 8:48 pm

Rich,

>
> Can I use the XML within an Orchestration to pick out the "FieldValue2"
> when
> the Name value = 'FieldName2'?


You should be able to use the xpath() function in an expression shape to get
to it. Something along the lines of (untested):

fieldValue =
xpath("string(/Order/Header/Details[@Name='FieldName2']/@Value)");

or something like that. If you have namespaces you'll have to do a lot more
work, but I think you can see the essence


--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/


Rich Wallace

2005-09-22, 8:58 pm

I was afraid of that...

Thank you!

"Tomas Restrepo (MVP)" <tomasr@mvps.org> wrote in message
news:eE64btwvFHA.3860@TK2MSFTNGP09.phx.gbl...
> Rich,
>
>
> You should be able to use the xpath() function in an expression shape to
> get to it. Something along the lines of (untested):
>
> fieldValue =
> xpath("string(/Order/Header/Details[@Name='FieldName2']/@Value)");
>
> or something like that. If you have namespaces you'll have to do a lot
> more work, but I think you can see the essence
>
>
> --
> Tomas Restrepo
> tomasr@mvps.org
> http://www.winterdom.com/
>



WenJun Zhang[msft]

2005-09-23, 2:48 am

Hi Rich,

You can use xpath to retrieve the field name and then create the xml
instance through something like .net XmlDocument object.

However the output XML below doesn't have a certain schema. So even
the instance is generated, it's hard for you to perform further
processing on it with biztalk.

<Order>
<Header>
<FieldName1>FieldValue1</FieldName1>
<FieldName2>FieldValue2</FieldName2>
</Header>
</Order>

Best regards,

WenJun Zhang
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no
rights.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com