Convert Name/Value Pair
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Convert Name/Value Pair




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Convert Name/Value Pair  
Rich Wallace


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 10: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







[ Post a follow-up to this message ]



    Re: Convert Name/Value Pair  
Rich Wallace


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-22-05 01:48 AM

**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
>







[ Post a follow-up to this message ]



    Re: Convert Name/Value Pair  
Rich Wallace


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-22-05 01:48 AM

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... 
>
>







[ Post a follow-up to this message ]



    Re: Convert Name/Value Pair  
Tomas Restrepo \(MVP\)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-22-05 01:48 AM

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/







[ Post a follow-up to this message ]



    Re: Convert Name/Value Pair  
Rich Wallace


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 01:58 AM

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/
>







[ Post a follow-up to this message ]



    Re: Convert Name/Value Pair  
WenJun Zhang[msft]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 07: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.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:40 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register