|
Home > Archive > BizTalk Server Tools > July 2004 > Dereference IDREF within BizTalk 2004 mapper?
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 |
Dereference IDREF within BizTalk 2004 mapper?
|
|
| Andrew P. Brown 2004-06-09, 8:31 am |
| Is there a way to follow an IDREF link in the BizTalk mapper?
If, for example, I have something like this:
<root>
<customer customerid="customer1" account="12345"/>
<item customerid="customer1" upc="foo"/>
<item customerid="customer2" upc="bar"/>
</root>
where customerid is defined as an ID in customer and an IDREF in item. I
would like to put out:
<root2>
<ItemEntry upc="foo" account="12345"/>
<ItemEntry upc="bar" account="12345"/>
</root2>
In a case like this that the relationship is predictable (say, the IDREF
from an item will always reference a sibling customer element) you don't
necessarily need to dereference the IDREF. In straight XSLT, you could just
use a reasonably simple XPath expression (e.g. //customer[@customerid =
current()/@customerid]/@account). If you do this a lot, you could optimize
this with an xsl:key.
If the IDREF can point to any ID in the document, though, that doesn't work
and you need to use the XPath id() function (to actually dereference the
IDREF).
How would I do this in the mapper:
1) In the simplified case that I list above?
2) When you truly need to do something like the XPath id()?
Andy
| |
| Prasad Sripathi Panditharadhya [MSFT] 2004-06-26, 10:53 am |
| Andrew,
I dont think there is any straight forward way of doing this in mapper. You
will probably have to use a Scripter Functoid (and use either Inline-XSLT
or Call-Template options and write some xslt which does this job)
Thanks...
--------------------[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl[vbcol=seagreen]
just[vbcol=seagreen]
work[vbcol=seagreen]
This posting is provided "AS IS" with no warranties, and confers no rights.
EBusiness Server Team
| |
| Andrew P. Brown 2004-06-28, 7:28 pm |
| Thanks for the reply. That is what I had ended up doing.
By defining a Scripter Functoid of type "Inline XSLT Call Template" with no inputs and no outputs I was able to emit an xsl:key statement. I then use it from other XSLT scripter functoids.
This definitely feels like a hack as I get a warning due to the functoid with no outputs. It is also annoying that XSLT scripter functoids don't put out the output tag.
At first I thought that XSLT functoids in BTS 2004 would be great, but they're so limited and painful to use that they really feel like an option of last resort. (I'm still glad that option is there as I don't know how I would have done this at all in BTS
2000).
Andy
"Prasad Sripathi Panditharadhya [MSFT]" wrote:
> Andrew,
> I dont think there is any straight forward way of doing this in mapper. You
> will probably have to use a Scripter Functoid (and use either Inline-XSLT
> or Call-Template options and write some xslt which does this job)
>
> Thanks...
> --------------------
> cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
> .phx.gbl
> just
> work
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> EBusiness Server Team
>
>
| |
| Tatyana Yakushev [MSFT] 2004-07-01, 5:52 pm |
|
--------------------
>Thread-Topic: Dereference IDREF within BizTalk 2004 mapper?
>thread-index: AcRdUTPy0YnbFZmpRzmSAuLOt85jEw==
>X-WBNR-Posting-Host: 209.180.28.6
>From: =?Utf-8?B?QW5kcmV3IFAuIEJyb3du?= <Andrew P. Brown@discussions.microsoft.com>
>References: <u3h5J2dTEHA.1508@TK2MSFTNGP11.phx.gbl> <TIml$XhWEHA.304@cpmsftngxa10.phx.gbl>
>Subject: RE: Dereference IDREF within BizTalk 2004 mapper?
>Date: Mon, 28 Jun 2004 13:48:01 -0700
>Lines: 84
>Message-ID: <A46C791C-B489-444F-BBD9-92559A36B6E7@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.tools
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 127.0.0.1
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.tools:3840
>X-Tomcat-NG: microsoft.public.biztalk.tools
>
>Thanks for the reply. That is what I had ended up doing.
>
>By defining a Scripter Functoid of type "Inline XSLT Call Template" with no inputs and no outputs I was able to emit an xsl:key statement. I then use it from other XSLT
scripter functoids.
>
>This definitely feels like a hack as I get a warning due to the functoid with no outputs. It is also annoying that XSLT scripter functoids don't put out the output tag.
>
>At first I thought that XSLT functoids in BTS 2004 would be great, but they're so limited and painful to use that they really feel like an option of last resort. (I'm still glad that
option is there as I don't know how I would have done this at all in BTS 2000).
>
>Andy
>
>"Prasad Sripathi Panditharadhya [MSFT]" wrote:
>
>
--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
|
|
|
|
|