BizTalk Server General - Value Mapping to Root Node

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > December 2004 > Value Mapping to Root Node





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 Value Mapping to Root Node
dave v

2004-11-10, 5:48 pm

I have source doc like this:
<ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
<ProdSpec>
<Name>Name</Name>
<Value>Widget</Value>
</ProdSpec>
<ProdSpec>
<Name>Price</Name>
<Value>1000.99</Value>
</ProdSpec>
<ProdSpec>
<Name>Quantity</Name>
<Value>550</Value>
</ProdSpec>
</ns0:Root>

Which I can to map to the following using the Value Mapping (Flattening)
functoids:
<ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
<Order Product="Widget" Price="550" Qty="1000.99" />
</ns0:Root>

However, when my target schema has "Order" as the root node, like:
<ns0:Order Product="Widget" Price="550" Qty="1000.99"
xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />

The map doesn't work as before. The output looks like:
<ns0:Order Product="Widget"
xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />

"Price" and "Quantity" don't map over in this case. In fact, it will always
only map the first <ProdSpec> node. The map is exactly the same as the first,
without the "Root" node.

Does anyone know how to flatten to the root node without using custom XSLT?

Thanks,
Dave
larry franks

2004-11-11, 5:49 pm

I haven't ran into this before Dave, let me give this a try and see what I
can find on it.

Larry Franks

This posting is provided "AS IS" with no warranties,and confers no rights.
Subscribe at
http://support.microsoft.com/defaul...msdn/nospam.asp
&SD=msdn
--------------------
| Thread-Topic: Value Mapping to Root Node
| thread-index: AcTHgLIFw1TC/fW5SX6ArfRYIEEdAQ==
| X-WBNR-Posting-Host: 207.241.20.65
| From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
| Subject: Value Mapping to Root Node
| Date: Wed, 10 Nov 2004 15:55:02 -0800
| Lines: 38
| Message-ID: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.biztalk.general
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21527
| X-Tomcat-NG: microsoft.public.biztalk.general
|
| I have source doc like this:
| <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
| <ProdSpec>
| <Name>Name</Name>
| <Value>Widget</Value>
| </ProdSpec>
| <ProdSpec>
| <Name>Price</Name>
| <Value>1000.99</Value>
| </ProdSpec>
| <ProdSpec>
| <Name>Quantity</Name>
| <Value>550</Value>
| </ProdSpec>
| </ns0:Root>
|
| Which I can to map to the following using the Value Mapping (Flattening)
| functoids:
| <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
| <Order Product="Widget" Price="550" Qty="1000.99" />
| </ns0:Root>
|
| However, when my target schema has "Order" as the root node, like:
| <ns0:Order Product="Widget" Price="550" Qty="1000.99"
| xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
|
| The map doesn't work as before. The output looks like:
| <ns0:Order Product="Widget"
| xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
|
| "Price" and "Quantity" don't map over in this case. In fact, it will
always
| only map the first <ProdSpec> node. The map is exactly the same as the
first,
| without the "Root" node.
|
| Does anyone know how to flatten to the root node without using custom
XSLT?
|
| Thanks,
| Dave
|

larry franks

2004-11-12, 5:48 pm

including sample schemas and map. I tried setting up a simple sample and
am not able to reproduce the problem. Can you take a look at these files
and see if this helps with what you are seeing? If not, would it be
possible to post your project?


Larry Franks

This posting is provided "AS IS" with no warranties,and confers no rights.
Subscribe at
http://support.microsoft.com/defaul...msdn/nospam.asp
&SD=msdn
--------------------
| X-Tomcat-ID: 621827380
| References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: larryfr@online.microsoft.com ("larry franks")
| Organization: Microsoft
| Date: Thu, 11 Nov 2004 22:09:40 GMT
| Subject: RE: Value Mapping to Root Node
| X-Tomcat-NG: microsoft.public.biztalk.general
| Message-ID: <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
| Newsgroups: microsoft.public.biztalk.general
| Lines: 63
| Path: cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21571
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| I haven't ran into this before Dave, let me give this a try and see what
I
| can find on it.
|
| Larry Franks
|
| This posting is provided "AS IS" with no warranties,and confers no
rights.
| Subscribe at
|
http://support.microsoft.com/defaul...msdn/nospam.asp
| &SD=msdn
| --------------------
| | Thread-Topic: Value Mapping to Root Node
| | thread-index: AcTHgLIFw1TC/fW5SX6ArfRYIEEdAQ==
| | X-WBNR-Posting-Host: 207.241.20.65
| | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
| | Subject: Value Mapping to Root Node
| | Date: Wed, 10 Nov 2004 15:55:02 -0800
| | Lines: 38
| | Message-ID: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | Newsgroups: microsoft.public.biztalk.general
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21527
| | X-Tomcat-NG: microsoft.public.biztalk.general
| |
| | I have source doc like this:
| | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
| | <ProdSpec>
| | <Name>Name</Name>
| | <Value>Widget</Value>
| | </ProdSpec>
| | <ProdSpec>
| | <Name>Price</Name>
| | <Value>1000.99</Value>
| | </ProdSpec>
| | <ProdSpec>
| | <Name>Quantity</Name>
| | <Value>550</Value>
| | </ProdSpec>
| | </ns0:Root>
| |
| | Which I can to map to the following using the Value Mapping
(Flattening)
| | functoids:
| | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
| | <Order Product="Widget" Price="550" Qty="1000.99" />
| | </ns0:Root>
| |
| | However, when my target schema has "Order" as the root node, like:
| | <ns0:Order Product="Widget" Price="550" Qty="1000.99"
| | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
| |
| | The map doesn't work as before. The output looks like:
| | <ns0:Order Product="Widget"
| | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
| |
| | "Price" and "Quantity" don't map over in this case. In fact, it will
| always
| | only map the first <ProdSpec> node. The map is exactly the same as the
| first,
| | without the "Root" node.
| |
| | Does anyone know how to flatten to the root node without using custom
| XSLT?
| |
| | Thanks,
| | Dave
| |
|
|
dave v

2004-11-15, 5:49 pm

Larry -

Your last post was cut off somehow. I don't see any links to your sample.
Could you re-post so I can take a look?

Thanks,
Dave

""larry franks"" wrote:

> including sample schemas and map. I tried setting up a simple sample and
> am not able to reproduce the problem. Can you take a look at these files
> and see if this helps with what you are seeing? If not, would it be
> possible to post your project?
>
>
> Larry Franks
>
> This posting is provided "AS IS" with no warranties,and confers no rights.
> Subscribe at
> http://support.microsoft.com/defaul...msdn/nospam.asp
> &SD=msdn
> --------------------
> | X-Tomcat-ID: 621827380
> | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain
> | Content-Transfer-Encoding: 7bit
> | From: larryfr@online.microsoft.com ("larry franks")
> | Organization: Microsoft
> | Date: Thu, 11 Nov 2004 22:09:40 GMT
> | Subject: RE: Value Mapping to Root Node
> | X-Tomcat-NG: microsoft.public.biztalk.general
> | Message-ID: <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
> | Newsgroups: microsoft.public.biztalk.general
> | Lines: 63
> | Path: cpmsftngxa10.phx.gbl
> | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21571
> | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
> |
> | I haven't ran into this before Dave, let me give this a try and see what
> I
> | can find on it.
> |
> | Larry Franks
> |
> | This posting is provided "AS IS" with no warranties,and confers no
> rights.
> | Subscribe at
> |
> http://support.microsoft.com/defaul...msdn/nospam.asp
> | &SD=msdn
> | --------------------
> | | Thread-Topic: Value Mapping to Root Node
> | | thread-index: AcTHgLIFw1TC/fW5SX6ArfRYIEEdAQ==
> | | X-WBNR-Posting-Host: 207.241.20.65
> | | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
> | | Subject: Value Mapping to Root Node
> | | Date: Wed, 10 Nov 2004 15:55:02 -0800
> | | Lines: 38
> | | Message-ID: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> | | MIME-Version: 1.0
> | | Content-Type: text/plain;
> | | charset="Utf-8"
> | | Content-Transfer-Encoding: 7bit
> | | X-Newsreader: Microsoft CDO for Windows 2000
> | | Content-Class: urn:content-classes:message
> | | Importance: normal
> | | Priority: normal
> | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | | Newsgroups: microsoft.public.biztalk.general
> | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21527
> | | X-Tomcat-NG: microsoft.public.biztalk.general
> | |
> | | I have source doc like this:
> | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
> | | <ProdSpec>
> | | <Name>Name</Name>
> | | <Value>Widget</Value>
> | | </ProdSpec>
> | | <ProdSpec>
> | | <Name>Price</Name>
> | | <Value>1000.99</Value>
> | | </ProdSpec>
> | | <ProdSpec>
> | | <Name>Quantity</Name>
> | | <Value>550</Value>
> | | </ProdSpec>
> | | </ns0:Root>
> | |
> | | Which I can to map to the following using the Value Mapping
> (Flattening)
> | | functoids:
> | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
> | | <Order Product="Widget" Price="550" Qty="1000.99" />
> | | </ns0:Root>
> | |
> | | However, when my target schema has "Order" as the root node, like:
> | | <ns0:Order Product="Widget" Price="550" Qty="1000.99"
> | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
> | |
> | | The map doesn't work as before. The output looks like:
> | | <ns0:Order Product="Widget"
> | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
> | |
> | | "Price" and "Quantity" don't map over in this case. In fact, it will
> | always
> | | only map the first <ProdSpec> node. The map is exactly the same as the
> | first,
> | | without the "Root" node.
> | |
> | | Does anyone know how to flatten to the root node without using custom
> | XSLT?
> | |
> | | Thanks,
> | | Dave
> | |
> |
> |

larry franks

2004-11-16, 5:47 pm

Sure, here it is without attachments:
schema1.xsd
=================
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://newsgroup.Schema1"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://newsgroup.Schema1"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" name="ProdSpec">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Name"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Value"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
=================

schema2.xsd
=================
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://newsgroup.Schema2"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://newsgroup.Schema2"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order">
<xs:complexType>
<xs:attribute name="Product" type="xs:string" />
<xs:attribute name="value" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:schema>
=================

map1.btm
=================
<?xml version="1.0" encoding="utf-16"?>
<!-- Generated using BizTalk Mapper on Fri, Nov 12 2004 03:09:37 AM -->
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<mapsource Name="BizTalk Map" BizTalkServerMapperTool_Version="2.0"
Version="2" XRange="100" YRange="420" OmitXmlDeclaration="Yes" CopyPIs="No"
method="xml" xmlVersion="1.0"
IgnoreNamespacesForLinks="Yes"><SrcTree><Reference
Location=".\Schema1.xsd"/></SrcTree><TrgTree><Reference
Location=".\Schema2.xsd"/></TrgTree><ScriptTypePrecedence><CSharp
Enabled="Yes"/><ExternalAssembly Enabled="Yes"/><VbNet
Enabled="Yes"/><JScript Enabled="Yes"/><XsltCallTemplate
Enabled="Yes"/><Xslt
Enabled="Yes"/></ScriptTypePrecedence><TreeValues><TestValues/><ConstantValu
es/></TreeValues><Pages><Page Name="Page 1"><Links><Link LinkID="1"
LinkFrom="1"
LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Order']/@*[local-n
ame()='Product']" Label=""/><Link LinkID="2" LinkFrom="2"
LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Order']/@*[local-n
ame()='value']" Label=""/><Link LinkID="3"
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
ame()='ProdSpec']" LinkTo="3" Label=""/><Link LinkID="4" LinkFrom="3"
LinkTo="1" Label=""/><Link LinkID="5" LinkFrom="3" LinkTo="2"
Label=""/><Link LinkID="6"
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
ame()='ProdSpec']/*[local-name()='Name']" LinkTo="1" Label=""/><Link
LinkID="7"
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
ame()='ProdSpec']/*[local-name()='Value']" LinkTo="2"
Label=""/></Links><Functoids><Functoid FunctoidID="1" X-Cell="54"
Y-Cell="212" Functoid-FID="374" Functoid-Name="Value Mapping (Flattening)"
Label=""><Input-Parameters><Parameter Type="Link" Value="4"
Guid="{DECA6249-C76E-48C6-B934-75F3E9C142F4}"/><Parameter Type="Link"
Value="6"
Guid="{2E4766AB-1220-4089-B476-43624BFB0259}"/></Input-Parameters></Functoid
><Functoid FunctoidID="2" X-Cell="54" Y-Cell="213" Functoid-FID="374"

Functoid-Name="Value Mapping (Flattening)"
Label=""><Input-Parameters><Parameter Type="Link" Value="5"
Guid="{83F62960-3FD2-4820-80F3-E85E34141E1A}"/><Parameter Type="Link"
Value="7"
Guid="{5E5C151A-0347-4102-8AE3-3DC7052238F7}"/></Input-Parameters></Functoid
><Functoid FunctoidID="3" X-Cell="51" Y-Cell="212" Functoid-FID="701"

Functoid-Name="Logical Existence" Label=""><Input-Parameters><Parameter
Type="Link" Value="3"
Guid="{1058FF80-6BEB-4417-94DF-B46FFD69733E}"/></Input-Parameters></Functoid
></Functoids></Page></Pages></mapsource>

=================
Larry Franks

This posting is provided "AS IS" with no warranties,and confers no rights.
Subscribe at
http://support.microsoft.com/defaul...msdn/nospam.asp
&SD=msdn
--------------------
| Thread-Topic: Value Mapping to Root Node
| thread-index: AcTLa98mClve497VSEOElpBdONZqHg==
| X-WBNR-Posting-Host: 207.241.20.65
| From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
| References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
<alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
<$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
| Subject: RE: Value Mapping to Root Node
| Date: Mon, 15 Nov 2004 15:36:03 -0800
| Lines: 121
| Message-ID: <650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.biztalk.general
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21678
| X-Tomcat-NG: microsoft.public.biztalk.general
|
| Larry -
|
| Your last post was cut off somehow. I don't see any links to your sample.
| Could you re-post so I can take a look?
|
| Thanks,
| Dave
|
| ""larry franks"" wrote:
|
| > including sample schemas and map. I tried setting up a simple sample
and
| > am not able to reproduce the problem. Can you take a look at these
files
| > and see if this helps with what you are seeing? If not, would it be
| > possible to post your project?
| >
| >
| > Larry Franks
| >
| > This posting is provided "AS IS" with no warranties,and confers no
rights.
| > Subscribe at
| >
http://support.microsoft.com/defaul...msdn/nospam.asp
| > &SD=msdn
| > --------------------
| > | X-Tomcat-ID: 621827380
| > | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From: larryfr@online.microsoft.com ("larry franks")
| > | Organization: Microsoft
| > | Date: Thu, 11 Nov 2004 22:09:40 GMT
| > | Subject: RE: Value Mapping to Root Node
| > | X-Tomcat-NG: microsoft.public.biztalk.general
| > | Message-ID: <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
| > | Newsgroups: microsoft.public.biztalk.general
| > | Lines: 63
| > | Path: cpmsftngxa10.phx.gbl
| > | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21571
| > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
| > |
| > | I haven't ran into this before Dave, let me give this a try and see
what
| > I
| > | can find on it.
| > |
| > | Larry Franks
| > |
| > | This posting is provided "AS IS" with no warranties,and confers no
| > rights.
| > | Subscribe at
| > |
| >
http://support.microsoft.com/defaul...msdn/nospam.asp
| > | &SD=msdn
| > | --------------------
| > | | Thread-Topic: Value Mapping to Root Node
| > | | thread-index: AcTHgLIFw1TC/fW5SX6ArfRYIEEdAQ==
| > | | X-WBNR-Posting-Host: 207.241.20.65
| > | | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
| > | | Subject: Value Mapping to Root Node
| > | | Date: Wed, 10 Nov 2004 15:55:02 -0800
| > | | Lines: 38
| > | | Message-ID: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| > | | MIME-Version: 1.0
| > | | Content-Type: text/plain;
| > | | charset="Utf-8"
| > | | Content-Transfer-Encoding: 7bit
| > | | X-Newsreader: Microsoft CDO for Windows 2000
| > | | Content-Class: urn:content-classes:message
| > | | Importance: normal
| > | | Priority: normal
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | | Newsgroups: microsoft.public.biztalk.general
| > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| > | | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21527
| > | | X-Tomcat-NG: microsoft.public.biztalk.general
| > | |
| > | | I have source doc like this:
| > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
| > | | <ProdSpec>
| > | | <Name>Name</Name>
| > | | <Value>Widget</Value>
| > | | </ProdSpec>
| > | | <ProdSpec>
| > | | <Name>Price</Name>
| > | | <Value>1000.99</Value>
| > | | </ProdSpec>
| > | | <ProdSpec>
| > | | <Name>Quantity</Name>
| > | | <Value>550</Value>
| > | | </ProdSpec>
| > | | </ns0:Root>
| > | |
| > | | Which I can to map to the following using the Value Mapping
| > (Flattening)
| > | | functoids:
| > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
| > | | <Order Product="Widget" Price="550" Qty="1000.99" />
| > | | </ns0:Root>
| > | |
| > | | However, when my target schema has "Order" as the root node, like:
| > | | <ns0:Order Product="Widget" Price="550" Qty="1000.99"
| > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
| > | |
| > | | The map doesn't work as before. The output looks like:
| > | | <ns0:Order Product="Widget"
| > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
| > | |
| > | | "Price" and "Quantity" don't map over in this case. In fact, it
will
| > | always
| > | | only map the first <ProdSpec> node. The map is exactly the same as
the
| > | first,
| > | | without the "Root" node.
| > | |
| > | | Does anyone know how to flatten to the root node without using
custom
| > | XSLT?
| > | |
| > | | Thanks,
| > | | Dave
| > | |
| > |
| > |
|

dave v

2004-11-18, 5:49 pm

Thanks Larry, but this isn't quite what I'm trying to do. Let me try to explain and give you a better example. (I've also attached my schemas and maps.)

My source schema has a repeating element containing name-value pair attributes. The destination is an Attunity database interaction schema, which contains a single root node with an attribute for each query parameter.

I need to put the "value" attribute values from the source doc into the proper destination attribute based on the source "name" attributes. For example, attribute "p_ProductID" in the destination needs to be populated with the "value" attribute where "name" attribute = "PRID". I also can''t guarantee the order of source nodes.

Input:
<ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapSource">
<ContextRow ContextName="PRID" ContextValue="231231" />
<ContextRow ContextName="PRNM" ContextValue="WidgetNo5" />
<ContextRow ContextName="PRDS" ContextValue="The fifth and greatest widget in the series." />
</ns0:Root>

Desired Output:
<ns0:DatabaseInteraction p_ProductID="231231"
p_ProductName="WidgetNo5" p_ProductDesc="The fifth and greatest widget in the series."
xmlns:ns0="http://TestBTSStuff.ValueMapDest_2"/>

This works when <DatabaseInteraction> is the child of another node. (See attached "ValueMap_ThisWorks.btm.) But when <DatabaseInteraction> is the rootnode, and this is the way Attunity needs it, it only maps the first <ContextRow>. (See "ValueMap_ThisDoesntWork.btm).

I know this can be done using Scripting Functoids with inline XSLT, however this isn't an option since in some cases I need to pass the selected value from the <ContextRow> to other functoids before it links to the destination node.

Thanks again,
Dave


""larry franks"" <larryfr@online.microsoft.com> wrote in message news:I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl...
> Sure, here it is without attachments:
> schema1.xsd
> =================
> <?xml version="1.0" encoding="utf-16"?>
> <xs:schema xmlns="http://newsgroup.Schema1"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://newsgroup.Schema1"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Root">
> <xs:complexType>
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="unbounded" name="ProdSpec">
> <xs:complexType>
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="1" name="Name"
> type="xs:string" />
> <xs:element minOccurs="1" maxOccurs="1" name="Value"
> type="xs:string" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> =================
>
> schema2.xsd
> =================
> <?xml version="1.0" encoding="utf-16"?>
> <xs:schema xmlns="http://newsgroup.Schema2"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://newsgroup.Schema2"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Order">
> <xs:complexType>
> <xs:attribute name="Product" type="xs:string" />
> <xs:attribute name="value" type="xs:string" />
> </xs:complexType>
> </xs:element>
> </xs:schema>
> =================
>
> map1.btm
> =================
> <?xml version="1.0" encoding="utf-16"?>
> <!-- Generated using BizTalk Mapper on Fri, Nov 12 2004 03:09:37 AM -->
> <!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
> <mapsource Name="BizTalk Map" BizTalkServerMapperTool_Version="2.0"
> Version="2" XRange="100" YRange="420" OmitXmlDeclaration="Yes" CopyPIs="No"
> method="xml" xmlVersion="1.0"
> IgnoreNamespacesForLinks="Yes"><SrcTree><Reference
> Location=".\Schema1.xsd"/></SrcTree><TrgTree><Reference
> Location=".\Schema2.xsd"/></TrgTree><ScriptTypePrecedence><CSharp
> Enabled="Yes"/><ExternalAssembly Enabled="Yes"/><VbNet
> Enabled="Yes"/><JScript Enabled="Yes"/><XsltCallTemplate
> Enabled="Yes"/><Xslt
> Enabled="Yes"/></ScriptTypePrecedence><TreeValues><TestValues/><ConstantValu
> es/></TreeValues><Pages><Page Name="Page 1"><Links><Link LinkID="1"
> LinkFrom="1"
> LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Order']/@*[local-n
> ame()='Product']" Label=""/><Link LinkID="2" LinkFrom="2"
> LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Order']/@*[local-n
> ame()='value']" Label=""/><Link LinkID="3"
> LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
> ame()='ProdSpec']" LinkTo="3" Label=""/><Link LinkID="4" LinkFrom="3"
> LinkTo="1" Label=""/><Link LinkID="5" LinkFrom="3" LinkTo="2"
> Label=""/><Link LinkID="6"
> LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
> ame()='ProdSpec']/*[local-name()='Name']" LinkTo="1" Label=""/><Link
> LinkID="7"
> LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
> ame()='ProdSpec']/*[local-name()='Value']" LinkTo="2"
> Label=""/></Links><Functoids><Functoid FunctoidID="1" X-Cell="54"
> Y-Cell="212" Functoid-FID="374" Functoid-Name="Value Mapping (Flattening)"
> Label=""><Input-Parameters><Parameter Type="Link" Value="4"
> Guid="{DECA6249-C76E-48C6-B934-75F3E9C142F4}"/><Parameter Type="Link"
> Value="6"
> Guid="{2E4766AB-1220-4089-B476-43624BFB0259}"/></Input-Parameters></Functoid
> Functoid-Name="Value Mapping (Flattening)"
> Label=""><Input-Parameters><Parameter Type="Link" Value="5"
> Guid="{83F62960-3FD2-4820-80F3-E85E34141E1A}"/><Parameter Type="Link"
> Value="7"
> Guid="{5E5C151A-0347-4102-8AE3-3DC7052238F7}"/></Input-Parameters></Functoid
> Functoid-Name="Logical Existence" Label=""><Input-Parameters><Parameter
> Type="Link" Value="3"
> Guid="{1058FF80-6BEB-4417-94DF-B46FFD69733E}"/></Input-Parameters></Functoid
> =================
> Larry Franks
>
> This posting is provided "AS IS" with no warranties,and confers no rights.
> Subscribe at
> http://support.microsoft.com/defaul...msdn/nospam.asp
> &SD=msdn
> --------------------
> | Thread-Topic: Value Mapping to Root Node
> | thread-index: AcTLa98mClve497VSEOElpBdONZqHg==
> | X-WBNR-Posting-Host: 207.241.20.65
> | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
> | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
> <$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
> | Subject: RE: Value Mapping to Root Node
> | Date: Mon, 15 Nov 2004 15:36:03 -0800
> | Lines: 121
> | Message-ID: <650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.biztalk.general
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21678
> | X-Tomcat-NG: microsoft.public.biztalk.general
> |
> | Larry -
> |
> | Your last post was cut off somehow. I don't see any links to your sample.
> | Could you re-post so I can take a look?
> |
> | Thanks,
> | Dave
> |
> | ""larry franks"" wrote:
> |
> | > including sample schemas and map. I tried setting up a simple sample
> and
> | > am not able to reproduce the problem. Can you take a look at these
> files
> | > and see if this helps with what you are seeing? If not, would it be
> | > possible to post your project?
> | >
> | >
> | > Larry Franks
> | >
> | > This posting is provided "AS IS" with no warranties,and confers no
> rights.
> | > Subscribe at
> | >
> http://support.microsoft.com/defaul...msdn/nospam.asp
> | > &SD=msdn
> | > --------------------
> | > | X-Tomcat-ID: 621827380
> | > | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> | > | MIME-Version: 1.0
> | > | Content-Type: text/plain
> | > | Content-Transfer-Encoding: 7bit
> | > | From: larryfr@online.microsoft.com ("larry franks")
> | > | Organization: Microsoft
> | > | Date: Thu, 11 Nov 2004 22:09:40 GMT
> | > | Subject: RE: Value Mapping to Root Node
> | > | X-Tomcat-NG: microsoft.public.biztalk.general
> | > | Message-ID: <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
> | > | Newsgroups: microsoft.public.biztalk.general
> | > | Lines: 63
> | > | Path: cpmsftngxa10.phx.gbl
> | > | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21571
> | > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
> | > |
> | > | I haven't ran into this before Dave, let me give this a try and see
> what
> | > I
> | > | can find on it.
> | > |
> | > | Larry Franks
> | > |
> | > | This posting is provided "AS IS" with no warranties,and confers no
> | > rights.
> | > | Subscribe at
> | > |
> | >
> http://support.microsoft.com/defaul...msdn/nospam.asp
> | > | &SD=msdn
> | > | --------------------
> | > | | Thread-Topic: Value Mapping to Root Node
> | > | | thread-index: AcTHgLIFw1TC/fW5SX6ArfRYIEEdAQ==
> | > | | X-WBNR-Posting-Host: 207.241.20.65
> | > | | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
> | > | | Subject: Value Mapping to Root Node
> | > | | Date: Wed, 10 Nov 2004 15:55:02 -0800
> | > | | Lines: 38
> | > | | Message-ID: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> | > | | MIME-Version: 1.0
> | > | | Content-Type: text/plain;
> | > | | charset="Utf-8"
> | > | | Content-Transfer-Encoding: 7bit
> | > | | X-Newsreader: Microsoft CDO for Windows 2000
> | > | | Content-Class: urn:content-classes:message
> | > | | Importance: normal
> | > | | Priority: normal
> | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | > | | Newsgroups: microsoft.public.biztalk.general
> | > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | > | | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | > | | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21527
> | > | | X-Tomcat-NG: microsoft.public.biztalk.general
> | > | |
> | > | | I have source doc like this:
> | > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
> | > | | <ProdSpec>
> | > | | <Name>Name</Name>
> | > | | <Value>Widget</Value>
> | > | | </ProdSpec>
> | > | | <ProdSpec>
> | > | | <Name>Price</Name>
> | > | | <Value>1000.99</Value>
> | > | | </ProdSpec>
> | > | | <ProdSpec>
> | > | | <Name>Quantity</Name>
> | > | | <Value>550</Value>
> | > | | </ProdSpec>
> | > | | </ns0:Root>
> | > | |
> | > | | Which I can to map to the following using the Value Mapping
> | > (Flattening)
> | > | | functoids:
> | > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
> | > | | <Order Product="Widget" Price="550" Qty="1000.99" />
> | > | | </ns0:Root>
> | > | |
> | > | | However, when my target schema has "Order" as the root node, like:
> | > | | <ns0:Order Product="Widget" Price="550" Qty="1000.99"
> | > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
> | > | |
> | > | | The map doesn't work as before. The output looks like:
> | > | | <ns0:Order Product="Widget"
> | > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
> | > | |
> | > | | "Price" and "Quantity" don't map over in this case. In fact, it
> will
> | > | always
> | > | | only map the first <ProdSpec> node. The map is exactly the same as
> the
> | > | first,
> | > | | without the "Root" node.
> | > | |
> | > | | Does anyone know how to flatten to the root node without using
> custom
> | > | XSLT?
> | > | |
> | > | | Thanks,
> | > | | Dave
> | > | |
> | > |
> | > |
> |
>

larry franks

2004-11-30, 5:49 pm

Thanks Dave, I'll take a look at these and see what I can find. Sorry for
the late reply, have been out of the office and it looks like this thread
was missed by my backups.

Larry Franks

This posting is provided "AS IS" with no warranties,and confers no rights.
Subscribe at
http://support.microsoft.com/defaul...msdn/nospam.asp
&SD=msdn
--------------------
| From: "dave v" <daveV.0711.2828@noemail.nospam>
| References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
<alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
<$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
<650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
<I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl>
| Subject: Re: Value Mapping to Root Node
| Date: Thu, 18 Nov 2004 11:37:20 -0600
| Lines: 924
| MIME-Version: 1.0
| Content-Type: multipart/mixed;
| boundary="----=_NextPart_000_0025_01C4CD62.FCDEDE90"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <uWh9rVZzEHA.976@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.biztalk.general
| NNTP-Posting-Host: fw.nicor.com 207.241.20.65
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21789
| X-Tomcat-NG: microsoft.public.biztalk.general
|
| Thanks Larry, but this isn't quite what I'm trying to do. Let me try to
explain and give you a better example. (I've also attached my schemas and
maps.)
| My source schema has a repeating element containing name-value pair
attributes. The destination is an Attunity database interaction schema,
which contains a single root node with an attribute for each query
parameter.
| I need to put the "value" attribute values from the source doc into the
proper destination attribute based on the source "name" attributes. For
example, attribute "p_ProductID" in the destination needs to be populated
with the "value" attribute where "name" attribute = "PRID". I also can''t
guarantee the order of source nodes.
| Input:
| <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapSource">
| <ContextRow ContextName="PRID" ContextValue="231231" />
| <ContextRow ContextName="PRNM" ContextValue="WidgetNo5" />
| <ContextRow ContextName="PRDS" ContextValue="The fifth and greatest
widget in the series." />
| </ns0:Root>
| Desired Output:
| <ns0:DatabaseInteraction p_ProductID="231231"
| p_ProductName="WidgetNo5" p_ProductDesc="The fifth and greatest widget in
the series."
| xmlns:ns0="http://TestBTSStuff.ValueMapDest_2"/>
| This works when <DatabaseInteraction> is the child of another node. (See
attached "ValueMap_ThisWorks.btm.) But when <DatabaseInteraction> is the
rootnode, and this is the way Attunity needs it, it only maps the first
<ContextRow>. (See "ValueMap_ThisDoesntWork.btm).
| I know this can be done using Scripting Functoids with inline XSLT,
however this isn't an option since in some cases I need to pass the
selected value from the <ContextRow> to other functoids before it links to
the destination node.
| Thanks again,
| Dave
| ""larry franks"" <larryfr@online.microsoft.com> wrote in message
news:I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl...
| > Sure, here it is without attachments:
| > schema1.xsd
| > =================
| > <?xml version="1.0" encoding="utf-16"?>
| > <xs:schema xmlns="http://newsgroup.Schema1"
| > xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
| > targetNamespace="http://newsgroup.Schema1"
| > xmlns:xs="http://www.w3.org/2001/XMLSchema">
| > <xs:element name="Root">
| > <xs:complexType>
| > <xs:sequence>
| > <xs:element minOccurs="1" maxOccurs="unbounded" name="ProdSpec">
| > <xs:complexType>
| > <xs:sequence>
| > <xs:element minOccurs="1" maxOccurs="1" name="Name"
| > type="xs:string" />
| > <xs:element minOccurs="1" maxOccurs="1" name="Value"
| > type="xs:string" />
| > </xs:sequence>
| > </xs:complexType>
| > </xs:element>
| > </xs:sequence>
| > </xs:complexType>
| > </xs:element>
| > </xs:schema>
| > =================
| >
| > schema2.xsd
| > =================
| > <?xml version="1.0" encoding="utf-16"?>
| > <xs:schema xmlns="http://newsgroup.Schema2"
| > xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
| > targetNamespace="http://newsgroup.Schema2"
| > xmlns:xs="http://www.w3.org/2001/XMLSchema">
| > <xs:element name="Order">
| > <xs:complexType>
| > <xs:attribute name="Product" type="xs:string" />
| > <xs:attribute name="value" type="xs:string" />
| > </xs:complexType>
| > </xs:element>
| > </xs:schema>
| > =================
| >
| > map1.btm
| > =================
| > <?xml version="1.0" encoding="utf-16"?>
| > <!-- Generated using BizTalk Mapper on Fri, Nov 12 2004 03:09:37 AM -->
| > <!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
| > <mapsource Name="BizTalk Map" BizTalkServerMapperTool_Version="2.0"
| > Version="2" XRange="100" YRange="420" OmitXmlDeclaration="Yes"
CopyPIs="No"
| > method="xml" xmlVersion="1.0"
| > IgnoreNamespacesForLinks="Yes"><SrcTree><Reference
| > Location=".\Schema1.xsd"/></SrcTree><TrgTree><Reference
| > Location=".\Schema2.xsd"/></TrgTree><ScriptTypePrecedence><CSharp
| > Enabled="Yes"/><ExternalAssembly Enabled="Yes"/><VbNet
| > Enabled="Yes"/><JScript Enabled="Yes"/><XsltCallTemplate
| > Enabled="Yes"/><Xslt
| >
Enabled="Yes"/></ScriptTypePrecedence><TreeValues><TestValues/><ConstantValu
| > es/></TreeValues><Pages><Page Name="Page 1"><Links><Link LinkID="1"
| > LinkFrom="1"
| >
LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Order']/@*[local-n
| > ame()='Product']" Label=""/><Link LinkID="2" LinkFrom="2"
| >
LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Order']/@*[local-n
| > ame()='value']" Label=""/><Link LinkID="3"
| >
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
| > ame()='ProdSpec']" LinkTo="3" Label=""/><Link LinkID="4" LinkFrom="3"
| > LinkTo="1" Label=""/><Link LinkID="5" LinkFrom="3" LinkTo="2"
| > Label=""/><Link LinkID="6"
| >
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
| > ame()='ProdSpec']/*[local-name()='Name']" LinkTo="1" Label=""/><Link
| > LinkID="7"
| >
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
| > ame()='ProdSpec']/*[local-name()='Value']" LinkTo="2"
| > Label=""/></Links><Functoids><Functoid FunctoidID="1" X-Cell="54"
| > Y-Cell="212" Functoid-FID="374" Functoid-Name="Value Mapping
(Flattening)"
| > Label=""><Input-Parameters><Parameter Type="Link" Value="4"
| > Guid="{DECA6249-C76E-48C6-B934-75F3E9C142F4}"/><Parameter Type="Link"
| > Value="6"
| >
Guid="{2E4766AB-1220-4089-B476-43624BFB0259}"/></Input-Parameters></Functoid
| > ><Functoid FunctoidID="2" X-Cell="54" Y-Cell="213" Functoid-FID="374"
| > Functoid-Name="Value Mapping (Flattening)"
| > Label=""><Input-Parameters><Parameter Type="Link" Value="5"
| > Guid="{83F62960-3FD2-4820-80F3-E85E34141E1A}"/><Parameter Type="Link"
| > Value="7"
| >
Guid="{5E5C151A-0347-4102-8AE3-3DC7052238F7}"/></Input-Parameters></Functoid
| > ><Functoid FunctoidID="3" X-Cell="51" Y-Cell="212" Functoid-FID="701"
| > Functoid-Name="Logical Existence" Label=""><Input-Parameters><Parameter
| > Type="Link" Value="3"
| >
Guid="{1058FF80-6BEB-4417-94DF-B46FFD69733E}"/></Input-Parameters></Functoid
| > ></Functoids></Page></Pages></mapsource>
| > =================
| > Larry Franks
| >
| > This posting is provided "AS IS" with no warranties,and confers no
rights.
| > Subscribe at
| >
http://support.microsoft.com/defaul...msdn/nospam.asp
| > &SD=msdn
| > --------------------
| > | Thread-Topic: Value Mapping to Root Node
| > | thread-index: AcTLa98mClve497VSEOElpBdONZqHg==
| > | X-WBNR-Posting-Host: 207.241.20.65
| > | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
| > | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| > <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
| > <$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
| > | Subject: RE: Value Mapping to Root Node
| > | Date: Mon, 15 Nov 2004 15:36:03 -0800
| > | Lines: 121
| > | Message-ID: <650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.biztalk.general
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| > | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21678
| > | X-Tomcat-NG: microsoft.public.biztalk.general
| > |
| > | Larry -
| > |
| > | Your last post was cut off somehow. I don't see any links to your
sample.
| > | Could you re-post so I can take a look?
| > |
| > | Thanks,
| > | Dave
| > |
| > | ""larry franks"" wrote:
| > |
| > | > including sample schemas and map. I tried setting up a simple
sample
| > and
| > | > am not able to reproduce the problem. Can you take a look at these
| > files
| > | > and see if this helps with what you are seeing? If not, would it
be
| > | > possible to post your project?
| > | >
| > | >
| > | > Larry Franks
| > | >
| > | > This posting is provided "AS IS" with no warranties,and confers no
> rights.

| > | > Subscribe at
| > | >
| >
http://support.microsoft.com/defaul...msdn/nospam.asp
| > | > &SD=msdn
| > | > --------------------
| > | > | X-Tomcat-ID: 621827380
| > | > | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain
| > | > | Content-Transfer-Encoding: 7bit
| > | > | From: larryfr@online.microsoft.com ("larry franks")
| > | > | Organization: Microsoft
| > | > | Date: Thu, 11 Nov 2004 22:09:40 GMT
| > | > | Subject: RE: Value Mapping to Root Node
| > | > | X-Tomcat-NG: microsoft.public.biztalk.general
| > | > | Message-ID: <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
| > | > | Newsgroups: microsoft.public.biztalk.general
| > | > | Lines: 63
| > | > | Path: cpmsftngxa10.phx.gbl
| > | > | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21571
| > | > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
| > | > |
| > | > | I haven't ran into this before Dave, let me give this a try and
see
| > what
| > | > I
| > | > | can find on it.
| > | > |
| > | > | Larry Franks
| > | > |
| > | > | This posting is provided "AS IS" with no warranties,and confers
no
| > | > rights.
| > | > | Subscribe at
| > | > |
| > | >
| >
http://support.microsoft.com/defaul...msdn/nospam.asp
| > | > | &SD=msdn
| > | > | --------------------
| > | > | | Thread-Topic: Value Mapping to Root Node
| > | > | | thread-index: AcTHgLIFw1TC/fW5SX6ArfRYIEEdAQ==
| > | > | | X-WBNR-Posting-Host: 207.241.20.65
| > | > | | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
| > | > | | Subject: Value Mapping to Root Node
| > | > | | Date: Wed, 10 Nov 2004 15:55:02 -0800
| > | > | | Lines: 38
| > | > | | Message-ID: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| > | > | | MIME-Version: 1.0
| > | > | | Content-Type: text/plain;
| > | > | | charset="Utf-8"
| > | > | | Content-Transfer-Encoding: 7bit
| > | > | | X-Newsreader: Microsoft CDO for Windows 2000
| > | > | | Content-Class: urn:content-classes:message
| > | > | | Importance: normal
| > | > | | Priority: normal
| > | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | > | | Newsgroups: microsoft.public.biztalk.general
| > | > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| > | > | | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | > | | Xref: cpmsftngxa10.phx.gbl
microsoft.public.biztalk.general:21527
| > | > | | X-Tomcat-NG: microsoft.public.biztalk.general
| > | > | |
| > | > | | I have source doc like this:
| > | > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
| > | > | | <ProdSpec>
| > | > | | <Name>Name</Name>
| > | > | | <Value>Widget</Value>
| > | > | | </ProdSpec>
| > | > | | <ProdSpec>
| > | > | | <Name>Price</Name>
| > | > | | <Value>1000.99</Value>
| > | > | | </ProdSpec>
| > | > | | <ProdSpec>
| > | > | | <Name>Quantity</Name>
| > | > | | <Value>550</Value>
| > | > | | </ProdSpec>
| > | > | | </ns0:Root>
| > | > | |
| > | > | | Which I can to map to the following using the Value Mapping
| > | > (Flattening)
| > | > | | functoids:
| > | > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
| > | > | | <Order Product="Widget" Price="550" Qty="1000.99" />
| > | > | | </ns0:Root>
| > | > | |
| > | > | | However, when my target schema has "Order" as the root node,
like:
| > | > | | <ns0:Order Product="Widget" Price="550" Qty="1000.99"
| > | > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
| > | > | |
| > | > | | The map doesn't work as before. The output looks like:
| > | > | | <ns0:Order Product="Widget"
| > | > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
| > | > | |
| > | > | | "Price" and "Quantity" don't map over in this case. In fact, it
| > will
| > | > | always
| > | > | | only map the first <ProdSpec> node. The map is exactly the same
as
| > the
| > | > | first,
| > | > | | without the "Root" node.
| > | > | |
| > | > | | Does anyone know how to flatten to the root node without using
> custom

| > | > | XSLT?
| > | > | |
| > | > | | Thanks,
| > | > | | Dave
| > | > | |
| > | > |
| > | > |
| > |
| >
|

larry franks

2004-12-01, 5:51 pm

Followup. I ran through a few things on this and checked with the rest of
the support team here. There isn't a way to do this using the built in
functoids. What is happening is that we do not generate a loop in the XSL
code if the destination is a root element. If it's a non-root element then
we can generate a loop for it.

I'm afraid you'll have to go with a custom script for this one.

Larry Franks

This posting is provided "AS IS" with no warranties,and confers no rights.
Subscribe at
http://support.microsoft.com/defaul...msdn/nospam.asp
&SD=msdn
--------------------
| X-Tomcat-ID: 582047047
| References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
<alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
<$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
<650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
<I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl>
<uWh9rVZzEHA.976@TK2MSFTNGP10.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: larryfr@online.microsoft.com ("larry franks")
| Organization: Microsoft
| Date: Tue, 30 Nov 2004 21:04:03 GMT
| Subject: Re: Value Mapping to Root Node
| X-Tomcat-NG: microsoft.public.biztalk.general
| Message-ID: <jhdIfAy1EHA.3440@cpmsftngxa10.phx.gbl>
| Newsgroups: microsoft.public.biztalk.general
| Lines: 357
| Path: cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:22076
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Thanks Dave, I'll take a look at these and see what I can find. Sorry
for
| the late reply, have been out of the office and it looks like this thread
| was missed by my backups.
|
| Larry Franks
|
| This posting is provided "AS IS" with no warranties,and confers no
rights.
| Subscribe at
|
http://support.microsoft.com/defaul...msdn/nospam.asp
| &SD=msdn
| --------------------
| | From: "dave v" <daveV.0711.2828@noemail.nospam>
| | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
| <$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
| <650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
| <I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl>
| | Subject: Re: Value Mapping to Root Node
| | Date: Thu, 18 Nov 2004 11:37:20 -0600
| | Lines: 924
| | MIME-Version: 1.0
| | Content-Type: multipart/mixed;
| | boundary="----=_NextPart_000_0025_01C4CD62.FCDEDE90"
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| | Message-ID: <uWh9rVZzEHA.976@TK2MSFTNGP10.phx.gbl>
| | Newsgroups: microsoft.public.biztalk.general
| | NNTP-Posting-Host: fw.nicor.com 207.241.20.65
| | Path:
|
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
| .phx.gbl
| | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21789
| | X-Tomcat-NG: microsoft.public.biztalk.general
| |
| | Thanks Larry, but this isn't quite what I'm trying to do. Let me try to
| explain and give you a better example. (I've also attached my schemas and
| maps.)
| | My source schema has a repeating element containing name-value pair
| attributes. The destination is an Attunity database interaction schema,
| which contains a single root node with an attribute for each query
| parameter.
| | I need to put the "value" attribute values from the source doc into the
| proper destination attribute based on the source "name" attributes. For
| example, attribute "p_ProductID" in the destination needs to be populated
| with the "value" attribute where "name" attribute = "PRID". I also can''t
| guarantee the order of source nodes.
| | Input:
| | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapSource">
| | <ContextRow ContextName="PRID" ContextValue="231231" />
| | <ContextRow ContextName="PRNM" ContextValue="WidgetNo5" />
| | <ContextRow ContextName="PRDS" ContextValue="The fifth and greatest
| widget in the series." />
| | </ns0:Root>
| | Desired Output:
| | <ns0:DatabaseInteraction p_ProductID="231231"
| | p_ProductName="WidgetNo5" p_ProductDesc="The fifth and greatest widget
in
| the series."
| | xmlns:ns0="http://TestBTSStuff.ValueMapDest_2"/>
| | This works when <DatabaseInteraction> is the child of another node.
(See
| attached "ValueMap_ThisWorks.btm.) But when <DatabaseInteraction> is the
| rootnode, and this is the way Attunity needs it, it only maps the first
| <ContextRow>. (See "ValueMap_ThisDoesntWork.btm).
| | I know this can be done using Scripting Functoids with inline XSLT,
| however this isn't an option since in some cases I need to pass the
| selected value from the <ContextRow> to other functoids before it links
to
| the destination node.
| | Thanks again,
| | Dave
| | ""larry franks"" <larryfr@online.microsoft.com> wrote in message
| news:I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl...
| | > Sure, here it is without attachments:
| | > schema1.xsd
| | > =================
| | > <?xml version="1.0" encoding="utf-16"?>
| | > <xs:schema xmlns="http://newsgroup.Schema1"
| | > xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
| | > targetNamespace="http://newsgroup.Schema1"
| | > xmlns:xs="http://www.w3.org/2001/XMLSchema">
| | > <xs:element name="Root">
| | > <xs:complexType>
| | > <xs:sequence>
| | > <xs:element minOccurs="1" maxOccurs="unbounded"
name="ProdSpec">
| | > <xs:complexType>
| | > <xs:sequence>
| | > <xs:element minOccurs="1" maxOccurs="1" name="Name"
| | > type="xs:string" />
| | > <xs:element minOccurs="1" maxOccurs="1" name="Value"
| | > type="xs:string" />
| | > </xs:sequence>
| | > </xs:complexType>
| | > </xs:element>
| | > </xs:sequence>
| | > </xs:complexType>
| | > </xs:element>
| | > </xs:schema>
| | > =================
| | >
| | > schema2.xsd
| | > =================
| | > <?xml version="1.0" encoding="utf-16"?>
| | > <xs:schema xmlns="http://newsgroup.Schema2"
| | > xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
| | > targetNamespace="http://newsgroup.Schema2"
| | > xmlns:xs="http://www.w3.org/2001/XMLSchema">
| | > <xs:element name="Order">
| | > <xs:complexType>
| | > <xs:attribute name="Product" type="xs:string" />
| | > <xs:attribute name="value" type="xs:string" />
| | > </xs:complexType>
| | > </xs:element>
| | > </xs:schema>
| | > =================
| | >
| | > map1.btm
| | > =================
| | > <?xml version="1.0" encoding="utf-16"?>
| | > <!-- Generated using BizTalk Mapper on Fri, Nov 12 2004 03:09:37 AM
-->
| | > <!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
| | > <mapsource Name="BizTalk Map" BizTalkServerMapperTool_Version="2.0"
| | > Version="2" XRange="100" YRange="420" OmitXmlDeclaration="Yes"
| CopyPIs="No"
| | > method="xml" xmlVersion="1.0"
| | > IgnoreNamespacesForLinks="Yes"><SrcTree><Reference
| | > Location=".\Schema1.xsd"/></SrcTree><TrgTree><Reference
| | > Location=".\Schema2.xsd"/></TrgTree><ScriptTypePrecedence><CSharp
| | > Enabled="Yes"/><ExternalAssembly Enabled="Yes"/><VbNet
| | > Enabled="Yes"/><JScript Enabled="Yes"/><XsltCallTemplate
| | > Enabled="Yes"/><Xslt
| | >
|
Enabled="Yes"/></ScriptTypePrecedence><TreeValues><TestValues/><ConstantValu
| | > es/></TreeValues><Pages><Page Name="Page 1"><Links><Link LinkID="1"
| | > LinkFrom="1"
| | >
|
LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Order']/@*[local-n
| | > ame()='Product']" Label=""/><Link LinkID="2" LinkFrom="2"
| | >
|
LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Order']/@*[local-n
| | > ame()='value']" Label=""/><Link LinkID="3"
| | >
|
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
| | > ame()='ProdSpec']" LinkTo="3" Label=""/><Link LinkID="4" LinkFrom="3"
| | > LinkTo="1" Label=""/><Link LinkID="5" LinkFrom="3" LinkTo="2"
| | > Label=""/><Link LinkID="6"
| | >
|
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
| | > ame()='ProdSpec']/*[local-name()='Name']" LinkTo="1" Label=""/><Link
| | > LinkID="7"
| | >
|
LinkFrom="/*[local-name()='&lt;Schema&gt;']/*[local-name()='Root']/*[local-n
| | > ame()='ProdSpec']/*[local-name()='Value']" LinkTo="2"
| | > Label=""/></Links><Functoids><Functoid FunctoidID="1" X-Cell="54"
| | > Y-Cell="212" Functoid-FID="374" Functoid-Name="Value Mapping
| (Flattening)"
| | > Label=""><Input-Parameters><Parameter Type="Link" Value="4"
| | > Guid="{DECA6249-C76E-48C6-B934-75F3E9C142F4}"/><Parameter Type="Link"
| | > Value="6"
| | >
|
Guid="{2E4766AB-1220-4089-B476-43624BFB0259}"/></Input-Parameters></Functoid
| | > ><Functoid FunctoidID="2" X-Cell="54" Y-Cell="213" Functoid-FID="374"
| | > Functoid-Name="Value Mapping (Flattening)"
| | > Label=""><Input-Parameters><Parameter Type="Link" Value="5"
| | > Guid="{83F62960-3FD2-4820-80F3-E85E34141E1A}"/><Parameter Type="Link"
| | > Value="7"
| | >
|
Guid="{5E5C151A-0347-4102-8AE3-3DC7052238F7}"/></Input-Parameters></Functoid
| | > ><Functoid FunctoidID="3" X-Cell="51" Y-Cell="212" Functoid-FID="701"
| | > Functoid-Name="Logical Existence"
Label=""><Input-Parameters><Parameter
| | > Type="Link" Value="3"
| | >
|
Guid="{1058FF80-6BEB-4417-94DF-B46FFD69733E}"/></Input-Parameters></Functoid
| | > ></Functoids></Page></Pages></mapsource>
| | > =================
| | > Larry Franks
| | >
| | > This posting is provided "AS IS" with no warranties,and confers no
| rights.
| | > Subscribe at
| | >
|
http://support.microsoft.com/defaul...msdn/nospam.asp
| | > &SD=msdn
| | > --------------------
| | > | Thread-Topic: Value Mapping to Root Node
| | > | thread-index: AcTLa98mClve497VSEOElpBdONZqHg==
| | > | X-WBNR-Posting-Host: 207.241.20.65
| | > | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
| | > | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| | > <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
| | > <$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
| | > | Subject: RE: Value Mapping to Root Node
| | > | Date: Mon, 15 Nov 2004 15:36:03 -0800
| | > | Lines: 121
| | > | Message-ID: <650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
| | > | MIME-Version: 1.0
| | > | Content-Type: text/plain;
| | > | charset="Utf-8"
| | > | Content-Transfer-Encoding: 7bit
| | > | X-Newsreader: Microsoft CDO for Windows 2000
| | > | Content-Class: urn:content-classes:message
| | > | Importance: normal
| | > | Priority: normal
| | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | > | Newsgroups: microsoft.public.biztalk.general
| | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| | > | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | > | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21678
| | > | X-Tomcat-NG: microsoft.public.biztalk.general
| | > |
| | > | Larry -
| | > |
| | > | Your last post was cut off somehow. I don't see any links to your
| sample.
| | > | Could you re-post so I can take a look?
| | > |
| | > | Thanks,
| | > | Dave
| | > |
| | > | ""larry franks"" wrote:
| | > |
| | > | > including sample schemas and map. I tried setting up a simple
| sample
| | > and
| | > | > am not able to reproduce the problem. Can you take a look at
these
| | > files
| | > | > and see if this helps with what you are seeing? If not, would it
| be
| | > | > possible to post your project?
| | > | >
| | > | >
| | > | > Larry Franks
| | > | >
| | > | > This posting is provided "AS IS" with no warranties,and confers
no
| > rights.
| | > | > Subscribe at
| | > | >
| | >
|
http://support.microsoft.com/defaul...msdn/nospam.asp
| | > | > &SD=msdn
| | > | > --------------------
| | > | > | X-Tomcat-ID: 621827380
| | > | > | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| | > | > | MIME-Version: 1.0
| | > | > | Content-Type: text/plain
| | > | > | Content-Transfer-Encoding: 7bit
| | > | > | From: larryfr@online.microsoft.com ("larry franks")
| | > | > | Organization: Microsoft
| | > | > | Date: Thu, 11 Nov 2004 22:09:40 GMT
| | > | > | Subject: RE: Value Mapping to Root Node
| | > | > | X-Tomcat-NG: microsoft.public.biztalk.general
| | > | > | Message-ID: <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
| | > | > | Newsgroups: microsoft.public.biztalk.general
| | > | > | Lines: 63
| | > | > | Path: cpmsftngxa10.phx.gbl
| | > | > | Xref: cpmsftngxa10.phx.gbl
microsoft.public.biztalk.general:21571
| | > | > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
| | > | > |
| | > | > | I haven't ran into this before Dave, let me give this a try and
| see
| | > what
| | > | > I
| | > | > | can find on it.
| | > | > |
| | > | > | Larry Franks
| | > | > |
| | > | > | This posting is provided "AS IS" with no warranties,and confers
| no
| | > | > rights.
| | > | > | Subscribe at
| | > | > |
| | > | >
| | >
|
http://support.microsoft.com/defaul...msdn/nospam.asp
| | > | > | &SD=msdn
| | > | > | --------------------
| | > | > | | Thread-Topic: Value Mapping to Root Node
| | > | > | | thread-index: AcTHgLIFw1TC/fW5SX6ArfRYIEEdAQ==
| | > | > | | X-WBNR-Posting-Host: 207.241.20.65
| | > | > | | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
| | > | > | | Subject: Value Mapping to Root Node
| | > | > | | Date: Wed, 10 Nov 2004 15:55:02 -0800
| | > | > | | Lines: 38
| | > | > | | Message-ID:
<5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
| | > | > | | MIME-Version: 1.0
| | > | > | | Content-Type: text/plain;
| | > | > | | charset="Utf-8"
| | > | > | | Content-Transfer-Encoding: 7bit
| | > | > | | X-Newsreader: Microsoft CDO for Windows 2000
| | > | > | | Content-Class: urn:content-classes:message
| | > | > | | Importance: normal
| | > | > | | Priority: normal
| | > | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | > | > | | Newsgroups: microsoft.public.biztalk.general
| | > | > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| | > | > | | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | > | > | | Xref: cpmsftngxa10.phx.gbl
| microsoft.public.biztalk.general:21527
| | > | > | | X-Tomcat-NG: microsoft.public.biztalk.general
| | > | > | |
| | > | > | | I have source doc like this:
| | > | > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
| | > | > | | <ProdSpec>
| | > | > | | <Name>Name</Name>
| | > | > | | <Value>Widget</Value>
| | > | > | | </ProdSpec>
| | > | > | | <ProdSpec>
| | > | > | | <Name>Price</Name>
| | > | > | | <Value>1000.99</Value>
| | > | > | | </ProdSpec>
| | > | > | | <ProdSpec>
| | > | > | | <Name>Quantity</Name>
| | > | > | | <Value>550</Value>
| | > | > | | </ProdSpec>
| | > | > | | </ns0:Root>
| | > | > | |
| | > | > | | Which I can to map to the following using the Value Mapping
| | > | > (Flattening)
| | > | > | | functoids:
| | > | > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
| | > | > | | <Order Product="Widget" Price="550" Qty="1000.99" />
| | > | > | | </ns0:Root>
| | > | > | |
| | > | > | | However, when my target schema has "Order" as the root node,
| like:
| | > | > | | <ns0:Order Product="Widget" Price="550" Qty="1000.99"
| | > | > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
| | > | > | |
| | > | > | | The map doesn't work as before. The output looks like:
| | > | > | | <ns0:Order Product="Widget"
| | > | > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
| | > | > | |
| | > | > | | "Price" and "Quantity" don't map over in this case. In fact,
it
| | > will
| | > | > | always
| | > | > | | only map the first <ProdSpec> node. The map is exactly the
same
| as
| | > the
| | > | > | first,
| | > | > | | without the "Root" node.
| | > | > | |
| | > | > | | Does anyone know how to flatten to the root node without
using
| > custom
| | > | > | XSLT?
| | > | > | |
| | > | > | | Thanks,
| | > | > | | Dave
| | > | > | |
| | > | > |
| | > | > |
| | > |
| | >
| |
|
|

dave v

2004-12-01, 5:51 pm

Hmmm. Well, you can add this to my wishlist! This is a common requirement on
my current project. (over 10 transformations of repeating name-value pair
elements to Attunity schema root nodes.)

Thanks for your help,
Dave

""larry franks"" wrote:

> Followup. I ran through a few things on this and checked with the rest of
> the support team here. There isn't a way to do this using the built in
> functoids. What is happening is that we do not generate a loop in the XSL
> code if the destination is a root element. If it's a non-root element then
> we can generate a loop for it.
>
> I'm afraid you'll have to go with a custom script for this one.
>
> Larry Franks
>
> This posting is provided "AS IS" with no warranties,and confers no rights.
> Subscribe at
> http://support.microsoft.com/defaul...msdn/nospam.asp
> &SD=msdn
> --------------------
> | X-Tomcat-ID: 582047047
> | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
> <$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
> <650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
> <I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl>
> <uWh9rVZzEHA.976@TK2MSFTNGP10.phx.gbl>
> | MIME-Version: 1.0
> | Content-Type: text/plain
> | Content-Transfer-Encoding: 7bit
> | From: larryfr@online.microsoft.com ("larry franks")
> | Organization: Microsoft
> | Date: Tue, 30 Nov 2004 21:04:03 GMT
> | Subject: Re: Value Mapping to Root Node
> | X-Tomcat-NG: microsoft.public.biztalk.general
> | Message-ID: <jhdIfAy1EHA.3440@cpmsftngxa10.phx.gbl>
> | Newsgroups: microsoft.public.biztalk.general
> | Lines: 357
> | Path: cpmsftngxa10.phx.gbl
> | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:22076
> | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
> |
> | Thanks Dave, I'll take a look at these and see what I can find. Sorry
> for
> | the late reply, have been out of the office and it looks like this thread
> | was missed by my backups.
> |
> | Larry Franks
> |
> | This posting is provided "AS IS" with no warranties,and confers no
> rights.
> | Subscribe at
> |
> http://support.microsoft.com/defaul...msdn/nospam.asp
> | &SD=msdn
> | --------------------
> | | From: "dave v" <daveV.0711.2828@noemail.nospam>
> | | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> | <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
> | <$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
> | <650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
> | <I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl>
> | | Subject: Re: Value Mapping to Root Node
> | | Date: Thu, 18 Nov 2004 11:37:20 -0600
> | | Lines: 924
> | | MIME-Version: 1.0
> | | Content-Type: multipart/mixed;
> | | boundary="----=_NextPart_000_0025_01C4CD62.FCDEDE90"
> | | X-Priority: 3
> | | X-MSMail-Priority: Normal
> | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
> | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
> | | Message-ID: <uWh9rVZzEHA.976@TK2MSFTNGP10.phx.gbl>
> | | Newsgroups: microsoft.public.biztalk.general
> | | NNTP-Posting-Host: fw.nicor.com 207.241.20.65
> | | Path:
> |
> cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
> | .phx.gbl
> | | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21789
> | | X-Tomcat-NG: microsoft.public.biztalk.general
> | |
> | | Thanks Larry, but this isn't quite what I'm trying to do. Let me try to
> | explain and give you a better example. (I've also attached my schemas and
> | maps.)
> | | My source schema has a repeating element containing name-value pair
> | attributes. The destination is an Attunity database interaction schema,
> | which contains a single root node with an attribute for each query
> | parameter.
> | | I need to put the "value" attribute values from the source doc into the
> | proper destination attribute based on the source "name" attributes. For
> | example, attribute "p_ProductID" in the destination needs to be populated
> | with the "value" attribute where "name" attribute = "PRID". I also can''t
> | guarantee the order of source nodes.
> | | Input:
> | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapSource">
> | | <ContextRow ContextName="PRID" ContextValue="231231" />
> | | <ContextRow ContextName="PRNM" ContextValue="WidgetNo5" />
> | | <ContextRow ContextName="PRDS" ContextValue="The fifth and greatest
> | widget in the series." />
> | | </ns0:Root>
> | | Desired Output:
> | | <ns0:DatabaseInteraction p_ProductID="231231"
> | | p_ProductName="WidgetNo5" p_ProductDesc="The fifth and greatest widget
> in
> | the series."
> | | xmlns:ns0="http://TestBTSStuff.ValueMapDest_2"/>
> | | This works when <DatabaseInteraction> is the child of another node.
> (See
> | attached "ValueMap_ThisWorks.btm.) But when <DatabaseInteraction> is the
> | rootnode, and this is the way Attunity needs it, it only maps the first
> | <ContextRow>. (See "ValueMap_ThisDoesntWork.btm).
> | | I know this can be done using Scripting Functoids with inline XSLT,
> | however this isn't an option since in some cases I need to pass the
> | selected value from the <ContextRow> to other functoids before it links
> to
> | the destination node.
> | | Thanks again,
> | | Dave
> | | ""larry franks"" <larryfr@online.microsoft.com> wrote in message
> | news:I8Nz8wCzEHA.1884@cpmsftngxa10.phx.gbl...
> | | > Sure, here it is without attachments:
> | | > schema1.xsd
> | | > =================
> | | > <?xml version="1.0" encoding="utf-16"?>
> | | > <xs:schema xmlns="http://newsgroup.Schema1"
> | | > xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> | | > targetNamespace="http://newsgroup.Schema1"
> | | > xmlns:xs="http://www.w3.org/2001/XMLSchema">
> | | > <xs:element name="Root">
> | | > <xs:complexType>
> | | > <xs:sequence>
> | | > <xs:element minOccurs="1" maxOccurs="unbounded"
> name="ProdSpec">
> | | > <xs:complexType>
> | | > <xs:sequence>
> | | > <xs:element minOccurs="1" maxOccurs="1" name="Name"
> | | > type="xs:string" />
> | | > <xs:element minOccurs="1" maxOccurs="1" name="Value"
> | | > type="xs:string" />
> | | > </xs:sequence>
> | | > </xs:complexType>
> | | > </xs:element>
> | | > </xs:sequence>
> | | > </xs:complexType>
> | | > </xs:element>
> | | > </xs:schema>
> | | > =================
> | | >
> | | > schema2.xsd
> | | > =================
> | | > <?xml version="1.0" encoding="utf-16"?>
> | | > <xs:schema xmlns="http://newsgroup.Schema2"
> | | > xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> | | > targetNamespace="http://newsgroup.Schema2"
> | | > xmlns:xs="http://www.w3.org/2001/XMLSchema">
> | | > <xs:element name="Order">
> | | > <xs:complexType>
> | | > <xs:attribute name="Product" type="xs:string" />
> | | > <xs:attribute name="value" type="xs:string" />
> | | > </xs:complexType>
> | | > </xs:element>
> | | > </xs:schema>
> | | > =================
> | | >
> | | > map1.btm
> | | > =================
> | | > <?xml version="1.0" encoding="utf-16"?>
> | | > <!-- Generated using BizTalk Mapper on Fri, Nov 12 2004 03:09:37 AM
> -->
> | | > <!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
> | | > <mapsource Name="BizTalk Map" BizTalkServerMapperTool_Version="2.0"
> | | > Version="2" XRange="100" YRange="420" OmitXmlDeclaration="Yes"
> | CopyPIs="No"
> | | > method="xml" xmlVersion="1.0"
> | | > IgnoreNamespacesForLinks="Yes"><SrcTree><Reference
> | | > Location=".\Schema1.xsd"/></SrcTree><TrgTree><Reference
> | | > Location=".\Schema2.xsd"/></TrgTree><ScriptTypePrecedence><CSharp
> | | > Enabled="Yes"/><ExternalAssembly Enabled="Yes"/><VbNet
> | | > Enabled="Yes"/><JScript Enabled="Yes"/><XsltCallTemplate
> | | > Enabled="Yes"/><Xslt
> | | >
> |
> Enabled="Yes"/></ScriptTypePrecedence><TreeValues><TestValues/><ConstantValu
> | | > es/></TreeValues><Pages><Page Name="Page 1"><Links><Link LinkID="1"
> | | > LinkFrom="1"
> | | >
> |
> LinkTo="/*[local-name()='<Schema>']/*[local-name()='Order']/@*[local-n
> | | > ame()='Product']" Label=""/><Link LinkID="2" LinkFrom="2"
> | | >
> |
> LinkTo="/*[local-name()='<Schema>']/*[local-name()='Order']/@*[local-n
> | | > ame()='value']" Label=""/><Link LinkID="3"
> | | >
> |
> LinkFrom="/*[local-name()='<Schema>']/*[local-name()='Root']/*[local-n
> | | > ame()='ProdSpec']" LinkTo="3" Label=""/><Link LinkID="4" LinkFrom="3"
> | | > LinkTo="1" Label=""/><Link LinkID="5" LinkFrom="3" LinkTo="2"
> | | > Label=""/><Link LinkID="6"
> | | >
> |
> LinkFrom="/*[local-name()='<Schema>']/*[local-name()='Root']/*[local-n
> | | > ame()='ProdSpec']/*[local-name()='Name']" LinkTo="1" Label=""/><Link
> | | > LinkID="7"
> | | >
> |
> LinkFrom="/*[local-name()='<Schema>']/*[local-name()='Root']/*[local-n
> | | > ame()='ProdSpec']/*[local-name()='Value']" LinkTo="2"
> | | > Label=""/></Links><Functoids><Functoid FunctoidID="1" X-Cell="54"
> | | > Y-Cell="212" Functoid-FID="374" Functoid-Name="Value Mapping
> | (Flattening)"
> | | > Label=""><Input-Parameters><Parameter Type="Link" Value="4"
> | | > Guid="{DECA6249-C76E-48C6-B934-75F3E9C142F4}"/><Parameter Type="Link"
> | | > Value="6"
> | | >
> |
> Guid="{2E4766AB-1220-4089-B476-43624BFB0259}"/></Input-Parameters></Functoid
> | | > ><Functoid FunctoidID="2" X-Cell="54" Y-Cell="213" Functoid-FID="374"
> | | > Functoid-Name="Value Mapping (Flattening)"
> | | > Label=""><Input-Parameters><Parameter Type="Link" Value="5"
> | | > Guid="{83F62960-3FD2-4820-80F3-E85E34141E1A}"/><Parameter Type="Link"
> | | > Value="7"
> | | >
> |
> Guid="{5E5C151A-0347-4102-8AE3-3DC7052238F7}"/></Input-Parameters></Functoid
> | | > ><Functoid FunctoidID="3" X-Cell="51" Y-Cell="212" Functoid-FID="701"
> | | > Functoid-Name="Logical Existence"
> Label=""><Input-Parameters><Parameter
> | | > Type="Link" Value="3"
> | | >
> |
> Guid="{1058FF80-6BEB-4417-94DF-B46FFD69733E}"/></Input-Parameters></Functoid
> | | > ></Functoids></Page></Pages></mapsource>
> | | > =================
> | | > Larry Franks
> | | >
> | | > This posting is provided "AS IS" with no warranties,and confers no
> | rights.
> | | > Subscribe at
> | | >
> |
> http://support.microsoft.com/defaul...msdn/nospam.asp
> | | > &SD=msdn
> | | > --------------------
> | | > | Thread-Topic: Value Mapping to Root Node
> | | > | thread-index: AcTLa98mClve497VSEOElpBdONZqHg==
> | | > | X-WBNR-Posting-Host: 207.241.20.65
> | | > | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
> | | > | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> | | > <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
> | | > <$nwc9RPyEHA.2916@cpmsftngxa10.phx.gbl>
> | | > | Subject: RE: Value Mapping to Root Node
> | | > | Date: Mon, 15 Nov 2004 15:36:03 -0800
> | | > | Lines: 121
> | | > | Message-ID: <650A67FC-48DE-4549-8050-8157F65BC318@microsoft.com>
> | | > | MIME-Version: 1.0
> | | > | Content-Type: text/plain;
> | | > | charset="Utf-8"
> | | > | Content-Transfer-Encoding: 7bit
> | | > | X-Newsreader: Microsoft CDO for Windows 2000
> | | > | Content-Class: urn:content-classes:message
> | | > | Importance: normal
> | | > | Priority: normal
> | | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | | > | Newsgroups: microsoft.public.biztalk.general
> | | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | | > | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | | > | Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21678
> | | > | X-Tomcat-NG: microsoft.public.biztalk.general
> | | > |
> | | > | Larry -
> | | > |
> | | > | Your last post was cut off somehow. I don't see any links to your
> | sample.
> | | > | Could you re-post so I can take a look?
> | | > |
> | | > | Thanks,
> | | > | Dave
> | | > |
> | | > | ""larry franks"" wrote:
> | | > |
> | | > | > including sample schemas and map. I tried setting up a simple
> | sample
> | | > and
> | | > | > am not able to reproduce the problem. Can you take a look at
> these
> | | > files
> | | > | > and see if this helps with what you are seeing? If not, would it
> | be
> | | > | > possible to post your project?
> | | > | >
> | | > | >
> | | > | > Larry Franks
> | | > | >
> | | > | > This posting is provided "AS IS" with no warranties,and confers
> no
> | > rights.
> | | > | > Subscribe at
> | | > | >
> | | >
> |
> http://support.microsoft.com/defaul...msdn/nospam.asp
> | | > | > &SD=msdn
> | | > | > --------------------
> | | > | > | X-Tomcat-ID: 621827380
> | | > | > | References: <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> | | > | > | MIME-Version: 1.0
> | | > | > | Content-Type: text/plain
> | | > | > | Content-Transfer-Encoding: 7bit
> | | > | > | From: larryfr@online.microsoft.com ("larry franks")
> | | > | > | Organization: Microsoft
> | | > | > | Date: Thu, 11 Nov 2004 22:09:40 GMT
> | | > | > | Subject: RE: Value Mapping to Root Node
> | | > | > | X-Tomcat-NG: microsoft.public.biztalk.general
> | | > | > | Message-ID: <alCqrsDyEHA.3956@cpmsftngxa10.phx.gbl>
> | | > | > | Newsgroups: microsoft.public.biztalk.general
> | | > | > | Lines: 63
> | | > | > | Path: cpmsftngxa10.phx.gbl
> | | > | > | Xref: cpmsftngxa10.phx.gbl
> microsoft.public.biztalk.general:21571
> | | > | > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
> | | > | > |
> | | > | > | I haven't ran into this before Dave, let me give this a try and
> | see
> | | > what
> | | > | > I
> | | > | > | can find on it.
> | | > | > |
> | | > | > | Larry Franks
> | | > | > |
> | | > | > | This posting is provided "AS IS" with no warranties,and confers
> | no
> | | > | > rights.
> | | > | > | Subscribe at
> | | > | > |
> | | > | >
> | | >
> |
> http://support.microsoft.com/defaul...msdn/nospam.asp
> | | > | > | &SD=msdn
> | | > | > | --------------------
> | | > | > | | Thread-Topic: Value Mapping to Root Node
> | | > | > | | thread-index: AcTHgLIFw1TC/fW5SX6ArfRYIEEdAQ==
> | | > | > | | X-WBNR-Posting-Host: 207.241.20.65
> | | > | > | | From: =?Utf-8?B?ZGF2ZSB2?= <daveV.0711.2828@noemail.nospam>
> | | > | > | | Subject: Value Mapping to Root Node
> | | > | > | | Date: Wed, 10 Nov 2004 15:55:02 -0800
> | | > | > | | Lines: 38
> | | > | > | | Message-ID:
> <5B0D3B40-CF79-4000-A5E8-21B1B99CB655@microsoft.com>
> | | > | > | | MIME-Version: 1.0
> | | > | > | | Content-Type: text/plain;
> | | > | > | | charset="Utf-8"
> | | > | > | | Content-Transfer-Encoding: 7bit
> | | > | > | | X-Newsreader: Microsoft CDO for Windows 2000
> | | > | > | | Content-Class: urn:content-classes:message
> | | > | > | | Importance: normal
> | | > | > | | Priority: normal
> | | > | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | | > | > | | Newsgroups: microsoft.public.biztalk.general
> | | > | > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | | > | > | | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | | > | > | | Xref: cpmsftngxa10.phx.gbl
> | microsoft.public.biztalk.general:21527
> | | > | > | | X-Tomcat-NG: microsoft.public.biztalk.general
> | | > | > | |
> | | > | > | | I have source doc like this:
> | | > | > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapExpanded">
> | | > | > | | <ProdSpec>
> | | > | > | | <Name>Name</Name>
> | | > | > | | <Value>Widget</Value>
> | | > | > | | </ProdSpec>
> | | > | > | | <ProdSpec>
> | | > | > | | <Name>Price</Name>
> | | > | > | | <Value>1000.99</Value>
> | | > | > | | </ProdSpec>
> | | > | > | | <ProdSpec>
> | | > | > | | <Name>Quantity</Name>
> | | > | > | | <Value>550</Value>
> | | > | > | | </ProdSpec>
> | | > | > | | </ns0:Root>
> | | > | > | |
> | | > | > | | Which I can to map to the following using the Value Mapping
> | | > | > (Flattening)
> | | > | > | | functoids:
> | | > | > | | <ns0:Root xmlns:ns0="http://TestBTSStuff.ValueMapFlattened">
> | | > | > | | <Order Product="Widget" Price="550" Qty="1000.99" />
> | | > | > | | </ns0:Root>
> | | > | > | |
> | | > | > | | However, when my target schema has "Order" as the root node,
> | like:
> | | > | > | | <ns0:Order Product="Widget" Price="550" Qty="1000.99"
> | | > | > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
> | | > | > | |
> | | > | > | | The map doesn't work as before. The output looks like:
> | | > | > | | <ns0:Order Product="Widget"
> | | > | > | | xmlns:ns0="http://TestBTSStuff.ValueMapFlattened2" />
> | | > | > | |
> | | > | > | | "Price" and "Quantity" don't map over in this case. In fact,
> it
> | | > will
> | | > | > | always
> | | > | > | | only map the first <ProdSpec> node. The map is exactly the
> same
> | as
> | | > the
> | | > | > | first,
> | | > | > | | without the "Root" node.
> | | > | > | |
> | | > | > | | Does anyone know how to flatten to the root node without
> using
> | > custom
> | | > | > | XSLT?
> | | > | > | |
> | | > | > | | Thanks,
> | | > | > | | Dave
> | | > | > | |
> | | > | > |
> | | > | > |
> | | > |
> | | >
> | |
> |
> |
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com