Help! XSLT

I have been searching Oracle sites for 2 days on XSLT. I am writing an interface (over 20 actually) What I want to do is generate xml fragments and zip them together dynamically. The XSLT isn't necessarily the difficult part, just getting Oracle to do it from xmltype variables instead of files on disk. Am I going to have to write java classes to do this?

Thanks for your reply pepijn. Unfortunately, that doesn't work. This is a sample of that solution:
DECLARE
targetxml sys.xmltype;
sourcexml sys.xmltype;
xsltsrc sys.xmltype;
reslt VARCHAR2(4000);
BEGIN
newxml := xmltype.createxml('<HELLO>Hello World</HELLO>');
SELECT msg_txt INTO sourcexml FROM interface_messages WHERE interface_msg_seq_no = 1459550; -- XML source
xsltsrc := xmltype.createxml('<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">'||
' <xsl:output method="xml" indent="yes"/>'||
'<xsl:template match="/">'||
' <xsl:copy>'||
' <xsl:copy-of select="document(sourcexml)/*" />'||
' <xsl:copy-of select="document(targetxml)/*" />'||
' </xsl:copy>'||
'</xsl:template>'||
'</xsl:stylesheet>');
sourcexml := newxml.transform(xsltsrc);
reslt := sourcexml.getstringval(); -- print the result
dbms_output.put_line(substr(reslt, -1, 255));
END;
This throws Ora - 30625 method dispatch on a NULL SELF argument. In other words, sourcexml was null. What I want to happen is take sourcexml and merge/add newxml to it using the xslt. The xml selected from the table is just a sample xml. What I want (need) to do is generate xml (select xmlelement(....)) in several segments and depending on the requirements assemble them together. XSLT appears to be the best method, but Oracle's XSLT parser only reads files. and the transform function and method take only 1 xml parameter.
Sigh!
Dean

Similar Messages

  • Help XSLT Data Mapper and Transformations

    Hi guys,
    I need help in oracle ESB (XSLT Data Mapper and Transformations). I need to use the XSLT Data Mapper and Transformations using Response XML to Request XML.
    Thanks
    Vyas

    The concept is the same as BPEL. Without going into too much detail have a look at the folowing tutorial.
    http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28212/buildendtoend.htm#BEICEFJD
    Near the bottom they show how to do transformations.
    cheers
    James

  • Where is XSLT Transformation located

    I am trying to do an XSLT Transformation, but I have no idea where to look for this - the only area with a note about where to find this tool is to select Foundation - XSLT Transformation, but I don't have that option - I found File, New, Process, Category = Foundation, but I never find any reference to XSLT Transformation.  Any suggestions would be helpful.

    XSLT Transformation is a service under the category of Foundation.  You can drag it from the Services panel onto your process OR drag on an Activity and type XSLT in the find field.   Choose the XSLT-Transformation from the Foundation category

  • XSLT mapping Help Required.

    XSLT mapping Help Required.
    Hi Experts,
    I am New to XSLT Mapping. I am practising the below Example:
    InputXML File:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
    <Person>
    <FirstName>Anshul</FirstName>
    <LastName>Chowdhary</LastName>
    <Gender>Male</Gender>
    <Address>
    <Street>2nd Main</Street>
    <Houseno>83/b</Houseno>
    <City>Mysore</City>
    </Address> </Person>
    </ns0:MT_XSLT_Source>
    XSL StyleSheet File:
    <?xml version='1.0' encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/Gen"
    Xmlns:ns1=”http://XYZ.com/Test”>
    <xsl:template match="/">
    <ns1:MT_XSLT_Target>
    <Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
    <Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
    </Name>
    <Street> <xsl:value-of select="concat(concat(ns0:Mt_XSLT_Source/Person/Address/Houseno,' '),
    ns0:Mt_XSLT_Source/Person/Address/Street)"/> </Street>
    <City> <xsl:value-of select="ns0:Mt_XSLT_Source/Person/Address/City"/> </City>
    </ns1:MT_XSLT_Target>
    </xsl:template>
    </xsl:stylesheet>
    The Desired Output shuold be:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_XSLT_Target xmlns:ns1="http://XYZ.com/Test">
    <Title>Male</Title>
    <Name>Anshul Chowdhary</Name>
    <Street>83/b 2nd Main</Street>
    <City>Mysore</City>
    </ns1:MT_XSLT_Target>
    I have refered the xsl in xml and i am getting the below Oupt in a Single line like this:
    Anshul Chowdhary Male 2nd Main 83/b Mysore
    I am Unable to display in Target XML Fomrat as shown above. Please check and do the needful.
    Regards,
    GIRIDHAR

    Hi,
    I have used below for testing.
    Input xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
    <Person>
    <FirstName>Anshul</FirstName>
    <LastName>Chowdhary</LastName>
    <Gender>Male</Gender>
    <Address>
    <Street>2nd Main</Street>
    <Houseno>83/b</Houseno>
    <City>Mysore</City>
    </Address> </Person>
    </ns0:MT_XSLT_Source>
    xsl code:
    <?xml version='1.0' encoding="UTF-8"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/gen" 
        xmlns:ns1="http://XYZ.com/Test"> 
        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> 
        <xsl:template match="/"> 
            <ns1:MT_XSLT_Target> 
                <Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title> 
                <Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/> 
                </Name> 
                <Street> <xsl:value-of select="concat(concat(/ns0:MT_XSLT_Source/Person/Address/Houseno,' '), 
                    /ns0:MT_XSLT_Source/Person/Address/Street)"/> </Street> 
                <City> <xsl:value-of select="/ns0:MT_XSLT_Source/Person/Address/City"/> </City> 
            </ns1:MT_XSLT_Target> 
        </xsl:template> 
    </xsl:stylesheet>
    For testing in PI ,change the extension from .txt to .xsl and zip it and upload into PI as an imported archive .
    Regards
    Venkat

  • XSLT mapping with Java helper classes

    Hi,
    I'm trying to implement a XSLT mapping to convert my request to a specific soap request message format for this I'm calling some methods from a java helper class. I have imported the jar file into the archives. When I tried to test the interface it keeps complaing there is some exception but doesn't give me the exact error. Has any one called any java helper classes with in XSLT mapping, if so I would appreciate if you could help me with this. Here is the code from xsl.
    <wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"   xmlns:UserToken="java:com.company.test.mapping.UserTokenMap">
    <wsse:UsernameToken>
        <wsse:Username xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
          <xsl:value-of select="UserToken:getUsername()"/>
        </wsse:Username>
        <wsse:Password wsse:Type="wsse:PasswordDigest" xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
        <xsl:value-of select="UserToken:getPasswordDigest()"/>
        </wsse:Password>
        <wsse:Nonce xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
        <xsl:value-of select="UserToken:getNonce()"/>
        </wsse:Nonce>
        <wsu:Created xsi:type="soapenc:string" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
        <xsl:value-of select="UserToken:getCreateDate()"/>
    </wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    Thanks,
    Joe

    Hi,
    I'm getting following exception when I refer to the java class with in my XSLT mapping. Any one encountered the same problem.
    com.sap.engine.services.ejb.exceptions.BaseRemoteException:
    Exception in method transform.
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:218)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:104)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native
    Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.UnsupportedClassVersionError:
    com/earthlink/xi/mapping/UserTokenMap (Unsupported
    major.minor version 49.0)
         at java.lang.ClassLoader.defineClass0(Native
    Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingLoader.findClass(RepMappingLoader.java:175)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33)
         at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:69)
         at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43)
         at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51)
         at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:76)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
         at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
         at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431)
         at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394)
         at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398)
         at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingTransformer.transform(RepMappingTransformer.java:150)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepXSLTMapping.execute(RepXSLTMapping.java:81)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepSequenceMapping.execute(RepSequenceMapping.java:54)
         at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80)
         at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107)
         at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127)
         at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40)
         at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:167)
         ... 10 more
    ; nested exception is:
         java.lang.UnsupportedClassVersionError:
    com/earthlink/xi/mapping/UserTokenMap (Unsupported
    major.minor version 49.0)

  • Help in XSLT Mapping

    Hi mates,
    I'm trying out the scenario in one of michal's blogs
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    my source message is as follows
    <i><?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_ErrorDetails xmlns:ns0="http://xyz.com/utility/errors/ReportErrors">
       <Object_Error>
          <Client/>
          <Logical_System/>
          <Object_Type/>
          <Object_Key>1234</Object_Key>
          <Error_Message/>
       </Object_Error>
       <Object_Error>
          <Client/>
          <Logical_System/>
          <Object_Type/>
          <Object_Key>1235</Object_Key>
          <Error_Message/>
       </Object_Error>
    </ns0:MT_ErrorDetails></i>
    I'm trying to generate o/p which will have 'Object_key's separated by line break i.e. new line.
    I wrote teh following XSLT code in XSLT_TOOL.
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
    >
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
    <html>
    <body>
    </body>
    <p>
    <strong>The following is the list of Material Numbers with errors</strong>
    </p>
    <p>
    <ol>
    <xsl:for-each select="Object_Error">
    <li value="0">
    <xsl:value-of select="Object_Key"/>
    </li>
    </xsl:for-each>
    </ol>
    </p>
    </html>
    </xsl:template>
    </xsl:transform>
    I wrote this based on XSLT mapping given in the blog. But my mapping is not giving me the required result. It gives the following o/p.
    <i><html><body></body><p><strong>The following is the list of Material
    Numbers with errors</strong></p><p><ol></ol></p></html></i>
    It doesnt select the 'Object Key's. What is wrong/missing in the XSLT mapping..XSLT gurus please help out this beginner.
    I highly appreciate your inputs.
    thx in adv
    praveen

    Hi Praveen,
    I think the reference in your loop is not correct.
    Try
    <xsl:for-each select="Object_Error/Object_Key">
    <li value="0">
    <xsl:value-of select="."/>
    </li>
    </xsl:for-each>
    or
    <xsl:for-each select="Object_Error">
    <li value="0">
    <xsl:value-of select="./Object_Key"/>
    </li>
    </xsl:for-each>
    both should work.
    regards
    Dirk

  • Need help in XSLT

    Hi all, I am working on xslt for the xml document which is similar to this :-
    <?xml version="1.0" encoding="UTF-8"?>
         <soapenv:Envelope      xmlns:soapenv="peopledirectory">
         *<soapenv:Header/>*
         <soap-env:Body      xmlns:soap-env="propleaccess">
         <medi:MEDI_DEV_OSB_POCOutputCollection      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:medi="http://xmlns.oracle.com/pcbpel/adapter/db/MEDI_DEV_OSB_POC">
    <medi:MEDI_DEV_OSB_POCOutput>
         <medi:STUDYID>123</medi:STUDYID>
         <medi:DOMAIN>CTS</medi:DOMAIN>
    </medi:MEDI_DEV_OSB_POCOutput>
    <medi:MEDI_DEV_OSB_POCOutput>
         <medi:STUDYID>123</medi:STUDYID>
         <medi:DOMAIN>CTS</medi:DOMAIN>
    </medi:MEDI_DEV_OSB_POCOutput>
         </medi:MEDI_DEV_OSB_POCOutputCollection>
         </soap-env:Body>
         </soapenv:Envelope>
    In the above xml if you observe the part in Bold it is an element which is closed inside the envelope with no matter in it.. I wonder how to go beyond this <Header/> element using
    xpath so as to select it in the template tag. I need the result xml should be somethiing like the below :-
    <?xml version="1.0" encoding="UTF-8"?>
         <soapenv:Envelope      xmlns:soapenv="peopledirectory">
         <soapenv:Header/>
         <soap-env:Body      xmlns:soap-env="propleaccess">
         <medi:MEDI_DEV_OSB_POCOutputCollection      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:medi="http://xmlns.oracle.com/pcbpel/adapter/db/MEDI_DEV_OSB_POC">
    <medi:MEDI_DEV_OSB_POCOutput>
    <NewElement1 name = STUDENTID value = 123/>
    <NewElement2 name = DOMAIN value = CTS/>
    </medi:MEDI_DEV_OSB_POCOutput>
    Something like this...
    To achieve this I wrote the below xslt
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:soapenv="peopledirectory" xmlns:soap-env="propleaccess          xmlns:medi="http://xmlns.oracle.com/pcbpel/adapter/db/MEDI_DEV_OSB_POC">
    <xsl:output method = "xml" intend = "yes"/>
    <xsl:template match = "soapenv:Envelope/soapenv:Header"></xsl:template>
    <xsl:template match = "soapenv:Envelope/soap-env:Body/medi:MEDI_DEV_OSB_POCOutputCollection/medi:MEDI_DEV_OSB_POCOutput" >
         <xsl:for-each select="medi:MEDI_DEV_OSB_POCOutput/medi:STUDYID">
         <xsl:element name="Name">
         <xsl:value-of select="medi:STUDYID"></xsl:value-of>
         </xsl:element>
         </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    Using this xslt I am not getting the result xml as how I needed. I am getting just the text values of nodes in my result xml. Kindly help me on this.
    Thanks,
    Phanindra.

    If by NewElement1, NewElement2... you mean NewElement literally (replaced by whatever real name you choose) whereas 1,2,... have no generic meaning, you can do this.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:soapenv="peopledirectory"
        xmlns:soap-env="propleaccess"
        xmlns:medi="http://xmlns.oracle.com/pcbpel/adapter/db/MEDI_DEV_OSB_POC">
    <xsl:output method = "xml" indent="yes"/>
    <xsl:strip-space elements="*" />
    <xsl:template match="*|@*|text()|processing-instruction()|comment()">
        <xsl:copy>
            <xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()" />
        </xsl:copy>
    </xsl:template>
    <xsl:template match = "medi:MEDI_DEV_OSB_POCOutput" >
        <xsl:copy>
            <xsl:for-each select="*">
                <NewElement name="{local-name()}" value="{normalize-space()}" />
            </xsl:for-each>
        </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>If you attach generic meaning to 1,2,... you can replace the corresponding template by this.
    <xsl:template match = "medi:MEDI_DEV_OSB_POCOutput" >
        <xsl:copy>
            <xsl:for-each select="*">
                <xsl:element name="{concat('NewElement',position())}">
                    <xsl:attribute name="name">
                        <xsl:value-of select="local-name()" />
                    </xsl:attribute>
                    <xsl:attribute name="value">
                        <xsl:value-of select="normalize-space()" />
                    </xsl:attribute>
                </xsl:element>
            </xsl:for-each>
        </xsl:copy>
    </xsl:template>I go for these details just because some technique used might help you one-day in other contexts.
    Edited by: tsuji on Feb 15, 2012 2:26 AM Essential correction made to the 2nd template.

  • Need help in XSLT Mapping.

    Hello All,
    We created mapping between Orders IDOC structure, here we are using XSLT Mapping.
    problem is in IDOC structure new Z segment is added after that we have modified the mapping and tested in stylus studio and it was working fine.............but when we tested the interface end to end....the Z segment are not coming.
    we have updated the IDOC meta data in IDX2 .......when we hard code the Z segment values and run the mapping in interface mapping we can see proper result.
    Please give me inputs on this.
    Regards,
    chinna

    hi channa,
    go through the below link..for small ref...
    http://help.sap.com/saphelp_sm32/helpdata/en/6a/e6194119d8f323e10000000a155106/content.htm
    regards,
    kesava

  • XSLT Mapping : RFC Lookup using java helper class

    Hi All,
    I am doing RFC Lookup in xslt mapping using java helper class. I have found blog for the same (http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14) However this blog is very advanced.
    Can anybody help me with step by step approach for the same?
    My basic questions are not answered in the blog as:
    1) where to add the jar file of the java class used in xslt mapping.
    I have added zip file of XSLT mapping in imported archived and using that in mapping.
    Thanks in advace.
    Regards,
    Rohan

    Hi,
    Can u please have look at this in detail , u can easily point out yourself the problem...
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm
    Please observe the line,
    xmlns:javamap="java:com.company.group.MappingClass
    in XSLT mapping..
    The packagename of class and class name and XSLT namespace should be matching...
    Babu
    Edited by: hlbabu123 on Sep 29, 2010 6:04 PM

  • XSLT Mapping Help Needed

    Hi,
    I have a XSD file with multiple references in my external definition. I am trying to build a schema validation functionality for a xml based on the multiple XSD's.
    Is it possible to do a schema validation using xslt mapping?
    I am using Altova mapforce to generate XSLT mapping but somehow it is not working. It gives me an error "XML Not well Formed".
    Please help!!

    Hi Jyanth
    yes you can do this
    i advice you to use XML Schema Tools like stylus studio or spy for editing, mapping, converting, validating, generating, binding and documenting any XML data model
    few  links for you how you can do in XML
    validating XML using XSLT
    http://www.ldodds.com/papers/schematron_xsltuk.html
    http://www.w3.org/TR/xslt20/
    http://www.stylusstudio.com/xsd_to_xsd.html
    https://www.xsltstudio.com/xml_schema.html
    regards
    Sandeep
    If helpful kindly reward points

  • XSLT Mapping - help

    Hi All,
    I am new to XSLT mapping.
    My requirement is: file to XML file with CDATA, for this I am planning to use the XSLT Mapping.
    I downloaded the Stylus studio, then what next, Please help meu2026
    In source flat file I have 5 fileds, and target I need to generate the XML file with CDATA set for 5 fields.
    Thanks,
    ANU-

    Hi Anu,
      Is your requirement is sending 5 fields into one string on target side ,If yes
      this code might help you for CDATA section
         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <MT_TARGET>
    <String>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[?xml version=\"1.0\"
    encoding=\"ISO-8859-1\"?>]]]]></xsl:text>
    <xsl:copy-of select="*"/>
    <xsl:text disable-output-escaping="yes"><!CDATA[]]]></xsl:text>
    <xsl:text disable-output-escaping="yes"><![CDATA>]></xsl:text>
    </String>
    </MT_TARGET>
    </xsl:template>
    </xsl:Stylesheet>
    //if you use " * " then entire source structure will go into target StringUsers node
    Regards,
    Sandeep

  • Java Error in RFC Lookup in XSLT Mapping usinf Java helper class

    Hi All,
    I am doing RFC Lookup in XSLT Mapping using Java Helper class.
    The Lookup works fine when called one RFC at a time However my requirement is I want to do 2 Lookups.
    Both Lookups works when done individually however when I call both lookups in one mapping I get following error "javax.xml.transform.TransformerException: DOMSource whose Node is null."
    Following is the code I have written in XSLT for the lookup:
         <xsl:template name="Lookup_1">
              <xsl:param name="STDPN"/>
                   <rfc:RFC_READ_TABLE>
                        <QUERY_TABLE>KNA1</QUERY_TABLE>
                        <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$STDPN"/>
                             </TEXT></item>
                        </OPTIONS>
                        <FIELDS>
                             <item>
                                  <FIELDNAME>KUNNR</FIELDNAME>
                             </item>
                        </FIELDS>
                   </rfc:RFC_READ_TABLE>
              </xsl:variable>
              <xsl:variable name="response" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request, 'BS_D, 'cc_RfcLookup', $inputparam)"/>
              <xsl:element name="STDPN">
                   <xsl:value-of select="$response//DATA/item/WA"/>
              </xsl:element>
         </xsl:template>
         <xsl:template name="Lookup_2">
              <xsl:param name="BELNR"/>
                   <xsl:variable name="Query">AGMNT = '<xsl:value-of select="$BELNR"/>'</xsl:variable>
                   <xsl:variable name="request1">
                        <rfc:RFC_READ_TABLE>
                             <QUERY_TABLE>ZTABLE</QUERY_TABLE>
                             <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$Query"/>
                                  </TEXT></item>
                             </OPTIONS>
                             <FIELDS>
                                  <item>
                                       <FIELDNAME>KUNAG</FIELDNAME>
                                  </item>
                             </FIELDS>
                        </rfc:RFC_READ_TABLE>
                   </xsl:variable>
                   <xsl:variable name="response1" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request1, 'BS_D','cc_RfcLookup', $inputparam)"/>
                   <xsl:element name="BELNR">
                        <xsl:value-of select="$response1//DATA/item/WA"/>
                   </xsl:element>
         </xsl:template>
    My Question: Am I doing anything wrong? Or Is it possible to call multiple lookups in one XSLT?
    Thanks and Regards,
    Atul

    Hi Atul,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • Java and XSLT Mapping. Help required

    Hi All,
    Why I require Java Mapping and XSLT Mapping when I have Graphical mapping ?
    Please explain Java Mapping and XSLT Mapping with examples.
    Regards

    Hi,
    there are lot of thread alredy posted please serach
    check following link
    http://help.sap.com/saphelp_nw04/helpdata/en/ce/1d753cab14a909e10000000a11405a/frameset.htm
    XSLT Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    Java Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    Links of blogs on java mapping...
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    blog
    /people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping(file to xslt mapping)
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners(xslt with java enhancement function)
    Regards,
    Amit

  • Help required in XSLT

    Dear Experts ,
    I want to convert my XML file to the ABAP Internal table.
    For this I have to Setuo a XSLT transformation.
    My XML File is as follows :
    <!--XML Export from Broadcast Master List.-->
    <!--Seg Codes List, Created 02/02/2010 16:02-->
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <BCMListOutput>
    <Row>
    <Column Name="Slot Type">Channel</Column>
    <Column Name="Media ID"></Column>
    <Column Name="Actual Start">00:00:00:00</Column>
    <Column Name="Actual Duration">00:00:00:00</Column>
    <Column Name="As-run Start">00:00:00:00</Column>
    <Column Name="Title">TVE2</Column>
    <Column Name="Version"></Column>
    <Column Name="House Number"></Column>
    <Column Name="Version Part"></Column>
    </Row>
    </BCMListOutput>
    I want to Convet this into the format with the structure as :
    YPES: BEGIN OF ty_schedule,
           SLOT_TYPE type ZSLOT,
           MEDIA_ID(10) TYPE c,
           ACT_ST TYPE TIMESTAMPL,
           ACT_DUR TYPE TIMESTAMPL,
           AS_RUN_ST TYPE TIMESTAMPL,
           TITLE(10) TYPE c,
           VERSION(10) TYPE C,
           HOUSE_NO(20) TYPE C,
           VERSION_PART(10) TYPE C,
           END OF ty_schedule.
    I am stuckup in writing XSLT for this.
    Can you please help me ?
    Regards,
    Nikhil

    Hi,
    use xpath function translate() and escape the semicolon and the quotes.
    <output><xsl:value-of select="translate(//Name,%3B,%25%3B%25)"/></output>
    If  that escapes do not work google for escape sequences.
    Regards,
    Udo

  • XSLT Help Required

    Hi,
    I am doing XSLT Mapping. Scenario is file to file. From input file depending on some condition I need to place records in Target file. Target File structure is:
    Header_Record (1)
    Data_Record (1..*)
    Trailer_Record (1)
    In Trailer I need to place record count of no of Data_records in this Target file.
    How should I go for this Prob.
    Looking for help.
    -Kavita

    Hi Prasanna ,
    I am not an expert but what about this:
    <SUPPLIERID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '2002']"/>
    </SUPPLIERID>
    <BILLTOID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '24']"/>
    </BILLTOID>or
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '2002'">
        <SUPPLIERID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </SUPPLIERID>
      </xsl:when>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '24'">
        <BILLTOID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </BILLTOID>
      </xsl:when>
    </xsl:choose>Regards Pete

  • Help required on XSLT Conditional Mapping

    Hi,
    We need help on XSLT mapping in BPEL based on a condition. We are transforming from OAG format to a client specific format. We need to map a single tag (but repetitive) on the left hand side (OAG) to different tags on the right hand side. The same tag on the left hand side repeats with different values. Depending on the value the mapping to the right hand side varies. The left hand side (OAG) looks something like this.
    <PARTNER>
    <PARTNRID>2002</PARTNRID>
    <PARTNRTYPE>Supplier</PARTNRTYPE>
    <ADDRESS>
    <ADDRLINE index="1">2000 Century Way</ADDRLINE>
    </ADDRESS>
    </PARTNER>
    <PARTNER>
    <PARTNRID>204</PARTNRID>
    <PARTNRTYPE>BillTo</PARTNRTYPE>
    <ADDRESS>
    <ADDRLINE index="1">90 Fifth Avenue</ADDRLINE>
    </ADDRESS>
    </PARTNER>
    Please note that the tag PARTNER and it's underlying tags appear twice in the XML file.
    Based on the value in the tag PARTNRTYPE, the mapping to the right hand side differs. If the value is 2002, PARTNRID should map to Supplier ID on the right hand side and if the value is 24, PARTNRID should map to BillTo ID on the right hand side. The right hand side should look something like
    <Supplier>
    <SupplierID>2002</SupplierID>
    <Address>2000 Century Way</Address>
    </Supplier>
    <BillTo>
    <BillToID>204</BillToID>
    <Address>90 Fifth Avenue</Address>
    </BillTo>
    Please let us know how to achieve this. Your help is much appreciated. Thanks in advance.
    Thanks,
    Prasanna

    Hi Prasanna ,
    I am not an expert but what about this:
    <SUPPLIERID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '2002']"/>
    </SUPPLIERID>
    <BILLTOID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '24']"/>
    </BILLTOID>or
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '2002'">
        <SUPPLIERID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </SUPPLIERID>
      </xsl:when>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '24'">
        <BILLTOID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </BILLTOID>
      </xsl:when>
    </xsl:choose>Regards Pete

Maybe you are looking for

  • How can I back-up my Itunes library?

    I need to have my MAC (Snow Leopard) hard drive replaced.  How can I back up my iTunes Library?

  • Can i install Adobe premiere elements and photoshop elements separately in 2 different computers?

    We are planning to purchase a bundle Adobe Photoshop Elements and Priemiere Elements 11 but we need to separate the installation of this 2 softwares in to 2 different computers, Can we do an installation separately using the same lisence? An urgent a

  • An error occurred while trying to view the document.

    Hi, I have created a crystal report using Crystal Reports 2013 and I trying to call this report from outside the server. While I called the report using RESTFul API I shown below error in my browser. Is there any license related issue or some thing e

  • New EWA Report Topic - Software Change Management

    Dear Experts, EWA reports has a new topic named Software Change Management , in this topic there is a subject name "Transport Requests with a short Transition Time" with following explanation; Explanation :      Transport requests with short transiti

  • Is there any zen player that WON'T BREAK

    ...when you drop it's I bought a Zen Xtra 40GB and dropped it, and when I turned it on I got a harddisk error. Creative replaced it for me, but that one slipped out of my bag on to the floor and the same thing happened to it. Now, if these are suppos