BizTalk Server Tools - Mapper - create nodes dynamically

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Tools > January 2006 > Mapper - create nodes dynamically





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 Mapper - create nodes dynamically
christopherkilmer@gmail.com

2005-10-03, 8:48 pm

I'm trying to use the BTS Mapper to

I have the following xml:

<Buyers>
<Buyer>
<BuyerIndex>1</BuyerIndex>
<Name>Super Co</Name>
<Address>555 Cherry Lane</Address>
</Buyer>
<Buyer>
<BuyerIndex>2</BuyerIndex>
<Name>Microsoft</Name>
<Address>1 Microsoft Way</Address>
</Buyer>
</Buyers>

Which needs to be converted to:
<Results>
<Byr1Name1>Super Co</Byr1Name1>
<Byr1Addr1>555 Cherry Lane</Byr1Addr1>
<Byr2Name1>Microsoft</Byr2Name1>
<Byr2Addr1>1 Microsoft Way</Byr2Addr1>
</Results>

You can think of the results schema as looking something like:

<Results>
<Any/> <!-- All nodes below root are created at runtime -->
</Results>

If another buyer is added to the source schema, then new nodes name
<Byr3Name1> and <Byr3Addr1> need to be added.

Because there can be any number of buyers in the source schema, the
destination schema can have any number of <ByrXName1></ByrXName1> and
<ByrXAddr1></ByrXAddr1> nodes. This means that I don't know the
actual names of the nodes in the destination schema until the
transformation takes place.

I'm assuming that an <Any/> node is involved in the destination schema
somehow. However, I don't know how to actually create the new node
using the mapper. Any tips you could provide would be much
appreciated.

Matt Milner

2005-10-04, 7:57 am

I'd try using the scripting functoid with it setup as a template to call.
This should allow you the most flexibility to create the destination
structure. The other option is to just create an XSLT that does what you
want and set the property on the map to use the custom XSLT.

matt


<christopherkilmer@gmail.com> wrote in message
news:1128387531.355971.93160@g14g2000cwa.googlegroups.com...
> I'm trying to use the BTS Mapper to
>
> I have the following xml:
>
> <Buyers>
> <Buyer>
> <BuyerIndex>1</BuyerIndex>
> <Name>Super Co</Name>
> <Address>555 Cherry Lane</Address>
> </Buyer>
> <Buyer>
> <BuyerIndex>2</BuyerIndex>
> <Name>Microsoft</Name>
> <Address>1 Microsoft Way</Address>
> </Buyer>
> </Buyers>
>
> Which needs to be converted to:
> <Results>
> <Byr1Name1>Super Co</Byr1Name1>
> <Byr1Addr1>555 Cherry Lane</Byr1Addr1>
> <Byr2Name1>Microsoft</Byr2Name1>
> <Byr2Addr1>1 Microsoft Way</Byr2Addr1>
> </Results>
>
> You can think of the results schema as looking something like:
>
> <Results>
> <Any/> <!-- All nodes below root are created at runtime -->
> </Results>
>
> If another buyer is added to the source schema, then new nodes name
> <Byr3Name1> and <Byr3Addr1> need to be added.
>
> Because there can be any number of buyers in the source schema, the
> destination schema can have any number of <ByrXName1></ByrXName1> and
> <ByrXAddr1></ByrXAddr1> nodes. This means that I don't know the
> actual names of the nodes in the destination schema until the
> transformation takes place.
>
> I'm assuming that an <Any/> node is involved in the destination schema
> somehow. However, I don't know how to actually create the new node
> using the mapper. Any tips you could provide would be much
> appreciated.
>



Tan Nguyen

2006-01-13, 9:54 pm

The Mapper can't create create nodes at runtime. A way to do it is to use
the scripting functoid and write the XSLT.

Regards,
Tan Nguyen
Microsoft BizTalk Server

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

--------------------
| From: christopherkilmer@gmail.com
| Newsgroups: microsoft.public.biztalk.tools
| Subject: Mapper - create nodes dynamically
| Date: 3 Oct 2005 17:58:51 -0700
| Organization: http://groups.google.com
| Lines: 45
| Message-ID: <1128387531.355971.93160@g14g2000cwa.googlegroups.com>
| NNTP-Posting-Host: 67.183.219.196
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1128387536 1817 127.0.0.1 (4 Oct 2005
00:58:56 GMT)
| X-Complaints-To: groups-abuse@google.com
| NNTP-Posting-Date: Tue, 4 Oct 2005 00:58:56 +0000 (UTC)
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1;
.NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
| Complaints-To: groups-abuse@google.com
| Injection-Info: g14g2000cwa.googlegroups.com; posting-host=67.183.219.196;
| posting-account=uQmIAg0AAACAOWVD-ZoGlU4UmyX4qybq
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
ews.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.biztalk.tools:1000
| X-Tomcat-NG: microsoft.public.biztalk.tools
|
| I'm trying to use the BTS Mapper to
|
| I have the following xml:
|
| <Buyers>
| <Buyer>
| <BuyerIndex>1</BuyerIndex>
| <Name>Super Co</Name>
| <Address>555 Cherry Lane</Address>
| </Buyer>
| <Buyer>
| <BuyerIndex>2</BuyerIndex>
| <Name>Microsoft</Name>
| <Address>1 Microsoft Way</Address>
| </Buyer>
| </Buyers>
|
| Which needs to be converted to:
| <Results>
| <Byr1Name1>Super Co</Byr1Name1>
| <Byr1Addr1>555 Cherry Lane</Byr1Addr1>
| <Byr2Name1>Microsoft</Byr2Name1>
| <Byr2Addr1>1 Microsoft Way</Byr2Addr1>
| </Results>
|
| You can think of the results schema as looking something like:
|
| <Results>
| <Any/> <!-- All nodes below root are created at runtime -->
| </Results>
|
| If another buyer is added to the source schema, then new nodes name
| <Byr3Name1> and <Byr3Addr1> need to be added.
|
| Because there can be any number of buyers in the source schema, the
| destination schema can have any number of <ByrXName1></ByrXName1> and
| <ByrXAddr1></ByrXAddr1> nodes. This means that I don't know the
| actual names of the nodes in the destination schema until the
| transformation takes place.
|
| I'm assuming that an <Any/> node is involved in the destination schema
| somehow. However, I don't know how to actually create the new node
| using the mapper. Any tips you could provide would be much
| appreciated.
|
|

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com