Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8106345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:26:18+00:00 2026-06-06T00:26:18+00:00

I’ve got a mapping issue which I’m trying to solve in the mapping tool

  • 0

I’ve got a mapping issue which I’m trying to solve in the mapping tool of BizTalk.

Consider the following input file:

<person>
    <ID>APersonID</ID>
    <relatives>
        <relative>
            <name>Relative name 1</name>
        </relative>
        <relative>
            <name>Relative name 2</name>
        </relative>
    </relatives>
</person>

Note: minOccurs of the relative element is set to 0 and the maxOccurs of the relative element is set to unbounded.

This input should be mapped to the following output:

<relatives>
    <person>
        <ID>APersonID</ID>
        <relative>Relative name 1</relative>
    </person>
    <person>
        <ID>APersonID</ID>
        <relative>Relative name 2</relative>
    </person>
<relatives>

Note: The person element has a minOccurs of 1 and a maxOccurs of unbounded.

I’ve got the mapping to work with a Looping functoid that links the relative element of the input file to the person element in the output file.But now there is a situation in which I’m given the following input file:

<person>
    <ID>APersonID</ID>
    <relatives />
</person>

Which should be mapped to

<relatives>
    <person>
        <ID>APersonID</ID>
    </person>
<relatives>

My current mapping can’t handle this situation. Can somebody give suggestions on how to make/edit the mapping so that both situations can work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:26:19+00:00Added an answer on June 6, 2026 at 12:26 am

    Things are a bit more complex than at first seems since we need to test for existence of at least one relatives/relative before progressing. I can’t think of any other way than to use XSLT – see here on how to extract the XSLT from your map and change the BTM to use an XSLT instead of the visual function mapping.

    The following XSLT

    <?xml version="1.0" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxsl="urn:schemas-microsoft-com:xslt"
        xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var"
        exclude-result-prefixes="msxsl var"
        version="1.0"
        xmlns:ns0="http://BizTalk_Server_Project5.Schema1">
        <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
        <xsl:template match="/">
            <xsl:apply-templates select="/ns0:person" />
        </xsl:template>
        <xsl:template match="/ns0:person">
            <relatives>
                <xsl:variable name="personId" select="ns0:ID/text()" />
                <xsl:choose>
                    <xsl:when test="not(ns0:relatives) or not(ns0:relatives/ns0:relative)">
                        <person>
                            <ID>
                                <xsl:value-of select="$personId" />
                            </ID>
                        </person>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:for-each select="ns0:relatives/ns0:relative">
                            <person>
                                <ID>
                                    <xsl:value-of select="$personId" />
                                </ID>
                                <relative>
                                    <xsl:value-of select="ns0:name/text()" />
                                </relative>
                            </person>
                        </xsl:for-each>
                    </xsl:otherwise>
                </xsl:choose>
            </relatives>
        </xsl:template>
    </xsl:stylesheet>
    

    Produces the output you’ve described. (Obviously change your namespaces to match, and I’ve assumed you’ve got elementFormDefault="qualified" (If not, drop the ns0 prefixes)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I am trying to render a haml file in a javascript response like so:
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.