A top difficulty mapping question

Hello
dose anyone can give solution for this mapping question?
soruce :
<header>header</header>
<item>
     <A>a1</A>
     <B>b1</B>
     <C>c1</C>
</item>
<item>
     <A>a2</A>
     <B>b2</B>
     <C>c2</C>
</item>
<item>
     <A>a3</A>
     <B>b3</B>
     <C>c3</C>
</item>
target:
<header>header</header>
<item>
     <A>a1,a2,a3  .....</A>
     <B>b1,b2,b3  .....</B>
     <C>c1,c2,c3  .....</C>
</item>
The numbers of item is not fixed,it is unbounded.
so the target line length is not fixed at design time
welcome any hits,
Thanks !!
BR,
Jeffrey

Hi,
Use cache parameter as Context.
public void add_element(String[] a,ResultList result,Container container)
  //write your code here
String c = "";
int i;
for(i= 0 ; i < a.length; i++)
         c = c + a<i> ;
         if(i != (a.length-1))
              c = c + ",";
result.addValue(c);
A(src)-->removecontext->UDF--->A(tgt)
B(src)--->removecontext->UDF--->B(tgt)
C(src)--->removecontext->UDF--->C(tgt)

Similar Messages

  • Need help with tree edit distance and restricted top-down mapping algorithm

    *This topic was posted a while ago in "java programming" section but was suggested to try here
    Hi everyone,
    A couple of days ago I posted a topic on analyzing structure similarity between two web pages. After some researching, I know I need to work out some tree matching algorithms: tree edit distance algorithm(TED) and a improved version: restricted top-down mapping algorithm(RTDM). TED is about calculating the minimum operation cost(insert, delete, replace) to map one tree into another. RTDM further restricts the 3 operations to only the leaf nodes so as to improve time complexity.
    This is the general idea but I'm having difficulties to find resources to let me understand and implement the algorithms. I'm using ACM portal (Association for Computing Machinery) to access the technical papers but I find that they do not provide enough info, google gives mostly the same technical papers and some websites which illustrate the general idea of these algorithms.
    Hoping that you can give me some guidance on these 2 algorithms. Not looking for codes but I need more details on them. Thanks in advance.

    For scientific research I prefer Scirus: http://www.scirus.com/
    Just two pages I found on a quick search:
    http://arxiv.org/abs/cs/0604037
    http://www.cs.uic.edu/~yzhai/
    The latter might not be exactly what you asked for, but you might be interested in the listed publications. I have not taken a closer look.

  • CRMXIF_REL_SAVE_M01 - Mapping Question

    Hello All,
    I have a mapping question, hope some one can answer my question. Please see the link first and the see my question
    http://www.flickr.com/photos/8764045@N06/4265246260/sizes/o/
    I'm mapping the CRM IDOC to the JDBC Call. I have small problem here. All the target fields are Mandatory 1..1 .
    I will explain with an example:
    I have field from source E102BUS_EI_STRUC_TEL_DATA/COUNTRY mapped to target field.
    I used Map With Default so that even if the values are not there frm the source the target field will be mapped with blank.
    But the problem is the parent node for E102BUS_EI_STRUC_TEL_DATA is E102BUS_EI_BUPA_TELEPHONE is 0.999999 , so sometimes that segment is not coming. In this case Map with Default won't work. Map with Default willl work only if the Parent node is present.
    If you ask me to do Exists node function on E102BUS_EI_BUPA_TELEPHONE and then apply Map with Default, then even this won't work.
    Apologize if I confused you guys. Please let me know if you need more clarification.
    Thanks!
    Raj.

    Hi Raj,
    Try to do a mapping like this
    E102BUS_EI_STRUC_TEL_DATA(context E102S_EI_BUPA_TELEPHONE_CON)--mapwithdefault-->then
    E102BUS_EI_BUPA_TELEPHONE-->exists------------------------------------------------------------------>if---->splitbyValue
    let us say this output (the output of splitbyvalue) as 'VALUE'
    VALUE-----------------------------------------------> then
    VALUE|-->count--->greater----------------------->if----->targetField                            
          Constant(0)---->              Constant(blank)-->else
    Regards
    Suraj

  • Another Google Maps question

    When planning a route using google maps on my iphone it only lets me input the start and end points, is there any way of creating a route via multiple points?
    Cheers, Toby

    You can plan a route using google maps on a computer, with multi points, and sent it via the email link which is top of map to your phone.
    From the email on the phone , click on the link it should open up google app with the route.
    Also you get a list of directions in the email.
    Google map app is not that great, same for google maps in safari on the iphone.
    mapquest is no good for people in the uk

  • Creating an interactive top down map of a floor of a building

    Hi,
    This is an extremely general high level question. I want to create a map of a building where the view is looking top down. I want to be able to add and remove different sized rooms and put a label on each room to say what it is. I don't even know what language would be best to use as I want to add it as a link to a website. If you could offer any advice as what to even look into it would be greatly appreciated.
    Cheers,
    elmicko

    Ok,
    I know that I could create an applet but is there a way to create "walls"? I know I could just draw lines but surely there is an easier way as I want to be easily able to change the layout without changing the code. I also want there to be text that appears when I go over a room but not a coridoor. Could you suggest any tools that could help me?
    Cheers,
    elmicko

  • Is there ANY way to have a static widget over the top of a question slide?

    I have a popup reference widget that I made and put it in a master slide and set it to ply on top, BUT if I add it to a question slide, the text from the question shows over it.
    Any way to have a widget always be on the absolute top?
    Click on the MSDS tab at bottom reveals popup, but the question text appears over the widget even though it is in a master slide set to shop on top.
    Ideas?

    Once your widget is on the slide, it has complete control over the display tree. So what you can do is to move up the parent hierarchy until you find the slide (parent.parent.parent) and then re-parent yourselft or you popup window on top of the hierarchy by just calling addChild(). That works well for the static widgets. You just need to deal with the position being different on the slide so you'll have to juggle with localToGlobal() and globalToLocal().
    Whyves
    www.flash-factor.com

  • Many-to-many mapping question

    Hi,
    I'm working with two classes Car and Customer. The Car class has a Vector of Customers and the Customer class has a Vector of Car. Both are related by a many to many mapping.
    I have noticed that I have to set one of the vector to read only to avoid the error message "More than one writable many-to-many mapping can not use the same relation table" in the mapping workbench.
    I can understand that but is there a way to work around, I mean to be able to add a car to a customer and add a customer to a car with the both vectors?
    Is there something to do with the cache?
    I use Vector for the collection or Map class, have I to do otherwise?

    Hello Vladislav, I understand your first question in this thread, but I'm not sure I follow the rest, so let me respond to your first post:
    "I have noticed that I have to set one of the vector to read only to avoid the error message "More than one writable many-to-many mapping can not use the same relation table" in the mapping workbench.
    I can understand that but is there a way to work around, I mean to be able to add a car to a customer and add a customer to a car with the both vectors?"
    The issue here is that with a Many to Many mapping the mapping is responsible for writing to the association table. So, you have a "CAR_CUST" association table. Imagine you add a Car "101" to a customer "501" and the requisite customer "501" to that car "101" in your object model. Then the association table should only be updated once, with an entry of "101, 501". But since the M-M is mapped in both directions, you need to tell TopLink which of these to consider as the "master" when updating the database.
    If you didn't make one of the M-M mappings "read only", then TopLink would insert "101, 501" twice in the association table, and then at a later date you would see that the customer 501 had two 101 cars!
    We do have a feature that allows for TopLink to maintain bidirectional relationships such that if you add or remove a target from one relationship, TopLink will automatically add/remove it from the opposite direction. In my opinion this is lazy programming! A good Java developer should insist on keeping his model up to date on his own. This feature was added because it's part of the EJB spec, not necessarily because it's a good idea ;)
    - Don
    Is there something to do with the cache?
    I use Vector for the collection or Map class, have I to do otherwise?

  • Mapping question

    Hello,
    I have a rather simple question regarding a mapping.
    Lets say my input message is as following:
    <mes1>
       <seg1>
          <name1>Peter</name1>
          <street1>HighCrt</street1>
       </seg1>
       <seg2>
          <name2>Vlad</name2>
          <sub2>Trickst</sub2>
       </seg2>
       <seg2>
          <name2>Rinaldo</name2>
          <sub2>fiave</sub2>
       </seg2>
    </mes1>
    My output should be:
    <out>
       <put>
          <name>Peter</name>
          <name>Vlad</name>
          <name>Rinaldo</name>
       </put>
    </out>
    So my output field "name" should created in case I have a "name1" field in the source message and additionally it should be created for every "seg2" element that is present in the source message and it should be filled with the value of "name2".
    How can I in the mapping trigger that the "name" element of the output message will be generated for each of the two described elements of the source message?
    Best Regards,
    Peter

    Hi,
    Could be possible using user defined function.
    Create a user defined Function with  cache = context
    public void createNodeName(String[] a,String[] b,ResultList result,Container container){
    if ( a.length > 0 )
      result.addValue ( a[0] ) ;
    for ( int i = 0; i < b.length; i++ )
         result.addValue ( b<i> );
    in Mapping use
    1. name1 as first argument
    2. name2 with removeContext as second argument

  • Mapping - Questions

    Hi,
       I have few basic questions regarding mappings.
       1)  I think we can do everything by using Graphical Mapping. Then what is the purpose for Java, XSLT and ABAP mapping? Please give me an example for this...
       2) Which mapping will give better performance? Is there any comparison document available in SDN?
      Appreciate your help!
    Thanks,
    Vivek

    hi,
    Mapping Techniques
    XI provides 3 standard ways of interface mapping between source and target.
    Graphical mapping
    Java Mapping
    XSLT Mapping
    Two more additional mapping types can be activated in XI by making changes to the exchange profile. Those two mappings are
    ABAP mapping
    XSLT mapping with ABAP Extensions
    Graphical Mapping
    Graphical mapping is a common approach followed by everyone for generating desired target structure. It involves simple drag-n-drop to correlate respective nodes (fields) from source and target structure. It hardly involves coding. (Exception - User defined functions). But sometimes with graphical mapping it is difficult to produce required output. For example ... text/html output, namespace change, sorting or grouping of records etc.
    ABAP Mapping
    A person comfortable with Object Oriented ABAP can go for ABAP mapping instead.
    Java Mapping
    Java Mapping uses 2 types of parsers. DOM and SAX. DOM is easier to use with lots of classes to help you create nodes and elements, but , DOM is very processor intensive.
    SAX parser is something that parses your XML one after the other, and so is not processor intensive. But, it is not exaclty easy to develop either.
    XSLT Mapping
    One can also think of Java mapping as another option but it is a bit complex and required knowledge of Java. In such cases, XSLT mapping can be the best approach to meet the requirements.
    check these links too..
    Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/b78d406b305537e10000000a1550b0/frameset.htm
    For Java Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    For XSLT Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm
    Error handling in XSLT Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/8a/7672f7d7e444439fd7024f806221a4/frameset.htm
    You can also refer some How to guides:
    XI New Mapping Features article,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi%203.0%20new%20mapping%20features%20article.evn
    Generic XSLT Mapping and Sample Code,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi%20code%20samples/generic%20xslt%20mapping%20and%20sample%20code.pdf
    How to use ABAP-MApping in XI3.0,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how%20to%20use%20abap-mapping%20in%20xi%203.0.pdf
    Thanks,
    Vijaya.

  • ABAP Mapping Questions

    Hi,
    I am trying to get my head around ABAP mappings and have a few questions.
    In the below code sample which I find in every example and blog it talks about specific steps -
    *initialize iXML, * create iXML factory object, * create streamfactory object, * create input stream object, * initialize the input xml document, * parse the input xml document
    In these steps the code is always exactly the same so my question is are these just standard steps that are implemented every single time an abap mapping is used and hence only standard lines that never have to be changed or will they be different depending on the mapping.
    I am trying to work out where I will begin my coding.
    So would somebody be so kind as to give me a brief explanation of the above mentioned steps.
    Thank you
    METHOD if_mapping~execute.
    * initialize iXML
      TYPE-POOLS: ixml.
      CLASS cl_ixml DEFINITION LOAD.
    * create iXML factory object
      DATA: ixmlfactory TYPE REF TO if_ixml.
      ixmlfactory = cl_ixml=>create( ).
    * create streamfactory object
      DATA: streamfactory TYPE REF TO
      if_ixml_stream_factory.
      streamfactory = ixmlfactory->create_stream_factory( ).
    * create input stream object
      DATA: istream TYPE REF TO if_ixml_istream.
      istream = streamfactory->create_istream_xstring( source ).
    * initialize the input xml document
      DATA: idocument TYPE REF TO if_ixml_document.
      idocument = ixmlfactory->create_document( ).
    * parse the input xml document
      DATA: iparser TYPE REF TO if_ixml_parser.
      iparser = ixmlfactory->create_parser(
      stream_factory = streamfactory
      istream = istream
      document = idocument ).
      iparser->parse( ).

    Hi,
         The above lines you mentioned deal with initialization of the iXML parser for parsing through the XML payload, so they would remain the same for all mapping where you are parsing the input payload.
    The coding for you specific mapping will begin after this, something like :
    * Implements the DOM generating interface to the parser
      iparser->parse( ).
      emp_node_collection = idocument->get_elements_by_tag_name_ns( name = 'Order' ).
      emp_node_length = emp_node_collection->get_length( ).
      emp_node_iterator = emp_node_collection->create_iterator( ).
    where you start reading the xml node values.
    Hope this helps.
    Regards

  • One to one mapping question -- can I just map a lookup field for queries?

    I have a table with a state code. I'd like to have a "virtual lookup" on the java class to a region table. I.e., this java class "studies" has a state code. I can map a one-to-one to the descriptor class that has the ref table, but I'd like to have a property in the java class pre-mapped to the "region" field in this lookup so for querying i can just use:
    ReadAllQuery q = new ReadAllQuery();
    q.setReferenceClass(study.class);
    q.setSelectionCriteria(new ExpressionBuilder().get("Region").equal(Region));
    to get all the studies for a particular region.
    am I going about this wrong? or do I have to get the reference table descriptor fromt he one to one map and do something different?

    well,on the way home last nite, I realized I'd had a complete brain fart. I've done this before. I just set up a 1-1 map between descriptors and then built the query like this:
    q.setSelectionCriteria(new ExpressionBuilder().get("refFPO").get("FPO_NO").equal(FPO));
    You can get the pointer to the "refFPO" which is the the descriptor mapped 1-1, then appended the column you wish to get.
    I still went ahead and amended my class to include a read-only, non-toplink mapped attribute "FPO" which just gets the reference variable pointing to "refFPO.getFPO_NO();
    I answered my own question just in case anyone wondered ....

  • Mapping question - one dimensional to two dimensional

    Hi
       We are on XI 3.0 SP13 - and I have this mapping scenario
    Source structure - Linear & simple with say 10-20 fields -
    Target structure - Name -value field pair with an unbounded node on top -
                                <b>MsgAttrib 0-Unbounded
                                    Name
                                    Value</b>     
    I have to map each distinct field value from the source structure - to the Value field on target structure. The Name field in the target structure should contain the name of the source field ( it can contain a constant - field name if we cannot get the source element name during mapping runtime, thats ok )
    So basically each elementname and its value on the source structure form a record on the target xml. The next source element and its value will be mapped to the next record on the target xml - this filling up the two dimensional target structure - with as many rows as the number of source fields to be mapped. The number of such source fields to be mapped can grow . ( there should not be any limitation on that )
    Can this be accomplished using standard functions in message mapping - or should we resort to writing udfs ?
    Any right thoughts, solutions to solve this mapping scenario will be awarded points rightaway .....

    Hi karthik,
    The mapping that ur scenario requires can be accomplished using the standard functions...
    now ur source structure is unbounded...tht means it can have multiple occurences...
    and for each occurence you have a pair of values in target message under a node....
    now the important thing here is ..tht ur target node which has those two fields under it will repeat as many times as occurences of the source message...
    so u  need to map the main message type node of the source to this node in target...
    and according map the fields under tht node...
    UDF's are not required for this....
    Regards ,
    Sushil Hadge

  • Mapping question - File to Webservice scenario

    Hi
       I have a text file - that is pulled in by XI - using a ftp adapter - source interface. On the other side - target interface - we have a webservice whose definition is loaded into XI as a external interface defiinition - message type level.
    Now , for every record in the text file - I need to call the webservice method- once . The webservice method definition is such that - the top level node has occurence 1-1 and type is blank - The parameters to be passed to the method appear under it -
    I tried using split-by-value node function to make the mapping call the webservice method once for each record in my input text file - this results in the webservice method being called just once - not as I expected ( once for each record in my text file )
    Where am I going wrong with this ? Is it possible to make the call to the webservice method - with the top level node having the definition described above - once for each record in my source text file ? Since the webservice method has been imported as an external definition ( *wsdl ) , I am unable to put it under any other higher level element .
    Any pointers/suggestions as to where I am going wrong - how to make this scenario work will rewarded with full points.
    Thanks.

    Prakash
               Thanks for the reply. Yes, I have a file content conversion - involved here - I have already specified the value for No.of Recordsets per message as<b> 1</b>.
    However, I have specified the value for Recordset Structure as <b>TrkfileRecordset,*</b> - where TrkfileRecordset is my unbounded structure representing each line /record in my file .
    With this setting, the whole file is being converted to a single xml message - with the records in the file repeating as multiple TrkfileRecorset nodes. Maybe , if I change the * to a 1 in the Recordset Structure definition - the file adapter will read each file record as a single individual message - as per your suggestion of avoiding a BPM.
    Now, the typical volume we expect is 500 lines split across many file during a day - I am thinking - with this volume -whether involving a BPM ( which takes in one message per file and splits it ) or creating one xml message per record in the file ( which would mean 500 xml msgs per day ) would be better -
    Please share your thoughts on the options I have with XI SP13 to handle this scenario.

  • 1-1 mapping question

    I am trying to post the question in a different way. My previous post on the related subject can be found at Re: 1-1 mapping
    Two entities, Parent and Child, where a Parent has a Child (privately owned) or zero Child.
    In object model, Parent has an attribute child; Child does not have a parent attribute.
    Two tables, Parent and Child, with constraint where a child record cannot exist without its parent record (i.e. Child table has a foreign key to the Parent table).
    Class Parent and Child are mapped to table Parent and Child respectively.
    How do we define the 1-1 mapping in the Mapping Workbench so that Parent and Child can be inserted into the tables in one unif of work?
    Any comment or help would be greatly appreciated.
    Haiwei

    You can't do this as you described. You must have and map a relationship from child to parent in order to be able to map the 1-1 from parent to child (since your foreign key is in the child table).
    - Don

  • Port mapping question - I need clarification

    I have posted a question about port mapping previously but - although I thought I understood - it is still not working for me. I was hoping there was a kind soul out there who could humor me and explain port mapping with AEBS 802.11n as if there where talking to a 5 year old.
    Thanks for the help and it's ok to laugh.

    {quote:}This address MUST be outside of the range of IP addresses that your 802.11n AirPort Extreme Base Station's (AEBS) DHCP service is providing.{quote}
    This actually is incorrect.
    The statement that the mapped internal address must be static is correct; otherwise the AEBS will not, if the Mac is assigned a different dynamic (DHCP) IP address by the AEBS some time in the future, be able to forward packets to the Mac. However it is very straightforward to have the Mac computer be assigned an address dynamically by the AEBS and to have the AEBS always assign the same IP address to the same Mac computer. Thereby giving the Mac a static address inside the DHCP range.
    In the AirPort utility go to Internet | DHCP | DHCP Reservations. Click "+" then enter the MAC (what Apple calls Ethernet ID if you are using wired or AirPort ID if wireless) hardware address of the Mac computer, give it an IP address, save it. Then that Mac computer will always receive that (static) IP address from the AEBS.
    Why do this? Well by continuing to use DHCP (while having though a static IP address) you keep all the other benefits of DHCP such as automatically having the gateway address, the DNS server addresses given to the Mac. Otherwise you have to enter all this information manually on the computer if you put it outside the DHCP address range. This is very desirable, especially for most home users, as their DNS server entries are provided by their ASP and picked up by the AEBS. If the ASP changes DNS addresses the manually configured Mac machine will not know.
    So in summary - for port forwarding it is NOT necessary for the Mac machine to be outside the DHCP range, in fact _it is desirable to keep it in the DHCP range_ *as long as* the Mac utilises DHCP reservation on the AEBS.
    I have tested this and it works fine.

Maybe you are looking for