on 02-26-2009 9:23 AM
Hi ,
Experts,
I am new to XSLT coding as iam doing File to File XSLT Mapping for i have created IR and ID part and i have wriiten XSLT codeing which is not working.
source structure: Target structure
Fname Name = (Fname+Lname)
Lname
maths
science Total_marks = (mathssciencesocial)
social
<?xml version='1.0' ?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" xmlns:aash="http://xlst.file2file" xmlns:ns0="http://xlst.file2file">
<xsl:template match="/"> |
<aash:mt_student_result> this is my Naming Space
<Data>
<Name>
<xsl:value-of select="concat(ns0:mt_student/data/FName,ns0:mt_student/data/LName)"/>
</Name>
<Marks>
<Total_Marks>
<xsl:value-of select="(ns0:mt_student/data/Marks/Maths)(ns0:MT_Student/Data/Marks/Science)(ns0:mt_student/data/Marks/Social)"/>
</Total_Marks>
</Marks>
</Data>
</aash:mt_student_result>
</xsl:template>
</xsl:transform>
while testing in Interface mapping the values are not comming into result side please verify the code and suggest me the correct one.
Thanks in advance
shabeer ahmed.
Hi Shabeer,
PFB, the corrected XSL.
try using it, it would work.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" xmlns:aash="http://xlst.file2file" xmlns:ns0="http://xlst.file2file">
<xsl:template match="/"> |
<aash:mt_student_result> this is my Naming Space
<Data>
<Name>
<xsl:variable name="vFName" select="ns0:mt_student_result/Data/FName"/>
<xsl:variable name="vLName" select="ns0:mt_student_result/Data/LName"/>
<xsl:value-of select="concat($vFName,$vLName)"/>
</Name>
<Marks>
<Total_Marks>
<xsl:variable name="vMaths" select="ns0:mt_student_result/Data/Marks/Maths"/>
<xsl:variable name="vScience" select="ns0:mt_student_result/Data/Marks/Science"/>
<xsl:value-of select="concat($vMaths,$vScience)"/>
</Total_Marks>
</Marks>
</Data>
</aash:mt_student_result>
</xsl:template>
</xsl:transform>
I have given input as,
<?xml version="1.0" encoding="UTF-8"?>
<ns0:mt_student_result xmlns:ns0="http://xlst.file2file">
<Data>
<FName>FName</FName>
<LName>LName</LName>
<Marks>
<Maths>M</Maths>
<Science>S</Science>
</Marks>
</Data>
</ns0:mt_student_result>
Output was,
<?xml version='1.0' ?>
|
<aash:mt_student_result xmlns:sap="http://www.sap.com/sapxsl" xmlns:ns0="http://xlst.file2file" xmlns:aash="http://xlst.file2file"> this is my Naming Space
<Data><Name>FNameLName</Name><Marks><Total_Marks>MS</Total_Marks></Marks></Data></aash:mt_student_result>
It worked.Try it out.
Regards,
Swetha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.