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 7594313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:23:07+00:00 2026-05-30T21:23:07+00:00

I have a source list of xml in this format: <metadata> <metadatum> <description>OnEnter</description> <value>Hello

  • 0

I have a source list of xml in this format:

<metadata>
  <metadatum>
    <description>OnEnter</description>
    <value>Hello World</id>
  </metadatum>
  <metadatum>
    <description>OnLeave</description>
    <value>Goodbye World</id>
  </metadatum>
</metadata>

and a target structure like this:

<friendlyText>
  <onEnter>[Content Here]</onEnter>
  <onLeave>[Content Here]</onLeave>
</friendlyText>

Is it possible to create an XSLT that will map the ‘value’ field in the metadata hierarchy to the proper target node depending on the source ‘description’?

I’m trying to get this done with Altova MapForce; it feels like there should be an interface to allow this, I’m just not finding it.

  • 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-05-30T21:23:08+00:00Added an answer on May 30, 2026 at 9:23 pm

    This transformation is a general solution that can work with any “target structure” that is in a separate XML document:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:my="my:my" exclude-result-prefixes="my">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:variable name="vUpper" select=
      "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
     <xsl:variable name="vLower" select=
      "'abcdefghijklmnopqrstuvwxyz'"/>
    
     <my:target>
      <friendlyText>
        <onEnter>[Content Here]</onEnter>
        <onLeave>[Content Here]</onLeave>
      </friendlyText>
     </my:target>
    
     <xsl:variable name="vTarget" select="document('')/*/my:target/*"/>
    
     <xsl:variable name="vMeta" select="/*/metadatum"/>
    
     <xsl:template match="node()|@*">
         <xsl:copy>
           <xsl:apply-templates select="node()|@*"/>
         </xsl:copy>
     </xsl:template>
    
     <xsl:template match="/">
         <xsl:apply-templates select="$vTarget"/>
     </xsl:template>
    
     <xsl:template match="friendlyText/*/text()">
      <xsl:value-of select=
      "$vMeta[translate(description, $vLower, $vUpper)
            =
              translate(name(current()/..), $vLower, $vUpper)
              ]/value"/>
     </xsl:template>
    </xsl:stylesheet>
    

    when applied on the provided XML document (corrected to be made well-formed):

    <metadata>
        <metadatum>
            <description>OnEnter</description>
            <value>Hello World</value>
        </metadatum>
        <metadatum>
            <description>OnLeave</description>
            <value>Goodbye World</value>
        </metadatum>
    </metadata>
    

    produces the wanted, correct result:

    <friendlyText xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="my:my">
       <onEnter>Hello World</onEnter>
       <onLeave>Goodbye World</onLeave>
    </friendlyText>
    

    Do note: Only for convenience, the “target structure” is inline here. In a real world case it would be better to keep the “target structure” in a separate file and to load it using the document() function. Only the line:

     <xsl:variable name="vTarget" select="document('')/*/my:target/*"/>
    

    will need to be changed to:

     <xsl:variable name="vTarget" select="document('someFileUrl')/*"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WinForms .NET datagrid whose data source is a List<cLineItem> called lines.
Some open source libraries have tendency to re implement basic structures like string, list,
Suppose I have two lists that holds the list of source file names and
I have a small application that uses a SharePoint list as the data source.
Have a source xml document that uses namespace containing prefixes and a default namespace.
I have XML in the following format: <Products> <Product name=MyProduct1> <Components> <Component name=MyComponent1> <Teams>
I have two projects: Project-Core Project-Source Project-Core POM.xml: <groupId>com.company</groupId> <artifactId>project-core</artifactId> <packaging>jar</packaging> <version>2.1</version> Project-Source POM.xml:
I have this XML file that I parse into its elements and create a
i have this xpath defined for moxy in a jaxb class @XmlPath(child::*/REG) public List
I'm not even sure if it's possible but say I have some XML: <source>

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.