|
Home > Archive > BizTalk Server General > February 2005 > XmlNode as the custom functoid input
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 |
XmlNode as the custom functoid input
|
|
|
| I have an input XML as below
<Book>
<BookType>English</BookType>
<Name>Intro to English</Name>
</Book>
<Book>
<BookType>Science</BookType>
<Name>Intro to Science</Name>
</Book>
<Book>
<BookType>History</BookType>
<Name>Intro to History</Name>
</Book>
and the output should look like
<English>
<Name>Intro to English</Name>
</English>
<Science>
<Name>Intro to English</Name>
</Science>
<History>
<Name>Intro to History</Name>
</History>
Iam trying to build a custom funtoid to accept XmlNode and give the output
values as strings.Anybody know how to define XmlNode as the input param for
the custom functoids?
Thanks
Raj
| |
| Phillip Evans 2005-02-01, 5:59 pm |
| G'day Raj.
I am also trying to write a custom functoid that takes an XMLNode as input.
My fallback plan is to create a functoid that spits out an XSLT fragment to
do what I need done (and I think this would work for you).
I was wondering if you had managed to find an answer to your query (below)?
If so, would you mind sharing it please? It looks to me like custom
functoids can't access the XML DOM at all but the Mass Copy functoid clearly
IS doing it so it must be possible (whether it's supported or not is an
entirely different question).
Thanks in anticipation,
Phil.
"Raj" <Raj@discussions.microsoft.com> wrote in message
news:95E39B8B-52D7-4228-B81A-C7A89A6D963D@microsoft.com...
>I have an input XML as below
>
> <Book>
> <BookType>English</BookType>
> <Name>Intro to English</Name>
> </Book>
> <Book>
> <BookType>Science</BookType>
> <Name>Intro to Science</Name>
> </Book>
> <Book>
> <BookType>History</BookType>
> <Name>Intro to History</Name>
> </Book>
>
> and the output should look like
>
> <English>
> <Name>Intro to English</Name>
> </English>
> <Science>
> <Name>Intro to English</Name>
> </Science>
> <History>
> <Name>Intro to History</Name>
> </History>
>
>
> Iam trying to build a custom funtoid to accept XmlNode and give the output
> values as strings.Anybody know how to define XmlNode as the input param
> for
> the custom functoids?
> Thanks
> Raj
>
| |
|
| Hi Phil,
Unfortunately I couldnt pass a XML node structure to a custom functoid. Per
my understanding, a custom functoid is no different than a scripting functoid
being called from within the XSLT. When we call a functoid, we can pass in
either the value of the node or the the name of the node, not the node
itself. Iam not sure how the Mass functoid does it though!Also, the mass
functoid makes me believe that its possible but all my effort was no good.I
tried by changing the appropriate connection type for the
AddInputConnectionType method and the input argument type for the function it
gets called but no good :-(
Anyhow, I was able to satisfy my requirement with a combination of advanced
fucntoids and logical functoids.
Incase if you didnt know, the best thing for debugging a map is to check the
XSLT generated out during validating map files and by looking at the XSLT, we
can get a much clear picture of what each functoid does!
Use the scripting functoid with Inline XLST incase if you couldnt get it
working by Biztalk default /custom functoids.
Thanks
Raj
"Phillip Evans" wrote:
> G'day Raj.
>
> I am also trying to write a custom functoid that takes an XMLNode as input.
>
> My fallback plan is to create a functoid that spits out an XSLT fragment to
> do what I need done (and I think this would work for you).
>
> I was wondering if you had managed to find an answer to your query (below)?
>
> If so, would you mind sharing it please? It looks to me like custom
> functoids can't access the XML DOM at all but the Mass Copy functoid clearly
> IS doing it so it must be possible (whether it's supported or not is an
> entirely different question).
>
> Thanks in anticipation,
>
> Phil.
>
>
>
> "Raj" <Raj@discussions.microsoft.com> wrote in message
> news:95E39B8B-52D7-4228-B81A-C7A89A6D963D@microsoft.com...
>
>
>
>
| |
| Phillip Evans 2005-02-02, 2:50 am |
| Thanks Raj.
I reckon it looks like the Mass Copy functoid cheats and gets access to the
functoid inputs at generation time. I can't see any way for a custom
functoid to access that information (happy for someone to prove me wrong).
So I've created a custom functoid that implements an XSLT call template. I
pass into it the name of the node I care about (by changing the link type
from "copy text value" to "copy name") and then use that at runtime to
essentially generate what the custom functoids are generating. Using this
technique I could copy the behaviour of the Mass Copy functoid (but not the
implementation).
Thanks for the pointer on the generated XSLT. Unfortunately I had already
needed to acquaint myself with that functionality.
Phil.
"Raj" <Raj@discussions.microsoft.com> wrote in message
news:104612B8-A7D8-4962-8CC1-B79C4B3A6C48@microsoft.com...[vbcol=seagreen]
> Hi Phil,
> Unfortunately I couldnt pass a XML node structure to a custom functoid.
> Per
> my understanding, a custom functoid is no different than a scripting
> functoid
> being called from within the XSLT. When we call a functoid, we can pass
> in
> either the value of the node or the the name of the node, not the node
> itself. Iam not sure how the Mass functoid does it though!Also, the mass
> functoid makes me believe that its possible but all my effort was no
> good.I
> tried by changing the appropriate connection type for the
> AddInputConnectionType method and the input argument type for the function
> it
> gets called but no good :-(
> Anyhow, I was able to satisfy my requirement with a combination of
> advanced
> fucntoids and logical functoids.
> Incase if you didnt know, the best thing for debugging a map is to check
> the
> XSLT generated out during validating map files and by looking at the XSLT,
> we
> can get a much clear picture of what each functoid does!
> Use the scripting functoid with Inline XLST incase if you couldnt get it
> working by Biztalk default /custom functoids.
> Thanks
> Raj
>
> "Phillip Evans" wrote:
>
|
|
|
|
|