Mapping flat xml file to xml Structure

Hi all,
i have to map an xml file, wich is incoming via a RFC call in a flat import field, to a xml-Structure. The xml Structure has the same Structure except that it is not flat but even as a xml-Structure in the Repository. Ist ther a way to make a 1:1 - Mapping?
Regards Mathias

Hi,
This can be done very easily using Java Mapping.
Parse the flat xml String using Dom4j and directly set this as the target structure.
eg code:
public void execute(InputStream in, OutputStream out) throws StreamTransformationException{
String flatXml = "the flat xml string";
Document doc = DocumentHelper.parseText(flatXml) ;
out.write(doc.asXML().getBytes());
Regards,
P.Venkat

Similar Messages

  • Transforming XML File to abap structure

    Hello,
    I am working in a new project for making an input interface.
    The problem to resolv is :
    1>Reading an XML file on a unix Server
    2>Transforming this file in abap structure with the instruction
    call transformation.
    Format of the input file :
    <LISTEART>
    <ART code="A01" label="Designation A01"/>
    <ART code="A02" label="Designation A02"/>
    <ART code="A03" label="Designation A03"/>
    <ART code="A04" label="Designation A04"/>
    <ART code="A05" label="Designation A05"/>
    </LISTEART>
    Format of the abap structure :
    DATA : BEGIN OF ws_art,
      code(4)      TYPE c,
      label(3)  TYPE c,
    END OF ws_art.
    DATA : wt_art LIKE ws_art OCCURS 0 WITH HEADER LINE.
    is it possible to transform the input file to an internal table
    with the call transformation ?
    CALL TRANSFORMATION transfo
       SOURCE XML xml_string
       RESULT para = result.
    Somebody can explain me how to create links between xml file
    and abap structure ?
    with regards 
    JLuc Ledoux
    [email protected]

    Hi,
    try like this.
    TYPES: BEGIN OF day,
    name TYPE string,
    work(1) TYPE c,
    END OF day.
    DATA: BEGIN OF week,
    day1 TYPE day,
    day2 TYPE day,
    day3 TYPE day,
    day4 TYPE day,
    day5 TYPE day,
    day6 TYPE day,
    day7 TYPE day,
    END OF week.
    DATA xml_string TYPE string.
    DATA result LIKE week.
    week-day1-name = 'Monday'. week-day1-work = 'X'.
    week-day2-name = 'Tuesday'. week-day2-work = 'X'.
    week-day3-name = 'Wednesday'. week-day3-work = 'X'.
    week-day4-name = 'Thursday'. week-day4-work = 'X'.
    week-day5-name = 'Friday'. week-day5-work = 'X'.
    week-day6-name = 'Saturday'. week-day6-work = ' '.
    week-day7-name = 'Sunday'. week-day7-work = ' '.
    CALL TRANSFORMATION ...
    SOURCE root = week
    RESULT XML xml_string.
    CALL TRANSFORMATION ...
    SOURCE XML xml_string
    RESULT root = result.
    Regards,
    Vijay

  • XML file 2 XML file

    Hi all,
    I have low experience with XI but I have created a scenario XML file to XML file (reference wiki.sdn.sap.com) where sender e receiver files are located into XI folders . The steps defined are :
    product;
    software component;
    technical system (thirdy-part);
    business system;
    import sofware component into integration repository;
    namespaces;
    data type (sender/receiver);
    message type;
    message interface;
    message mapping;
    interface mapping;
    configuration scenario into integration config.;
    assign business system;
    communication channel;
    file adapter with source e destination directory (folder XI), file name e processing parameters;
    receiver and interface determination
    sender and receiver agreement.
    When put the input file into sender folder I don't have output file and sxmb_moni is empty for XML message.
    Thanks in advance.
    Miki

    Hi Maurizio,
    you don't see anything entering inside your sxmb_monitoring: do you mean that the payload is empty or that you don't see any messages in the overview table?
    If you don't see any messages, this means that in the message is not send from your adapter engine towards your integration engine.
    Check wether:
    1) your communication is set up properly and is active
    2) your communication channel is functioning correctly via communication channel monitoring in the runtime workbench (goto the integration builder --> runtime workbench --> Component monitoring --> click on display --> click on adapter engine --> click on communication channel monitoring --> search for you communication channel and check for errors.
    3) check your sender agreement
    If you have an empty payload, check your payload in the first step of your message pipeline and check wether the payload has the expected layout.
    Kind regards
    Joris

  • Getting error while running the XML file using XML Publisher Desktop

    Hi all,
    We have successfully loaded the XML file using XML Publisher Desktop. But when we preview the same using PDF format we are getting the following error.
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\smanmadh\Desktop\ProductCompensationDT.xml
    FOProcessor setLocale: en-us
    java.lang.NullPointerException
         at oracle.apps.xdo.template.fo.area.PageNumber.formatString(PageNumber.java:104)
         at oracle.apps.xdo.template.fo.IDManager.registerId(IDManager.java:44)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageJoinSeq(AreaTree.java:1106)
         at oracle.apps.xdo.template.fo.area.AreaTree.incrementJoinSequenceIndex(AreaTree.java:219)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageDocument(AreaTree.java:1089)
         at oracle.apps.xdo.template.fo.area.AreaTree.forceOutput(AreaTree.java:471)
         at oracle.apps.xdo.template.fo.elements.FORoot.end(FORoot.java:58)
         at oracle.apps.xdo.template.fo.FOHandler.endElement(FOHandler.java:386)
         at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
         at oracle.apps.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:279)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:1022)
         at RTF2PDF.runRTFto(RTF2PDF.java:626)
         at RTF2PDF.runXDO(RTF2PDF.java:460)
         at RTF2PDF.main(RTF2PDF.java:251)
    Thanks in Advance.
    Sudeep.

    This is BI related. You will get a quicker answer from the BI Publisher forum
    BI Publisher

  • Error while running the XML file using XML Publisher Desktop

    Hi All,
    We have successfully loaded the XML file using XML Publisher Desktop.But when we try to preview it using the PDF format we are getting the following error.
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\smanmadh\Desktop\ProductCompensationDT.xml
    FOProcessor setLocale: en-us
    java.lang.NullPointerException
         at oracle.apps.xdo.template.fo.area.PageNumber.formatString(PageNumber.java:104)
         at oracle.apps.xdo.template.fo.IDManager.registerId(IDManager.java:44)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageJoinSeq(AreaTree.java:1106)
         at oracle.apps.xdo.template.fo.area.AreaTree.incrementJoinSequenceIndex(AreaTree.java:219)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageDocument(AreaTree.java:1089)
         at oracle.apps.xdo.template.fo.area.AreaTree.forceOutput(AreaTree.java:471)
         at oracle.apps.xdo.template.fo.elements.FORoot.end(FORoot.java:58)
         at oracle.apps.xdo.template.fo.FOHandler.endElement(FOHandler.java:386)
         at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
         at oracle.apps.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:279)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:1022)
         at RTF2PDF.runRTFto(RTF2PDF.java:626)
         at RTF2PDF.runXDO(RTF2PDF.java:460)
         at RTF2PDF.main(RTF2PDF.java:251)
    Any pointers will be of great help.
    Thanks in Advance
    Sudeep.


    I had a similar error which when I searched, came up with this thread.
    My issue was resolved after I discovered that my RTF template was not really RTF. It was sill in MS Word DOC format. This was discovered by reviewing two templates in NOTEPAD. The MS-DOC files have a lot of "special" characters in them. My RTF was not really RTF.
    After doing a SAVE AS - RTF format, then the preview worked as expected.
    Just Sharing...
    --Tim                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • JSTL - Problem parsing XML file w/ XML schema declarations

    I'm having trouble parsing an xml document that contains XML schema declarations in the root element. I've included 2 snippets, the XML files they're supposed to parse, and their output below. The first one works and the second one doesn't. Could someone please tell me why? I find it hard to believe that no one's run into this before.
    I'm running Tomcat 5.5 and I'm using JSP 2.0, jakarta standard taglibs jars (1.1.2), jdk 1.5.0_04, and the Xalan 2.7.0 jars.
    Here's the first snippet:
    <c:import url="/WEB-INF/config/schools.xml" var="xml" />
    <x:parse doc="${xml}" var="schoolList"/>
    There are <x:out select="count($schoolList//school)"/> schools in the file:<br/>
    <x:forEach select="$schoolList//school">
         <x:out select="name"/><br/>
    </x:forEach>it parses the following xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <schools>
         <school id="34033">
              <name>Tumwater Middle School</name>
              <district>Tumwater</district>
              <type>middle</type>
              <active>false</active>
         </school>
         <school id="17001">
              <name>Garfield High School</name>
              <district>Seattle</district>
              <type>high</type>
              <active>true</active>
         </school>
         <school id="00023">
              <name>Tigard High School</name>
              <district>Tigard-Tualatin</district>
              <type>high</type>
              <active>true</active>
         </school>
    </schools>and it outputs:
    There are 3 schools in the file:
    Tumwater Middle School
    Garfield High School
    Tigard High School-----------------------------------------
    The second snippet:
    <c:import url="/WEB-INF/config/schools2.xml" var="xml2" />
    <x:parse doc="${xml2}" var="schoolList2"/>
    There are <x:out select="count($schoolList2//school)"/> schools in the file:<br/>
    <x:forEach select="$schoolList2//school">
         <x:out select="name"/><br/>
    </x:forEach>parses this xml file (note the xml schema declarations):
    <?xml version="1.0" encoding="UTF-8"?>
    <schools xmlns="http://www.serenus.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.serenus.com schools.xsd">
         <school id="34033">
              <name>Tumwater Middle School</name>
              <district>Tumwater</district>
              <type>middle</type>
              <active>false</active>
         </school>
         <school id="17001">
              <name>Garfield High School</name>
              <district>Seattle</district>
              <type>high</type>
              <active>true</active>
         </school>
         <school id="00023">
              <name>Tigard High School</name>
              <district>Tigard-Tualatin</district>
              <type>high</type>
              <active>true</active>
         </school>
    </schools>and its output is:
    There are 0 schools in the file:That's it! No errors at all! I'm 100% certain the variable names, filenames, etc. are correct. I've looked everywhere for an existing answer to this problem, but I can't find one. Is this a known issue? Please help.
    -Ben

    Hi Ben,
    I got exactly the same problem and also could not find any solution.
    Did you find a way out for this problem meanwhile?
    Any help is welcome!

  • Hi I need this asap... "Java code to generate XML File from XML Schema"

    Hi all....
    I need this asap... "Java code to generate XML File from XML Schema i.e XML Schema Definition, XSD file".
    Thankz in advance...
    PS: I already posted in the afternoon... this is the second posting.

    take look at :
    http://sourceforge.net/projects/jaxme/
    this might help...

  • Java code to generate XML File from XML Schema

    Hi I need this asap... "Java code to generate XML File from XML Schema i.e XML Schema Definition, XSD file".
    Thankz in advance...

    JAXB has been available as an early release download for some time. There are also XML Binding packages available from Borland (JBuilder) and Castor. These tools create Java classes from a source document, xml,dtd etc. You can use these classes to marshal-unmarshal XML documents.
    Dave

  • 403 Error Transmitting the message to endpoint for XML file to XML file

    Friends,
    This is my 4th day learning XI and getting below issue.
    I'm trying to follow the steps to transfer XML file to XML file scenario and when I drop the sender XML file, it seems the file has been picked-up but it does not generate the output file.
    I checked in RWB for the message and found below error:
    2008-01-04 13:09:48 Error Transmitting the message to endpoint http://sappc:8000/sap/xi/engine?type=entry using connection AFW failed, due to: Received HTTP response code 403
    I tried to access http://sappc:8000/sap/xi/engine?type=entry from new browser window and I get the same error "403".
    I'm able to access http://sappc:8000 fine.
    I would appreciate help on this.
    Thanks in advance.
    Hetal

    Sorry! you were correct I was looking at wrong file adapter. The message is error: (It gives 401 error during XICACHE update)
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Receiver Identification
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="XICACHE">UPDATE</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>HTTP status code401 Unauthorized</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>An error occurred when refreshing the XI runtime cache</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

  • Storing xml file (NOT XML DATA) in oracle database

    Hi,
    i want to know if is it possible to store whole xml file (eg: abc.xml) as one variable (CLOB) in one of the columns of a table..
    i dont want the data contained in the abc.xml to be stored in table/database, but the whole abc.xml file, including all the < and > symbols,, basically a text file.
    Thanks,
    RK

    Hi,
    I need to store the data from XML file in table using XML Parser for PL/SQL can anyone please help me out with this my database version is 8.1.7. I even need help on creating XML file using XML Parser for PL/SQL, any help in this regard will be a boon for me.
    Best Regards,
    Vijay Sehgal

  • Example of storing a prefix name space xml file in XML DB ?

    I have lots of XML file pass to me with prefix name space all over the file. Is there any example of how to stored and retrieved this type of XML file to XML DB?
    Example of the XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <ddms:Resource xmlns:ddms="http://metadata.dod.mil/mdr/ns/DDMS/1.3/" xmlns:ICISM="http://metadata.dod.mil/mdr/ns/DDMS/1.3"
         xmlns:gml="http://metadata.dod.mil/mdr/ns/DDMS/1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://metadata.dod.mil/mdr/ns/DDMS/1.3/ ../DDMS-v1_3_1033.xsd">
    <ddms:identifier ddms:qualifier="http://metadata.dod.mil/mdr/ns/MDR/0.1/MDR.owl#URI"
              ddms:value="http://www.whitehouse.gov/news/releases/2005/06/20050621.html"/>
    </ddms:Resource>

    Hi
    What is the error you get if you try to load the file ?
    May be you have to change the schema location of the xsd to an absolute path in your exable it is relative
    xsi:schemaLocation="http://metadata.dod.mil/mdr/ns/DDMS/1.3/ ../DDMS-v1_3_1033.xsd"
    regards Patrick

  • Mapp Xml file to abap structure

    Hi All ,
    i have XML file and i want map it to abap structure ,
    how can i do so ?
    Best Regards
    Joy

    Hi,
    try like this.
    TYPES: BEGIN OF day,
    name TYPE string,
    work(1) TYPE c,
    END OF day.
    DATA: BEGIN OF week,
    day1 TYPE day,
    day2 TYPE day,
    day3 TYPE day,
    day4 TYPE day,
    day5 TYPE day,
    day6 TYPE day,
    day7 TYPE day,
    END OF week.
    DATA xml_string TYPE string.
    DATA result LIKE week.
    week-day1-name = 'Monday'. week-day1-work = 'X'.
    week-day2-name = 'Tuesday'. week-day2-work = 'X'.
    week-day3-name = 'Wednesday'. week-day3-work = 'X'.
    week-day4-name = 'Thursday'. week-day4-work = 'X'.
    week-day5-name = 'Friday'. week-day5-work = 'X'.
    week-day6-name = 'Saturday'. week-day6-work = ' '.
    week-day7-name = 'Sunday'. week-day7-work = ' '.
    CALL TRANSFORMATION ...
    SOURCE root = week
    RESULT XML xml_string.
    CALL TRANSFORMATION ...
    SOURCE XML xml_string
    RESULT root = result.
    Regards,
    Vijay

  • Combine several XML files with same structure

    Hello,
    I have several XML files with the same structure and I want to combine them and create a new XML file to be bale to compare that information easily. It does not look very difficult but as I am very new in this I am not bale to get it
    The structure of my actual files would be something simlar to:
    Root->...-> Name->Address, Telephone
    And what I would like to have si something like
    Root->.... ->Address-> Name 1,Name 2....
    Root -> ...->Telephone-> Name 1, Name 2....
    Does anyone know how to do this.
    Thanks

    You could write a XSL transformation file that does this and transform your input file via
         * Transform XML file with a style sheet.
         * <p><b>Example:</b><p>
    <table align="center" bgcolor="#E0E0E0" border=1 cellpadding="10" cellspacing="0"><tr><td><pre style="margin-top:0; margin-bottom:0">
    XMLTransformer t = new XMLTransformer();
    FileOutputStream fos = new FileOutputStream("C:/Project/result.html");
    String xmlFile = "C:/Project/source.xml";
    String styleSheet = "C:/Project/stylesheet.xsl";
    t.transform(xmlFile, styleSheet, fos);
    </pre></td></tr></table>
         * @param xmlfile The XML file to transform.
         * @param style Stylesheet to use for transformation.
         * @param outputStream OutputStream to write the transformed result to.
        public void transform(String xmlfile, String style, OutputStream outputStream) {
            DocumentBuilderFactory factory =  DocumentBuilderFactory.newInstance();
            //factory.setNamespaceAware(true);
            //factory.setValidating(true);
                //todo: use inputstreams instead of file names
                try {
                    File stylesheet = new File(style);
                    File datafile   = new File(xmlfile);
                    DocumentBuilder builder = factory.newDocumentBuilder();
                    document = builder.parse(datafile);
                    // Use a Transformer for output
                TransformerFactory tFactory = TransformerFactory.newInstance();
                StreamSource stylesource = new StreamSource(stylesheet);
                Transformer transformer = tFactory.newTransformer(stylesource);
                DOMSource source = new DOMSource(document);
                StreamResult sr = new StreamResult(outputStream);
                transformer.transform(source, sr);
            } catch (TransformerConfigurationException tce) {
               // Error generated by the parser
               System.out.println ("\n**XMLTransformerr Factory error");
               System.out.println("   " + tce.getMessage() );
               // Use the contained exception, if any
               Throwable x = tce;
               if (tce.getException() != null) {
                   x = tce.getException();
               x.printStackTrace();
            } catch (TransformerException te) {
               // Error generated by the parser
               System.out.println ("\n** Transformation error");
               System.out.println("   " + te.getMessage() );
               // Use the contained exception, if any
               Throwable x = te;
               if (te.getException() != null) {
                   x = te.getException();
               x.printStackTrace();
             } catch (SAXException sxe) {
               // Error generated by this application
               // (or a parser-initialization error)
               Exception  x = sxe;
               if (sxe.getException() != null) {
                   x = sxe.getException();
               x.printStackTrace();
            } catch (ParserConfigurationException pce) {
                // Parser with specified options can't be built
                pce.printStackTrace();
            } catch (IOException ioe) {
               // I/O error
               ioe.printStackTrace();
        }//transform()

  • Simple XML import via url (not xml file, rather xml stream)?

    Looking to solve this issue: have a web-based application and need to populate form with data in order to generate custom report. Understand I can create an xml file and have the pdf read this file. Want to avoid creation of file and get data directly from url (e.g. https://myserver/list/widgets/format/xml - this request will return the xml). I can do this in Flash by specifying a url as opposed to a flat file when importing data. Does LiveCycle offer the same feature?
    Appreciate your time and responses!

    Richard,
    I guess a link or shortcut won't do the trick as it is still pointing to the actual file that is stored in the repository that is enabled in the xmlforms_filter....
    What might be worth trying is to create 2 new File System repositories that point to the same File System.
    For example: fsr_xml_plain and fsr_xml_fancy point to lets say  Windows: C:/my/test/folder or Unix: /my/test/folder...
    Then you add the repository fsr_xml_fancy to the xmlforms_filter and you leave fsr_xml_plain out of it.
    Now if you call https://server.url.com:50100/irj/go/km/docs/fsr_xml_fancy/file.xml then you get the formatted xml file
    and if you call https://server.url.com:50100/irj/go/km/docs/fsr_xml_plain/file.xml then you get the unformatted plain xlm file
    I don't know if above works as I don't have the time to validate it for you at this moment.
    Good Luck,
    Benjamin Houttuin

  • Read Data XML Files or Xml Schema

    Hi
    I need load info from XML files o schemas, using JavaScript
    How is the conecction a xmlshema o xml file with JavaScript?
    Thanks

    This product does look to be ok, however it is missing a couple features that I would like the product to have.
    I would like this product to be able to insert/update data across multiple tables. Being able to do such things as generate foreign key relationships.
    It doesn't seem as though the XML being generated can be customized very easily. Some XML formats I deal with are very complex (such as X12/EDI).
    I would really like a graphical mapper.
    Here is a note from the doc:
    Storing XML Data Across Tables
    Currently the XML SQL Utility (XSU) can only store data in a single table. It maps a canonical representation of an XML document into any table or view. But there is a way to store XML with XSU across tables. You can do this using XSLT to transform any document into multiple documents and insert them separately. Another way is to define views over multiple tables (using object views if needed) and then do the insertions into the view. If the view is inherently non-updatable (because of complex joins), then you can use INSTEAD OF triggers over the views to do the inserts.
    This product looks really good, I was hoping that Oracle had something comparable:
    http://www.hitsw.com/products_services/xml_platform/allora.html

Maybe you are looking for