BizTalk Server General - Mapping question - Urgent!!! Please!!!

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > March 2005 > Mapping question - Urgent!!! Please!!!





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 Mapping question - Urgent!!! Please!!!
Emad

2005-03-24, 2:50 am

I really need help and very soon....

I have a source schema that look like this
<root>
<level1>
<level2>
<level3>
<field1/>
</level3>
</level>
</level>
</root>

level3 repeats unbound in level2. I would like to extract field1 from
level3 but only the one from last level3 record. I tried doing a record
count on level3 but that counts the entire document instead of the countr
inside level2.

So if my source looks like this:
<root>
<level1>
<level2>
<level3>
<field1>red</field1
</level3>
<level3>
<field1>white</field1
</level3>
<level3>
<field1>blue</field1
</level3>
</level>
</level>
</root>

I want it to map to:

<root>
<level1>
<level2>
<field1>blue</field1
</level>
</level>
</root>


I understand most of the concept but I am really weak with xslt, so please
explain.

- Can I do a record count on level3 inside level2 instead of throughout the
document?
- Can I use inline xslt to do that? And how would I do it?

Thanks.

-Emad
Thanks...


Radim Hampel

2005-03-24, 7:51 am

"Emad" wrote:
> I really need help and very soon....
> - Can I do a record count on level3 inside level2 instead of throughout the
> document?
> - Can I use inline xslt to do that? And how would I do it?


Hello Emad,

yes, you could use record couning here, but better way would be to used
Last() xslt function. Inline xslt script would be something like:

<xsl:for-each select="/root/level1/level2/level3">
<xsl:if test="position() = last()">
<output>
<xsl:value-of select="field1" />
</output>
</xsl:if>
</xsl:for-each>

Hth,

Radim Hampel
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com