Skip to Content
author's profile photo Former Member
Former Member

xsl mapping

hi,

how can i make b0101, b0102, b0201, b0202?

b01 in input.xml is static row, only having 2 row;

if you can do in graphical mapping, please guid me.

xslt

-


<?xml version="1.0" encoding="UTF-8"?>

http://www.w3.org/1999/XSL/Transform" xmlns:ns0=" http://www.test.net/test01">

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

<xsl:template match="/">

<ns0:mapping01t_mt>

<mapping>

<h01>

<xsl:value-of select="ns0:mapping01s_mt/maproot/h01"/>

</h01>

<h02>

<xsl:value-of select="ns0:mapping01s_mt/maproot/h02"/>

</h02>

<b0101></b0101>

<b0102></b0102>

<b0201></b0201>

<b0202></b0202>

</mapping>

</ns0:mapping01t_mt>

</xsl:template>

</xsl:stylesheet>

input.xml

-


<?xml version="1.0" encoding="UTF-8"?>

http://www.test.net/test01">

<maproot>

<h01>zh01</h01>

<h02>zh02</h02>

<b01>

<b0101>zb0101</b0101>

<b0102>zb0102</b0102>

</b01>

<b01>

<b0201>zb0201</b0101>

<b0202>zb0202</b0102>

</b01>

</maproot>

</ns0:mapping01s_mt>

output.xml

-


<?xml version="1.0" encoding="UTF-8"?>

http://www.test.net/test01">

<mapping>

<h01>zh01</h01>

<h02>zh02</h02>

<b0101>zb0101</b0101>

<b0102>zb0102</b0102>

<b0201>zb0201</b0201>

<b0202>zb0202</b0202>

</mapping>

</ns0:mapping01t_mt>

thanks

venjamin

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Oct 13, 2006 at 03:08 AM

    Hi,

    Try this XSL

    <?xml version="1.0" encoding="UTF-8"?>

    http://www.w3.org/1999/XSL/Transform" xmlns:ns0=" http://www.test.net/test01">

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

    <xsl:template match="/">

    <ns0:mapping01t_mt>

    <mapping>

    <h01>

    <xsl:value-of select="ns0:mapping01s_mt/maproot/h01"/>

    </h01>

    <h02>

    <xsl:value-of select="ns0:mapping01s_mt/maproot/h02"/>

    </h02>

    <b0101>

    <xsl:value-of select="ns0:mapping01s_mt/maproot/b01[1]/b0101"/>

    </b0101>

    <b0102>

    <xsl:value-of select="ns0:mapping01s_mt/maproot/b01[1]/b0102"/>

    </b0102>

    <b0201>

    <xsl:value-of select="ns0:mapping01s_mt/maproot/b01[2]/b0201"/>

    </b0201>

    <b0202>

    <xsl:value-of select="ns0:mapping01s_mt/maproot/b01[2]/b0202"/>

    </b0202>

    </mapping>

    </ns0:mapping01t_mt>

    </xsl:template>

    </xsl:stylesheet>

    Thanks,

    Prakash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 13, 2006 at 05:41 PM

    Hi,

    This might help you

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/how%20to%20create%20an%20xslt%20mapping%20file

    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

    /people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario

    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners

    Regards

    Agasthuri Doss

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.