Generating multiple target xmls from one source xml using xslt mappings

Hi,
I need to create more than one xml file from one source xml file using xslt mappings in file to file scenario.
Can you please let me know how this can be achieved.
Thanks,
Rajesh

Rajesh,
If you must use the XSL Transformation then you can find a nice simple example here.  It's based on the Xalan XSLT Processor which to my knowledge is incorporated in PI7.1.  I've not actually tried this but it makes for an interesting mapping case so please let us know the results: 
[XSLT Split for multiple XML file output|http://abbeyworkshop.com/howto/xslt/xslt_split/index.html]
The XSL file will require a namespace addition:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:redirect="http://xml.apache.org/xalan/redirect" extension-element-prefixes="redirect" version="1.0">
The redirect prefix is used for the write tags in the XSL file.
The details cover the transformation of the source file:
1:<student_list>
   2:    <student id="1">
   3:        <name>George Washington</name>
   4:        <major>Politics</major>
   5:        <phone>312-123-4567</phone>
   6:        <email>gw_at_example.edu</email>
   7:    </student>
   8:    <student id="2">
   9:        <name>Janet Jones</name>
  10:        <major>Undeclared</major>
  11:        <phone>311-122-2233</phone>
  12:        <email>janetj_at_example.edu</email>
  13:    </student>
  14:    <student id="3">
  15:        <name>Joe Taylor</name>
  16:        <major>Engineering</major>
  17:        <phone>211-111-2333</phone>
  18:        <email>joe_at_example.edu</email>
  19:    </student>
  20:</student_list>
Using this transformation:
2:<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3:    xmlns:redirect="http://xml.apache.org/xalan/redirect"
4:    extension-element-prefixes="redirect"
5:    version="1.0"
6:>
7:<xsl:output method="xml"/>
8:
9:<xsl:template match="/">
10:    <xsl:apply-templates />
11:</xsl:template>
12:
13:<xsl:template match="student_list">
14:    <xsl:apply-templates />
15:</xsl:template>
16:
17:<xsl:template match="student">
18:    <xsl:variable name="filename" select="concat(@id,'.xml')" />
19:    <redirect:write select="$filename">
20:        <student id="{@id}">
21:            <xsl:apply-templates />
22:        </student>
23:    </redirect:write>
24:</xsl:template>
25:
26:<xsl:template match="name | major | phone | email">
27:    <xsl:copy-of select="." />
28:</xsl:template>
29:
30:</xsl:stylesheet>

Similar Messages

  • How to populate target directory from the source XML in Receiver File Adap?

    Hi All,
    Our scenario is IDoc - XI -(Receiver File adapter) File. Is it possible to populate complete "Target Directory" from the source XML message??
    Lets say we added field to maintain target directory in Idoc structure and some how populated value to it, then grab this target directory from the IDoc-XML and pass in Comunication Channel. I think its possible through Variable Substitation ...just want to make sure and if sombody has done the similar scenario their inputs would be great.
    Thanx
    Navin

    Hi,
    Please see the belowlinks
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/sriram.vasudevan3/blog/2005/11/21/effective-xsl-for-multimapping-getting-source-filenames-in-legacy-legacy-scenarios
    Re: Dynamic  File Name for Receiver File Adapter
    Variable Substitution
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    try with adapter specific
    Example code...
    String newfilename="";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // Get Sourcefilename
    String oldfilename=conf.get(key);
    //extract first 3 chars of source filename
    newfilename=oldfilename.substring(0,2);
    //get the date
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    //append sourcedateL
    newfilename=newfilenamedateformat"L";
    // determine if prod/ dev / qa
    map = container.getTransformationParameters();
    senderService = (String) map.get("SenderService");
    if(senderServcie.equald("Prod"){
    newfilename=newfilename+"P";
    // change to new file name
    conf.put(key, newfilename+".tmp");
    Change it according to your requirement
    Regards
    Chilla..

  • How to create/import a target schema from a source schema using data pump?

    I have seen some examples where schema remapping will be done through remote link which I cannot as both the target schema and source schema are in same machine ...but I am not sure how to do it with out using remote link? I would be great if some one could provide a example
    Thanks in Advance

    I'm not sure what you are asking here, but I'll try to give some examples on remapping a schema:
    expdp prived_user/password schemas=orig_schema_1 directory=dpump_dir dumpfile=orig_schema_1.dmp
    impdp prived_user/password schemas=orig_schema_1 directory=dpump_dir dumpfile=orig_schema_1.dmp remap_schema=orig_schema_1:new_schema_1
    If you want to try without a dumpfile then you need a loop back dblink.  (A dblink on your database that points to the same database.  This would be your command:
    impdp prived_user/password schemas=orig_schema_1 directory=dpump_dir network_link=loop_back_link remap_schema=orig_schema_1:new_schema_1
    Hope this helps.  If not, can you explain your question a little more?
    Dean

  • Need of XI to send an XML from one SAP system to another SAP system

    Dear colleagues,
    I work in the SRM solution.
    In SRM there is a Purchaser and Supplier scenario called Supplier Self Services.
    The Purchaser creates a Purchase order and sends it to the supplier in form of an XML file.
    The purchaser system and supplier system are the same SAP system but different clients.
    Example: Purchaser client is 300 and Supplier client is 330 and both of them are on the same system.
    I have a very basic question.
    Currently we have the XI system which acts as an interface to send the Purchaser PO XML to the Supplier as XML.
    a)My question is in case the XML structure is identical across both the clients, then what is the need of XI system?
    b) Is it not possible to send XML from one client to another without an XI system? there si no need of any message mapping required since I am expecting the same XML structure in both clients.
    Please clarify the need of XI system in the following scenario. Is it not possible without XI?
    Many thanks.
    Best regards,
    Srivatsa

    Hi Srivatsa,
        YOu can send the XML message from one sap system to another sap system even without an XI system in between.
    But the use of SAP XI (Or any other middleware) is recommended because, it gives you the following advantages.
    1) Better monitoring and alerting mechanism. XI provides you robust set of tools that let you monitor the status of the messages that are exchanged.
    2) Direct communication between systems is referred to as Point to Point communication, which has its own disadvantages as against Hub and SPoke model (Message exchange using XI).
    3) Message delivery is guaranteed if you have XI in between.
    If the target system is down, the sender sap system will not try multiple times to post the message.
    But if you use XI, it can be configured to send the message multiple times, till it succeeds.
    Regards,
    Ravi Kanth Talagana

  • Passing data from one UIX XML page to another UIX XML page

    What are the various ways of passing data from one UIX XML page to another UIX XML page?
    (a) If no bc4j is used.
    (b) If bc4j is used.
    (c) If my event handler calls:-
    public static EventResult handleMyEventEvent( BajaContext context, Page page, PageEvent event) throws Throwable
    then how can I pass data to the next UIX XML page?
    Thanks,
    Paul.

    What are the various ways of passing data from one UIX XML page to another UIX XML page?
    (a) If no bc4j is used.For forwarded URLs; HttpServletRequest attributes [request], HttpSession attributes [session], ServletContext attributes [application].
    For redirected URLs; HttpServletRequest parameters url, HttpSession attributes [session], ServletContext attributes [application].
    (b) If bc4j is used.For forwarded URLs; BC4J Session properties.
    For redirected URLs; BC4J Session properties IF release mode is NOT stateless.
    (c) If my event handler calls:-
    public static EventResult handleMyEventEvent( BajaContext context, Page page, PageEvent event) throws Throwable
    then how can I pass data to the next UIX XML page?Return a UIEventResult (extends EventResult) from your event handler that has a data provider attached.
    This data provider will be accessible in the next page with the name "ctrl:eventResult", where "ctrl" is the short prefix for the namespace "http://xmlns.oracle.com/uix/controller".
    Regards,
    John Fallows
    Oracle Corporation.

  • Copy Transferrules from one source system to another

    Hi everybody,
    we're uploading data from nearly 25 sourcesystems (including separate systems and systems with more than one client to extract from) via flat-file. The source-system exports data to a shared file directory and the bw-system reads it from there. Though this results in only <b>one</b> transferrule for all source-systems, it keeps generating problems every time upload is due.
    Somebody had the idea to switch to 'standard' R/3->BW method of data staging, using generic extractors and so on. But this will result in <b>25</b> transferrules which, I'm afraid, have to be set up and maintained seperately. As there's quite some coding in the rules (the transfertructure in fact has 241 fields), flaws are for sure!
    We know the trick of exporting a transferrule, changing the source-system-mapping and re-importing the same transport-request. That can be used to copy to one or two other systems, but not for 25.
    Does anybody know another way to copy a transferrule from one source system to multiple other source systems?
    Looking forward to your answers
    Thanks and Regards
    Robert

    Hi Ralph,
    I don't like that methode. Importing the same transport 15 times, each time changing the source-system mapping and making sure, that source-system gets the changes seems to be a huge source of errors, which will be hard to find.
    What do you think of the following idea to solve the issue a totally different way:
    All transfer-rules directly connected to the source-systems are stripped of all Coding, so there is a plain 1 by 1 transformation including 0logsys.
    The InfoSources attached all lead to one ODS-Object, which has the only purpose to collect the data from the source-system without any transformation. So some fields a filled by a system and other fields maybe not.
    The coding specific for source-systems is moved to transfer- / update-rules from that ODS-Object to the original ODS-Objects / Cubes and the "collecting" ODS-Object is emptied after every loading process.
    This will result in a single point of change. It will be quite a huge program (maybe in startroutine) but it's the one and only point, where changes and corrections have to be made.
    Regards
    Robert

  • How to generate multiple idoc's from single appl document

    All,
    Iam looking for a way to generate multiple idoc's from single appl document (sales order). Based on the plant details on line items in the sales order i have to generate multiple idocs, i.e., send one idoc to each plant entered in sales order line items. any help will be appreciated.
    Thanks

    Hi,
    You can create a Z-program and call Function Module  <b>MASTER_IDOC_DISTRIBUTE</b>.
    You can make a call to this FM to send the Idoc as many times as u have plants in your Sales Order.
    You can call FM <b>IDOC_OUTPUT_ORDRSP</b> to fill the IDoc structure.
    Then u can keep the materials of only that plant for which u want to pass on the information.
    Thanks,
    Utsah Garg.

  • Is there a way to move multiple Calendar items from one date to another?

    Hello. I have far too many Calendar items every day in my iCal. Until I finally pare them down to a reasonable level, I need to "reschedule" all of my unfinished ToDo items and reminders, to another day, later in the week.
    There doesn't seem to be any "Select All" feature available.
    Is there a way to move multiple Calendar items from one date to another?
    Thanks in advance!

    Still no ideas? Apple, please come up with a fix. Thanks.

  • Exporting to multiple PDF's from one report

    I have a requirement to create multiple PDF's from one report.
    My thought is that I can I can create a foreach loop that cycles through one of my groups.  I would then like to have each file have the name of that group. 
    If anyone could help me on how to code this in C# that would be great.  I need to know where I should be putting this code (program.cs or crystalreport.cs) and how I run it.  I am assuming I don't need the viewer for this function, since this is all on my end and no users need to have access to it. 
    My other requirement is to have each of these reports be put into their own folders at C:\.  Thanks for the help in advance!

    OK. Yup, you should be able to do this. When I was reading the initial post it looked like you might have ben wanting to export only a certain section of a report (which is a no go).
    Anyhow, first thing you want to do is apply Service pack 3:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    Next, you want to look at a few sample apps and go over some docs. What you want to achieve can be done by using parameters or selection formulas.
    A good coding resources is the [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]. Don't worry about the title, it will apply to CR 2008 also.
    Next, sample apps can be downloaded from here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    [CR 2008 developer library|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm]
    [API reference|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm]
    Not sure if you are thinking of this being a web app, but here are some resources for that:
    [Interactivity and Reports in Web Applications|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/208edbbf-671e-2b10-d7b5-9b57a832e427&overridelayout=true]
    Before starting your project, you should have a look at [this|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bccdfd-88a6-2b10-1da1-c47a54b625a7] to make sure you are using the right SDK for your purposes.
    Finally, the following are links to 3rd party resources and I'm adding htese just as an FYI:
    http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx
    http://msdn.microsoft.com/en-us/magazine/cc301570.aspx
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • When I copy and paste from one source material to another  within adobe reader, all the words are in one sentence. I have to take extra time to separate  the words using the space bar. Can this be fix?

    When I copy and paste from one source material to another  within adobe reader, all the words are in one sentence. I have to take extra time to separate  the words using the space bar. Can this be fix?

    Hi Bernie,
    Are you trying to copy and paste from a pdf to another pdf?
    Regards,
    Rave

  • Passing Multiple table row from one view to another view

    Hi,
    How to Passing Multiple table row from one view to another view in Web Dynpro Abap. (Table UI Element)
    thanx....

    Hi Ganesh,
    Kindly do search before posting.. this discussed many times..
    First create your context in component controller, and do context mapping in two views so that you can get values from
    one veiw to any views.
    and for multiple selection, for table we have property selection mode.. set as multi and remember context node selection
    selection cardinality shoud be 0-n.
    so, select n no of rows and based on some action call sec view and display data.( i think you know navigation between veiw ).
    Pelase check this...for multi selection
    Re: How to copy data from one node to another or fromone table to another table
    for navigation.. check
    navigation between the views
    Cheers,
    Kris.

  • Generate multiple idoc's from the single application doc(Sales order)

    Hi All,
    Iam working on a requirement where i have to generate multiple idoc's from a single sales order based on sales org, division on header data and plant at item level, if somebody please let me know how to proceed with this requirement.
    Thanks
    Kashif

    Hi,
    You can create a Z-program and call Function Module  <b>MASTER_IDOC_DISTRIBUTE</b>.
    You can make a call to this FM to send the Idoc as many times as u have plants in your Sales Order.
    You can call FM <b>IDOC_OUTPUT_ORDRSP</b> to fill the IDoc structure.
    Then u can keep the materials of only that plant for which u want to pass on the information.
    Thanks,
    Utsah Garg.

  • Getting suspicious email from one source

    Over the last two weeks, I've received 3 emails from one source called "root" with nothing on the subject line. The sender's address is: <[email protected]>
    How do I find out who this is and what it's purpose? The email has nothing in body content, either. (Googling this address didn't work either)
    Thanks!

    May not be possible to learn more, but with the message open, click on View, place the cursor on Message and choose Long Headers to see if the Return Path or other headers give you any more info.
    You might also examine the Raw Source, but not likely to provide much more than the Long Headers in this case.
    Ernie

  • I cannot open pdf files from one supplier when using Adobe Reader but I can using another Viewer

    I cannot open pdf files from one supplier when using Adobe Reader but I can open it if using Google PDF viewer or another viewer. The Adobe reader gives the error "There was an error opening this document. The file is damaged and could not be repaired" when I try to open the file. The version of Adobe Reader is 10.1.7, however I have tried other versions and they all fail the same way.  I have tested on a number of different PC's in different networks and all fail using Adobe Reader but work using alternate viewer. Also the PC's will open a PDF from any other source.

    Newer Reader versions are more strict than older versions (and other PDF viewers).  If certain minimum requirements are not met, Reader will tell you that the PDF is damaged.  This can happen when a document was created with software that does not adhere to PDF standards, or when the file was damaged during a download or email transmission.
    You should contact the creator of these PDFs.

  • What the best way to call twenty tuxedo domains from one weblogic server use WTC

    I need to call twenty tuxedo domains from one weblogic server use
    WTC. the Service be called in the twenty tuxdo domains are same, do I need to
    write twenty EJB in the weblogic server to call the same service? who have good
    adea to deal with this problem?

    Hi,
    I have a question on the second case. When the client doesn't care of which
    Tuxedo domain it is hitting. What happens if one of the Tux domain is down ? What
    happens to the client request to that domain ?
    Another question is lets say i have a Tuxedo configuration as MP mode( Multi
    machine mode) how does WTC load balance between the Tuxedo domains.
    Thanks,
    Srinivas
    "A. Honghsi Lo" <[email protected]> wrote:
    Hi xcjing,
    One way to handle your needs is to use local service name to remote
    reservice name translation. For instance,
    (in 6.1,6.0 WLS)
    <T_DM_IMPORT ResourceName="TOUPPER1" LocalAccessPoint="WTC"
    RemoteAccessPointList="TUX-DOM1">
         <RemoteName>TOUPPER</RemoteName>
    </T_DM_IMPORT>
    <T_DM_IMPORT ResourceName="TOUPPER2" LocalAccessPoint="WTC"
    RemoteAccessPointList="TUX-DOM2">
         <RemoteName>TOUPPER</RemoteName>
    </T_DM_IMPORT>
    <T_DM_IMPORT ResourceName="TOUPPER3" LocalAccessPoint="WTC"
    RemoteAccessPointList="TUX-DOM3">
         <RemoteName>TOUPPER</RemoteName>
    </T_DM_IMPORT>
    etc
    With this configuration if your client have to call "TOUPPER" service
    in
    TUX-DOM1 then you code your client to call "TOUPPER1" and the request
    will be routed to TUX-DOM1. The same way for request has to go to
    TUX-DOM3, your client calls "TOUPPER3" service and WTC will route it
    to
    TUX-DOM3. In this remote name translation you may have to write 20 EJB
    although they are almost the same. However, if your EJB can analyze
    your client input to decide which Remote Tuxedo Domain to send the
    service request to then you probably only need one EJB.
    In the case that your client does not care which remote Tuxedo Domain
    provides the service then adding
    <T_DM_IMPORT ResourceName="TOLOWER" LocalAccessPoint="WTC"
    RemoteAccessPointList="TUX-DOM1">
         <RemoteName>TOLOWER</RemoteName>
    </T_DM_IMPORT>
    <T_DM_IMPORT ResourceName="TOLOWER" LocalAccessPoint="WTC"
    RemoteAccessPointList="TUX-DOM2">
         <RemoteName>TOLOWER</RemoteName>
    </T_DM_IMPORT>
    <T_DM_IMPORT ResourceName="TOLOWER" LocalAccessPoint="WTC"
    RemoteAccessPointList="TUX-DOM3">
         <RemoteName>TOLOWEr</RemoteName>
    </T_DM_IMPORT>
    etc
    Will load balance your client "TOLOWER" service request among your 20
    remote Tuxedo Domain.
    However, there is a bug in WTC that causes the Remote Service Name
    translation functionality not working properly. It is fixed in the
    upcoming release of WLS.
    Honghsi :-)
    xcjing wrote:
    Thank you very much! But I still have question, give an example,
    twenty Tuxedo domain is named domain1,domain2,....domain20. The
    same Tuxedo Service: TOUPPER is deploy on those twenty Tuxedo domains,some time
    I need call the TOUPPER Service on domain1,saome time I need call theTOUPPER
    Service on domain3 or
    other domain depend on the input from client. you mean I need to importThe TOUPPER
    Service from twenty Tuxedo domains in the console,then write one EJBto call the
    TOUPPER Service,but how can the EJB know which Tuxedo domain's TOUPPERto call
    from?
    Thank you!
    "A. Honghsi Lo" <[email protected]> wrote:
    hi xcjing,
    You don't have to write 20 beans or deploy 20 beans because there
    are
    20
    remote Tuxedo TDomain you need get the service from. Of course, WLSand
    WTC does not prohibit you from doing it though. Whether you need20
    beans or not depend more on you architecture.
    To access 20 remote Tuxedo Domain from one single WLS with singleWTC
    you can configure 20 remote Tuxedo Domain in the BDMCONFIG (6.1,6.0)
    or
    from the console (7.0). You import 20 services one from each remote
    Tuxedo domain. You write one bean, and deploy one bean. Your WLS
    clients will be able to access THE ejb, the EJB will access the WTC
    service, and WTC will load balanced the service requests among the20
    remote Tuxedo Domain.
    Regards,
    honghsi :-)
    xcjing wrote:
    I need to call twenty tuxedo domains from one weblogic server use
    WTC. the Service be called in the twenty tuxdo domains are same,
    do
    I need to
    write twenty EJB in the weblogic server to call the same service?
    who
    have good
    adea to deal with this problem?

Maybe you are looking for

  • CRYSTAL REPORT RUNTIME ERROR

    HI All, We have completed major upgrade  VC++ to MSVS2010 MFC Application and Seagate CR 6.0 to CRVS2010, I have used CR Viewer 13.0 and i have written code in C#. when i assign & load Report using CR Viewer , i am getting runtime error, below mentio

  • My iPod touch wont charge or turn on?

    My iPod touch was not fully charged but it had some charge and then it just turned off and now it won't turn back on. I plugged my iPod touch into charge and the red battery and lightning symbol comes on but that is still there a couple of hours late

  • How I can get 4g into iPhone 4?

    How can I get 4g firmware into my iPhone 4?

  • Unknown devices appearing in my access list

    I have a WPN824 wireless router and in the last two weeks, I've found three devices in the access list that I didn't put there.  I first found the three devices last week and deleted them from the list.  Tonight, I found them again.  All three device

  • Global Variables Vs Form Library Package Variables Vs DB Package Variables

    I realise this question has been asked a few times with varying degrees of answers, but I am still seeking comment/advice from others. I am aware of following options for retaining persistent data to share between forms. 1. Package variables in a lib