Reg:parsing design

Hi i've have alredy posted this under java/xml but no reponse ..not sure if i can post here .. and i need help with the design not code
want to know the right approach for the design .
This is wat my input xml going to be
<xpTransactions>
<transList>
<xpTrans name="ADD_AG">
           <childTrans>ADD_ED</childTrans>
           <childTrans>ADD_CD</childTrans>
</xpTrans>
<xpTrans name="ADD_ED">
                < actionIntf>add_r</actionIntf>
                <actionIntf>add_ml</actionIntf>
                   <actionIntf>sub_mlk</actionIntf>
</xpTrans>
<xpTrans name="ADD_CD">
                    <actionIntf>add_rkm</actionIntf>
                     <actionIntf>sub_mlcd</actionIntf>
                    <actionIntf>sub_mlki</actionIntf>
</xpTrans>
</transList>
</xpTransactions >
input to the java program will be xpTrans name so for eg when the input is ADD_AG i need to check whether it has any child and if it is then nee dto get all the elements underneath it ..so in this case we have two chilsd elements so the output should be
ADD_AG
ADD_ED
add_r
add_ml
sub_mlk
Add_CD
add_rkm
sub_mlcd
sub_mlki
when the input string is goin to be ADD_ED ( this does not have any child so )the output is just need to take all its child only
ADD_ED
add_r
add_ml
sub_mlk
Is it possible to produce a tree structure with above xml ?
if yes then use Jdom and create a tree structure and then store each node and its contents in alist ...is this approach corerct .
or shld i use other parseer and instead of producing tree structure jus store it in array or linked list and then manupalate it .what is the right approach to take ..thanks for the help

Is the format up to you? If it is, why not set it up like this?
<xpTransactions>
<transList>
<xpTrans name="ADD_AG">
    <xpTrans name="ADD_ED">
        < actionIntf>add_r</actionIntf>
        <actionIntf>add_ml</actionIntf>
        <actionIntf>sub_mlk</actionIntf>
    </xpTrans>
    <xpTrans name="ADD_CD">
        <actionIntf>add_rkm</actionIntf>
        <actionIntf>sub_mlcd</actionIntf>
        <actionIntf>sub_mlki</actionIntf>
    </xpTrans>     
</xpTrans>
</transList>
</xpTransactions >

Similar Messages

  • Reg "Parsing an empty source. Root element expected!"

    Hi techies,
    This is in regard of error generated while testing my configuration in configuration window.
    Till yesterday the senario is working for JDBC to JDBC.
    It is giving this error.
    "Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Parsing an empty source. Root element expected! at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:157) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java:534) Root Cause: java.io.IOException: Parsing an empty source. Root element expected!"
    My mapping and interface mapping is working fine when I tested them in Design window.
    Please suggest me how to go.
    Thanks In advance.
    Regards,
    Kiran

    Hi Hareen,
    Thanks for your reply.
    While Testing the scenario both at message mapping and interface mapping tests are working fine.
    even XML conversion is also fine at design end.
    only while testing in config window it is giving the error.
    Sender Interface mapping Test
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:mt_sender xmlns:ns0="http://jdbc_2_jdbc">
       <row>
          <NAME>Kiran</NAME>
          <ID>123456</ID>
          <ADDRESS>address</ADDRESS>
          <FLAG/>
       </row>
    </ns0:mt_sender>
    Reciver Interface mapping after test
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:mt_receiver xmlns:ns0="http://jdbc_2_jdbc"><Statement><dbTableName action="INSERT"><table>LIBRARY</table><access><LIBID>123456</LIBID><LIBNAME>Kiran</LIBNAME><LIBADDRESS>address</LIBADDRESS></access></dbTableName></Statement></ns0:mt_receiver>
    Upto this level it is working fine. Is there anything I have to refresh to carry out my editing to configuration window.
    Thanks in advance.
    Regards,
    Kiran

  • Reg: BPM design

    Hi All,
    I am bit confused on the solution approach of BPM design and I would like your suggestions in completing my task.
    Requirement :
    scenario is proxy to Jdbc .
    I will get two input files from the source system and I have combine two files information into database table :
    1) first file will come only once and have key field which I have to consider.
    2) second file  may come more than once based on bookings at source side( 3/5/6/8).
    with current design , able to capture only one output from this design . my current design is :
    Fork
    Two receive steps ( correlation enabled in two steps based on key value)
    transformation step
    send step.
    with the current design in bpm ,correlation will come out after the first message satisfies the condition. Now i want to loop in such away based on the second file input  correlation has to work ( there is no input from source to take count on files). pl guide me.
    Regards,
    Suman

    Hi,
    This is what happens: the first receive step starts the bpm. If you have, afterwards, some other receive steps you have to set up the correlation condition.
    Once a message is being sent, the engine looks at all the started BPMs and based on the correlation condition it assigns it to one of them (that's why it is important to have the correlation condition unique per instance).
    From what I understand, you have the first message and then you can get 1 to 4 more messages. So you always have at least two messages: the first one sets the correlation id for the second and further messages. This correlation condition/id is just a field in the message that corresponds. Now after you get the second message, you say that you already know how many other messages will follow, that's why I say put a loop block with the receive (which should have the same correlation as the other).
    Now the contents of the first message will be available to the other messages as long as you keep it in a separate container variable, and you can re-use it in the loop.
    Hope this helps,
    Horia

  • Reg Parser error

    Hello All,
    During Java mapping, we are getting following error in mapping:
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: </ expected(:main:, row:1, col:379377) at
    But If open the Input file there is no column 379377.
    This error may happened because of some spcl character in the Input file where parser is not able to read and throwing exception.
    How to find which character is causing the issue and what is the permanent fix to avoid this kind of problems in future
    Regards,
    Moorthy

    Hi,
        Looks like the xml tag is not closed properly in the data in the java mapping ...
    Check the document structure and the related tags have been associated properly..
    HTH
    Rajesh

  • Reg Query designer - Urgent

    Hello all,
    In the Query designer we have a structure in which I would like to edit one of the K.F . For example the K.F is a Formula K.f which is built on Fiscal year & Amount Now I've to include version to this K.F.
    Please let me know how this can be done at the earliest.
    Regards
    Madhavi

    Hi thanks for the quick response..
    I just want to change a K.F in the Structure i.e I want to edit the re-useable strucure by adding a component 0version to this  K.F.
    I am unable to restrict the K.F when I right click the K.F I can see only edit but not restrict..
    Plz suggest
    Regards
    Madhavi

  • Reg website design preview

    Hi all recently me and my friend designed a new website, we want to know the look and feel of website for upgarade the design. So tell me your suggestion for this website http://www.articlefyre.com

    I'm sure iWeb is.
    But I can't check as I have removed all extra languages to save space.

  • Reg:Funtional Design or specification

    Hi All,
    Can  i know the steps to be followed to prepare the Fucntional Design for a NEW SAP implementation.
    Thanks
    sasikanth

    Hi Sasikanth
    Are you looking for <a href="http://www.4shared.com/file/23731790/14a31f54/sap_fico.html">this</a>
    Please assign Points if useful
    Satish

  • Reg query design

    Hi,
    I'm designing a query. The details are below;
    In the row I have the characteristics
    1. Division
    2. Channel
    3. Material
    In the column I have the keyfigure
    1. Sales quantity
    2. Sale value
    We have about 10 channels. When the channel is 'CM' we need to restrict the Sales quantity and Sales value to a particular Customer. The remaining channels will be without any restrictions. How can I achieve this? Please advice.
    Thanks.

    Hi Morpheus,
    You can do it in a number of ways. Define a variable, write a relevant customer exit which puts the required restrictions which is obviously a tedious task.
    Else what I would recommend is to forward this data from the current data provider to a new data provider and with the help of the ABAP routines, you can provide the above restrictions in this routine.
    Let me know.
    regards,
    Sree.

  • Reg Table Design

    Hi,
    Iam working on the Customization of table in WebDynpro.I have an application which has 2 views - TableView and CustomView.In the CustomView i have a dropdownbyindex ui element which has the values as "Standard", "Transparent", "Alternating".When the user selects any of these values and clicks on the Apply button, the table design should be changed in the TableView.
    Can anyone guide me as how to proceed with this?
    I hope i made my requirement very clear.
    Regards,
    Padmalatha.K
    Points will be rewarded.

    Hi,
    Create an attribute of type "TableDesign" [com.sap.ide.webdynpro.uielementdefinitions.TableDesign]
    bind this attribute to the Type property of the table.
    In the init set the values as follows. or else change according your need.
    wdContext.currentContextElement().setTableDesign(WDTableDesign.STANDARD);
    And in the action handler of your drop down by index you can use the following code
    In the below code my attribute name is TableDesign
    Based on the condition you can use the following code to change the Type.
    //Assuming the key returns you the selected value as int 0..1..2
    switch (key) {
         case 1:
              wdContext.currentContextElement().setTableDesign(WDTableDesign.ALTERNATING);
              break;
         case 2:
              wdContext.currentContextElement().setTableDesign(WDTableDesign.TRANSPARENT);
              break
         default:
              wdContext.currentContextElement().setTableDesign(WDTableDesign.STANDARD);
              break;
    Regards
    Ayyapparaj

  • Reg: Universe Design

    Hi..
    I am using 8 tables in the Universe Design.
    If at all I use 7 tables and one table left like that...
    can i use the left over table in reporting with out including here........
    Regards
    L K Vepuri

    As long as the table exist in Classes and objects tab, you can make use of the table but you will end up in cartician product if you use the column values from that table to other tables
    Thanks,
    Ganesh

  • Reg:Parsing of an xml file in Wed Dynpro for java

    Hi all,
    I have an Xml file in my local pc and i have to parse that xml file i.e in that xml file i have to get the values of some fields and i have to set those values to the attributes of a node.so can any one help me out in solving this issue.
    Thanks,
    Mahesh

    hi mahesh,
    check this link
    http://help.sap.com/saphelp_nw04s/helpdata/en/5d/d0e678bcf90e46bf31447e7f38c9d6/frameset.htm
    thanks and regrads
    bvr

  • Reg: Universe Designing (Migration Project)

    Hi Gurus,
    I need Informtion related to the migration project.
    Migrating BO 5.1.7 to BO XI R 3.1.
    the old universe with old database is structured as.
    Eg: PTKEN as table name and objects as PTKEN.WASId
    the new ( migrated universe ) has the database structure as
    Eg: KEM_LKP_PTKEN as table anem and objects as WASId
    What the process has to be done to change all the tables in the universe with the new database...
    Regards
    L K Vepuri
    Edited by: L K Vepuri on Feb 28, 2011 3:56 PM

    Hi Mr. Vepuri,
    If the table name is changed at the universe level then follow the below steps.
    1. Open the universe in the designer
    2. Right click on the table which has been modified and rename it with the changed name.
    3. Click on the View>> Refresh Structure.
    4. and check whether it throws any error message or not.
    For Object  PTKEN.WASId--- what does it mean?
    Is it column name or object name at universe level.
    Object definition of each object is visible as Table_Name.Column_Name.
    If you want to change the object name then you can rename it.
    In order to propagate the changes made at a database level to universe level always click on the View >>refresh structure
    Hope it helps.
    Thanks,
    Sands

  • Reg. Design of report

    Hi,
    I have prepared an ALV report. I want to show the total no. of records displayed, on the top of the report beside the discription. And tell me is there any standards to be maintained inside the prog. like top-of-page, start-of-sele, end-of-page. is there mandatory.
    Regards
    Reddy

    Those events aren't mandatory,   you can write the total number of records like this.
    report zrich_0003 .
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    data: begin of imara occurs 0,
          matnr type mara-matnr,
          maktx type makt-maktx,
          end of imara.
    start-of-selection.
      perform get_data.
      perform write_report.
    *  Get_Data
    form get_data.
      select  mara~matnr makt~maktx
                into corresponding fields of table imara
                  from mara
                   inner join makt
                     on mara~matnr = makt~matnr
                            up to 100 rows.
    endform.
    *  WRITE_REPORT
    form write_report.
      data: fc_tmp type slis_fieldcat_alv.
    <b>  data: grid_title type  lvc_title.
      data: rowlines(4) type c.</b>
      clear: fieldcat. refresh: fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Number'.
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      fc_tmp-col_pos    = 2.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material'.
      fc_tmp-fieldname  = 'MAKTX'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '40'.
      fc_tmp-col_pos    = 3.
      append fc_tmp to fieldcat.
    <b>  describe table imara lines rowlines.
    concatenate 'This is grid title - Total Lines:' rowlines into grid_title
                           separated by space.</b>
    * CALL ABAP LIST VIEWER (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
              <b>  I_grid_title = grid_title</b>
                it_fieldcat = fieldcat
           tables
                t_outtab    = imara.
    endform.
    Regards,
    Rich Heilman

  • Could not parse mapping document form resource

    What is meaning of this error
    Could not parse mapping document from resource user.hbm.xml
    log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
    log4j:WARN Please initialize the log4j system properly.
    Exception in thread "main" java.lang.NullPointerException
         at UserClient.main(UserClient.java:39)

    I also faced same problem when i wrote my first hibernate mapping file, this error will accur because of bad xml parser design, the parser developer did not even validate and remove blank lines from xml before parsing it, becuse of that if there is first blank line in your xml mapping file then we will get "The processing instruction target matching "[xX][mM][lL]" is not allowed" error.
    Solution: Just check is there any blank line at the begining of your hibernate mapping file if so remove that then it will works fine.

  • Could not parse mapping document from resource

    HI All,
    I'm using hibernate3.2.2 I wrote the following code to contact the database but the system tells the error on it. My code is
    Dealer.java:
    package com.mapping;
    public class Dealer {
         private int id;
         private String name;
         private int did;
         public int getDid() {
              return did;
         public void setDid(int did) {
              this.did = did;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
    Product.java
    ------------------package com.mapping;
    public class Product {
         private int id;
         private int did;
         private String name;
         private double price;
         public int getDid() {
              return did;
         public void setDid(int did) {
              this.did = did;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public double getPrice() {
              return price;
         public void setPrice(double price) {
              this.price = price;
    JoinExample.java
    package com.mapping;
    import java.util.Iterator;
    import org.hibernate.Query;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
    import com.HibernateSessionFactory;
    public class JoinExample {
         public static void main(String args[]){
              Session session=null;
              try{
                   session = HibernateSessionFactory.getInstance().getCurrentSession();
                   session.beginTransaction();
                   String sql_query = "from Product p inner join p.dealer as d";
                        Query query = session.createQuery(sql_query);
                        Iterator ite = query.list().iterator();
                        System.out.println("Dealer Name\t"+"Product Name\t"+"Price");
                        while ( ite.hasNext() ) {
                        Object[] pair = (Object[]) ite.next();
                        Product pro = (Product) pair[0];
                        Dealer dea = (Dealer) pair[1];
                        System.out.print(pro.getName());
                        System.out.print("\t"+dea.getName());
                        System.out.print("\t\t"+pro.getPrice());
                        System.out.println();
                        session.close();
              }catch(Exception e){
                   e.printStackTrace();
    Dealer.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/
    hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class name="com.mapping.Dealer" table="dealer">
    <id name="id" type="java.lang.Integer" column="id">
    <generator class="increment"/>
    </id>
    <property name="name" type="java.lang.String" column="name"/>
    <property name="did" type="java.lang.Integer" column="did"/>
    <bag name="product" inverse="true" cascade="all,delete-orphan">
              <key column="did"/>
    <one-to-many class="com.mapping.Product"/>
    </bag>
    </class>
    </hibernate-mapping>
    Product.xml
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-mapping
    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/
    hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class name="com.mapping.Product" table="product">
    <id name="id" type="java.lang.Integer" column="id">
    <generator class="increment"/>
    </id>
    <property name="name" type="java.lang.String" column="name"/>
    <property name="did" type="java.lang.Integer" column="did"/>
    <property name="price" type="java.lang.Double" column="price"/>
    <many-to-one name="dealer" class="com.mapping.Dealer" column="did" insert="false" update="false"/>
    </class>
    </hibernate-mapping>
    hibernate.cfg.xml
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost/hibernate</property>
    <property name="hibernate.connection.username">root</property>
    <property name="hibernate.connection.password"></property>
    <property name="hibernate.connection.pool_size">10</property>
    <property name="show_sql">true</property>
    <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <!-- Mapping files -->
    <mapping resource="com/mapping/Dealer.hbm.xml"/>
    <mapping resource="com/mapping/Product.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>
    it throws the following example:
    log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
    log4j:WARN Please initialize the log4j system properly.
    %%%% Error Creating HibernateSessionFactory %%%%
    org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/mapping/Dealer.hbm.xml
         at org.hibernate.cfg.Configuration.addResource(Configuration.java:575)
         at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1593)
         at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1561)
         at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
         at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)
         at org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
         at com.HibernateSessionFactory.initSessionFactory(HibernateSessionFactory.java:39)
         at com.HibernateSessionFactory.getInstance(HibernateSessionFactory.java:23)
         at com.mapping.JoinExample.main(JoinExample.java:19)
    Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
         at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:514)
         at org.hibernate.cfg.Configuration.addResource(Configuration.java:572)
         ... 8 more
    Caused by: org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net
         at org.dom4j.io.SAXReader.read(SAXReader.java:484)
         at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:505)
         ... 9 more
    org.hibernate.HibernateException: Could not initialize the Hibernate configuration
         at com.HibernateSessionFactory.initSessionFactory(HibernateSessionFactory.java:56)
         at com.HibernateSessionFactory.getInstance(HibernateSessionFactory.java:23)
         at com.mapping.JoinExample.main(JoinExample.java:19)
    regards,
    Maheshwaran Devaraj

    I also faced same problem when i wrote my first hibernate mapping file, this error will accur because of bad xml parser design, the parser developer did not even validate and remove blank lines from xml before parsing it, becuse of that if there is first blank line in your xml mapping file then we will get "The processing instruction target matching "[xX][mM][lL]" is not allowed" error.
    Solution: Just check is there any blank line at the begining of your hibernate mapping file if so remove that then it will works fine.

Maybe you are looking for