cancel
Showing results for 
Search instead for 
Did you mean: 

xslt

Former Member
0 Kudos

hi experts,

i am doing xslt mapping, in htat i am trying to map two fields from source to one target feild.

fname, lname to name

how can i do it

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Déjà vu...

Answers (2)

Answers (2)

udo_martens
Active Contributor
0 Kudos

xi consult (?),

<name><xsl:value-of select="//fname"/><xsl:value-of select="//lname"/></name>

Regards,

Udo

justin_santhanam
Active Contributor
0 Kudos

Hey,

Refer this

[code]

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:n1="urn:xitest:Scenario" xmlns="urn:xitest:Scenario" xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="fn n1 xs">

<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

<xsl:template match="/n1:MT_In">

<MT_Out>

<xsl:attribute name="xsi:schemaLocation">urn:xitest:Scenario C:/MT_Out.xsd</xsl:attribute>

<Record xmlns="">

<xsl:for-each select="Record">

<xsl:variable name="VmarkerloopRecord" select="."/>

<xsl:for-each select="Fname">

<xsl:variable name="VmarkerloopFname" select="."/>

<xsl:for-each select="$VmarkerloopRecord/Lname">

<xsl:variable name="VmarkerloopLname" select="."/>

<xsl:variable name="Vvar7_RESULTOF_concat" select="fn:concat(fn:string( $VmarkerloopFname ), fn:string( $VmarkerloopLname ))"/>

<Name>

<xsl:value-of select="fn:string( $Vvar7_RESULTOF_concat )"/>

</Name>

</xsl:for-each>

</xsl:for-each>

</xsl:for-each>

</Record>

</MT_Out>

</xsl:template>

</xsl:stylesheet>

[/code]

<b>By the way , use Altova Map force, the above code is generated using that.</b>

-raj.