Automatic XML output generation

i am trying to generate automatic xml output for a report. report dsnt take any parameters. i have written a xml definition
<report name="XML Report date spec GRFS03" DTDVersion="1.0">
<layout>
<section name="main">
<groupLeft name="G_LOC_CODE" >
<group>
<field name="LOC_CODE" source="loc_code"/>
<field name="QTTY" source="qty"/>
<field name="STK_NO" source="stk_no"/>
<field name="UNIT_COST" source="unit_cost"/>
<field name="USER_CODE" source="user_code"/>
</group>
</groupLeft>
</section>
</layout>
<customize>
<object name=”Gary D” type=”Report”>
//<properties>
//<property name=”beforeReportType”>File</property>
//<property name=”beforeReportValue”>C:\xmlreport.html
//</property>
</object>
</customize>
</report>
i have used SRW.APPLY_DEFINITION(xml_report.xml) for runtime customization but when i run report i get error : REP-6106: error in XML report definition at line 3 in 'xml_report.xml'
Root element name must match the DOCTYPE name.
can anyone suggest a solution to this?

JDOM has an XMLOutputter.
DOM Level 3 allegedly supports outputting from the DOM itself.
However if you don't want to use JDOM, and you don't have access to DOM Level 3, there is a way to do it using transformers. I'm not sure if this is a trick or whether it's considered the standard way to do it.
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
Document dom; // this is what you want outputted
OutputStream stream; // this is where you want it outputted
Transformer identity = TransformerFactory.newInstance().newTransformer();
identity.transform(new DOMSource(dom), new StreamResult(stream));Note that it's not actually much code if you keep the identity transform around for reuse. JDOM's approach is a lot simpler though. :-)

Similar Messages

  • Automatic xml file generation

    parsing xml file and then getting data from xml is ok but is there any api that support xml file generatoion from data itself
    help plz

    JDOM has an XMLOutputter.
    DOM Level 3 allegedly supports outputting from the DOM itself.
    However if you don't want to use JDOM, and you don't have access to DOM Level 3, there is a way to do it using transformers. I'm not sure if this is a trick or whether it's considered the standard way to do it.
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    Document dom; // this is what you want outputted
    OutputStream stream; // this is where you want it outputted
    Transformer identity = TransformerFactory.newInstance().newTransformer();
    identity.transform(new DOMSource(dom), new StreamResult(stream));Note that it's not actually much code if you keep the identity transform around for reuse. JDOM's approach is a lot simpler though. :-)

  • Generate XML output using DBMS_XMLGEN.getxmltype and not from rdf

    Hi,
    I have a requirement to display output from a particular table in XL format. Out of all the known possible options, I am planning to use the XML publisher to generate XL output.
    For the data source, instead of using the conventional way of creating XML data using rdf,I am planning to use DBMS_XMLGEN.getxmltype pl/sql procedure to generate the XML output. And from the output, call the template to generate the required Excel output.
    Now, I am using the following code to generate XML output but am not sure how to proceed from here. I need to first print the XML data in the FND Output file after which I was planning to call the 'XML Report Publisher' (XDOREPPB) program and use the current request id to get the excel output but I am not able to find the way to print the XML data in the output file as:
    fnd_file.put_line (fnd_file.output, l_xml_type); - is throwing an error as l_xml_type is an XML data output.
    PROCEDURE xml_main (
    errbuf OUT VARCHAR2
    ,retcode OUT VARCHAR2
    ,p_project_from IN VARCHAR2
    ,p_project_to IN VARCHAR2
    AS
    l_xml_type XMLTYPE;
    BEGIN
    SELECT DBMS_XMLGEN.getxmltype
    ('SELECT fnd_global.conc_request_id
    ,TO_CHAR (segment1)
    ,to_char(start_date,''MM/DD/RRRR'')
    ,to_char(xxmcc_project_details_pkg.current_profit_projection
    (project_id),''999,999,990.90'')
    ,to_char(xxmcc_project_details_pkg.cost_to_date (project_id),''999,999,990.90'')
    ,''1''
    FROM pa_projects_all
    WHERE segment1 BETWEEN NVL (p_project_from, segment1)
    AND NVL (p_project_to, segment1)')
    INTO l_xml_type
    FROM DUAL;
         fnd_file.put_line (fnd_file.output, l_xml_type);
    END xml_main;
    Can anyone point me as to how to publish XML output using a PL/SQL procedure (DBMS_XMLGEN.getxmltype)
    Thanks.

    Pl see if the example included in this presentation helps http://www.oracle.com/technology/products/applications/Events/OOW-2006/EBS/S281401_Sridhar_Bogelli.pdf
    Also, you do not need to explicitly call XDOREPPB in later versions of XML Publisher. If you set up everything correctly (as described in the presentation above and the link below) the Output Post Processor is called automatically after the XML file is generated successfully.
    Another excellent tutorial is at http://www.oracle.com/technology/obe/fusion_middleware/fusion/bi/xmlp_ebiz/index.html
    HTH
    Srini

  • How to create a xml output in report 2.5

    Hi
    Please Anyone using reports 2.5 and trying to
    implement XML outputsolutions ?? I have some
    oracle reports that need to produce XML output
    I know that 6i supports XML output. i dont know
    how to do in 2.5. If anyone has done anything similar
    to this, I'd be interested in hearing different solutions?
    Thanks,
    Parthi

    [ajayubbott],
    I am not sure if you should create another folder to house all your servlets when using Java Web Server 2.0.
    The servlet invoker of Java Web Server 2.0 looks at the <server_root directory>/servlets/ directory as the root servlet directory by default and any servlets that is housed under this directory is monitored by the custom class loader provided by Java Web Server 2.0.
    This custom class loader will automatically reload any serlvet class files that are modified i.e. a newer version of the servlet that is newly compiled e.g. change in functionality. What this means is that you don't have restart the web server to reload any new version of the existing servlets on the web server.
    HTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Urgent ! XML Output with header, body, trailer

    Gurus,
    I am trying to use Report to output an xml file with header, body and trailer regions. However, I find that the tool does not allow me to create a header region with info like <report_date>, <report_name>, <report_desc> etc.
    Moreover, the tool is not flexible that in the group level, it always automatically fills in the outer tag for me even if I intentionally leave it blank.
    So, except using the XML file output function, is there any other way outputing XML file using the tool? Otherwise, I may need to hard code a program to do so!
    Thanks for your advice!
    Shoshi

    Hi
    Reports XML file is driven by your queries and groups therein. This means that the groups (and break groups) are represented in XML form.
    It is not driven by the layout. So your header region does not appear.
    What I suggest is that you need to create a report level formula column in the Data Model. The formula returns date, name and description etc. Since this is a part of Data Model now, it will appear in the XML output.
    Regards
    Sripathy

  • Error in XML file generation :240416

    Hi All,
    I am facing problem with XML file generation.
    Steps:
    1. Source-->Query Transform and maintained Nested Stucture
    2. Generated XML fomat from query transform
    3. Created XML format file
    4. Make XML format as target and given XML generate path
    source table-->Query(nested structure)-->XML Format
    when I validate the job no errors found.
    Note: XSD file is in Local mechine and XML file will be generated in SFTP.
    Prooblems:
    1. Getting below error
    The input XML refers to file which is not part of the definition of this XML Schema format. Check your schema and XML files,
    and check that the root element in the XML file corresponds to the root element in the XML Schema
    Validate your XML Schema using external schema validators (found at w3.org)
    Thanks,
    Deepa

    Hi,
    I think issue Because in your Query Transform output the Root element is Query and XML target is having some other root element. Make the Query trasform name similar to root element and try...

  • Xml output format in sql*plus problem

    Hi all,
    In stead of seeing xml output in multiple line format, my sql*plus always returns xml output in ONE line, is there a way to change the format, it's really hard to read.
    Thanks
    1 select xmlelement("row", xmlelement("user", xmlattributes(username as "name", default_tablespa
    2 from dba_users
    3* where rownum=1
    SQL>/
    XMLELEMENT("ROW",XMLELEMENT("USER",XMLATTRIBUTES(USERNAMEAS"NAME",DEFAULT_TABLES
    <row><user name="SYS" tbs="SYSTEM"></user></row>
    however I want to see something well formatted like
    <row>
    <user name="SYS" tbs="SYSTEM"></user>
    </row>

    Not sure if there are any settings with the SQL*PLUS but if you use packages other than the SQLX operators like DBMS_XMLQUERY, DBMS_XMLGEN, SYS_XMLGEN to generate xml then the output is as desired.
    select dbms_xmlgen.getxml('select username, default_tablespace from dba_users
    where rownum=1') from dual
    DBMS_XMLGEN.GETXML('SELECTUSERNAME,DEFAULT_TABLESPACEFROMDBA_USERSWHEREROWNUM=1'
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <USERNAME>REVIEW</USERNAME>
    <DEFAULT_TABLESPACE>METRICS</DEFAULT_TABLESPACE>
    </ROW>
    </ROWSET>
    But these packages does not offer the flexibility you have with SQLX operators.
    so if you requirement is simple generation you can use the above method.

  • Created Excel Template XSL, but XML output always open IE (not Excel)

    Hello,
    We are using :
    -     XML Publisher : 10.1.3.4.1
    -     Oracle Appli : 11.5.10.2 ( DB : 10.2.0.4.0)
    - Oracle Reports Builder : 10.1.2.0.2
    We use Reports for building the query that is used with XML Publisher.
    We would like to use XML Publisher with an output Excel.
    After noticing a problem with display of numeric cells when using a RTF template ( decimal places, there's a lot of threads on this), we decided to follow an advice on xlspe.com, and we created a Excel template, that we saved as a XML Spreadsheet, and using the xlspe tools, we generated the XSL file.
    Then we defined everything in Oracle Applications EBS:
    - data definition
    - template ( XSL-XML as input, and XML as output. Note that XML is the only option)
    - executable ( execution method "Oracle Reports" )
    - program request : ( output format XML )
    This works fine when the use a RTF template with an output Excel. (except the issue on the decimal places). in the concurrrent requests form, the output button opens Excel correctly.
    When we go with a XSL template, with an output XML, the output generation works fine, but, in the concurrent requests form, the output button opens internet explorer IE instead of Excel (probably because it's a XML output file)
    I hope my explanation is clear.
    Did I make a mistake in the definition ?
    Is there anyone who has experienced and solved this issue ?
    Thanks a lot in advance,
    Olivier

    Hello,
    After many talks, I found out how to fix this issue.
    Basically, the issue is in Oracle Application where the MIME type is not defined for XML Excel type files.
    By default, XML is open with the browser.
    For solving the opening of XML Excel files with Excel (and not Internet Explorer IE), we had to add under the "System Admin > install > Viewer Options " a new entry for " XML - application/xnd.ms-excel - Microsoft Excel "
    And also, under the System profiles, for option "Viewer: Application for XML", set the value to Microsoft Excel, and, as well, for option "Viewer: Application : Text", set the value to Browser.
    This resolves the issue, and a XML Excel file generated by XML Publisher (from a XSL-XML template), is opened directly with Excel.
    Thanks for your contributrion,
    Olivier

  • Extract XML output to file using PL/SQL

    Hi.
    Since Oracle 8.1.4.7.1 I am using XML output in my applications.
    With that version of Oracle, my method was:
    1. Make the select;
    2. Create a file somewhere in my C drive;
    3. Create the XML file header;
    3. For each row, insert into the file, with the correct format;
    4. Close the file;
    ... and, voilá ... the XML file was made.
    Now, with the Oracle 10g, I know that I have much more ways to do it:
    1. Package DBMS_XMLQUERY
    2. Statements like
    "SELECT XMLELEMENT("USERS", XMLELEMENT("nome_pessoa", e.nome_pessoa ||' - '|| e.login), XMLELEMENT ( "password", e.password)) AS "result"
    FROM pessoa e"
    3. Or finally using XML SQL Utility.
    My question, is that if there is any way that i can make it all of this automatically. If there is any procedure or method that allow me to do all this stuff in just one step:
    1. Select in XML output;
    2. Creation of file;
    3. Insertion of Select output in file and Close of File;
    Thankx,

    I'm assuming that you want to write to the file system of the server that the database is running on...
    you'll have to use utl_file
    See
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96612/u_file.htm

  • Automate xml file

    Hello all,
    i am running invoice print selected invoices program in Receivables when i ran it i am getting Xml output code. now i want to send this code as a file (i.e., file.xml) through email automatically.
    please advise me.
    Thanks

    Hello,
    Maybe you should check if you can use Ant tool to do
    that. I am not sure if it can help u.
    Zeph.
    http://ant.apache.org/
    It will, specially if used in conjunction with XDoclets :
    http://xdoclet.sourceforge.net/
    XDoclet has Ant tasks to generate web.xml files.

  • How to get XML output from a stored procedure

    I have a very simple question:
    I would like to write a stored procedure (SP) that will return results in XML format (as a string). My tables in database are not of XML TYPE. But I need XML output.
    ie, SP will run like a typical SP but the only difference will be its output in XML.
    1) is it possible?
    2) if possible, how?
    Please, help
    Omer Koksal

    Thank you Peter, it was a great problem for me !
    Omer Koksal

  • Easiest and/or best methods for generating XML output (not with a report)

    Hi, several of our EBS customers (11.5.10) are converting their PDF reports to use XML/BI publisher to produce output. The data stream comes from a report that generates the XML output, and then the XML template is applied. This works great ... no problems, etc. From what I have read, however, Oracle intends to treat the traditional Forms and Reports Developers as legacy tools (although still supporting them, of course).
    My question is if I wanted to ditch using Reports to generate XML output, what, in your opinion or in your current usage, is the easiest way of getting this data? In Reports, the data modeler is excellent in providing a method to write your queries, split them into different repeating groups, write formula and summary columns, link multiple queries, etc, etc. If one were to become Reports Developer free, what comparable tools are available to take its place? I would expect this tool to handle a mix of GUI and coding like the Reports data modeler. Please note that I'm not looking for an EBS-specific solution -- say for a custom application using regular Oracle 10g DB and iAS, with BI Publisher for reporting.
    Thanks for your feedback,
    Ryan

    What I'm looking for is to not use Oracle Reports to generate the XML data output since Oracle's statement of direction is pushing BI Publisher rather than Oracle Reports as the preferred tool for reporting. That said, the data modeler in Reports provides a very flexible tool to construct and link multiple queries and to manipulate the queries into several levels of a master/detail relationship. Further, the mix of GUI and coding makes setting up the data model a lot more efficient. What I'm looking for (and I don't know if anything exists) is something comparable that can be used to generate XML output from the DB -- the idea being that I wouldn't use legacy tools, like Reports, for this task. I hope that is clearer.
    Really, another way of answering my question is, aside from Reports and the APIs mentioned so far, what are my fellow developers using, if anything, to extract XML data in a way that handles the features i list above?

  • When running an xml publisher report the xml output leads to 9 mb and the excel output file leads to 20 mb.But the output records is originally 4000 records. When copy to new excel it is showing 3.5 mb only. Does anyone knows the answer for this issue?

    When running an xml publisher report the xml output leads to 9 mb and the excel output file leads to 20 mb. The records contained in excel file is 4000 records. When taking the excel records and copy to new excel file the excel file size is 3.5 mb only.Why does the oracle software generates 20mb file?
    Does any one knows the answer please advice?

    Hello,
    This issue is because the Excel output from BI Publisher is MHTML (XML Publisher generates XHTML) not binary .xls.
    MHTML and XHTML are more verbose formats than binary .xls.
    It will be large because the current Excel output is just an HTML and not compressed like PDF. Please use the workaround (save it as .xls file).  This is a known limitation of RTF layout templates.
    BI Publisher Enterprise has a new feature True Excel Templates. The layouts generate binary Excel output.
    Excel Output File Size Generated By BI Publisher is Very Large (Doc ID 760437.1)
    Bogdan

  • How to create a errortag in the XML-Output ?

    Hey
    who can help me creating a error-tag in my XML-output of a PL/SQL procedure ?
    Enviroment:
    Oracle DB is 8.1.7 with installed XDK-package (in a few
    weeks perhaps Oracle 9i). I've no problems to use the dbms_xmlquery-functions and -procedures.
    I've to develop a PL/SQL procedure which is called via JDBC from a JAVA program. The procedure execute a Select-Statement. The result is transformed in XML and stored in a CLOB, which is given back to the calling JAVA-program.
    There exist 2 possible result-situations.
    -1- one or more rows are found
    -2- no row is found
    Problem:
    For each of these situation the XML-Output should have a different structure and my main problem is to integrate the errortag !!!
    for -1-
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <data>
    <error err_code="NoError"/>
    <record num="1">
    </record>
    <record num="2">
    </record>
    </data>
    for -2-
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <data>
    <error err_code="NoDataFound"/>
    </data>
    Hope somebody can help me ???
    Andre

    Hey Rajat,
    thanks for your answer, but the errortag is needed by another department. They use it for their processing.
    Have you got any idea, how to integrate the errortag with the functions or procedures of the dbms_xmlquery package ??? I've got only a few days experience with the dbms_xmlquery-package, so some code examples or advices would be great !!!
    I've tried the following coding:
    out_xmlresult OUT CLOB; -- OUT Parameter of the PLSQL-Proc
    c1 CLOB;
    queryctx dbms_xmlquery.ctxtype;
    -- create XML-context
    queryctx:=dbms_xmlquery.newcontext(<selectstatement>);
    -- delete the rowsettag (use 'data' later on)
    dbms_xmlquery.setrowsettag(queryctx,'');
    -- create new tag 'data' which enclose an empty header
    -- and the data section
    dbms_lob.createTemporary(c1, TRUE );
    c1:=EMPTY_CLOB();
    dbms_xmlquery.setDataHeader(queryctx,c1,'data');
    -- rename rowtag
    dbms_xmlquery.setrowtag(queryctx,'record');
    -- set encoding tag
    dbms_xmlquery.setEncodingTag(queryctx,'ISO-8859-1);
    -- create XML-Output
    out_xmlresult := dbms_xmlquery.getxml(queryctx);
    ...but I haven't got any success !!!
    Andre

  • Report XML output fail to load into .RTF layout [EBS r12]

    Hi,
    In EBS r12, we have requirement to have a standard report output in excel.
    I got the report's xml output to create the xml template (.RTF layout) using BI Publisher.
    I created the .RTF layout and it works fine on my laptop using Bi Publisher.. the xml loads into it and i can preview xml data on layout with all format (Excel, PDF...)
    I uploaded the layout to EBS, and assigned it to the standard report.
    I changed standard report out put to XML
    When i go to submit report request, the template is assigned with report and everything seems correct.
    [See screen shot: http://img35.imageshack.us/i/xmlt.jpg/]
    But after i run the report.
    The report is Completed with Warning status.. and output is only XML with Error message :
    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    The Log file says :
    Executing request completion options...
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 2350601 on node CLONE at 13-APR-2011 09:03:47.
    Post-processing of request 2350601 failed at 13-APR-2011 09:03:48 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    ------------- 2) PRINT   -------------
    Not printing the output of this request because post-processing failed.
    Finished executing request completion options.
    Why this is happening ? i have done this many times with other standard reports and it worked fine.
    Please advise.
    Standard Report: Supplier Aging Report
    EBS : 12.1.1

    please check the log file and post the output here
    How to find OPP log file?
    To investigate on XML issues or other publishing problems, often the OPP logfile is needed.
    OPP stands for Output Post Processor. Below are the steps to find log file
    1. Login to the application as SYSADMIN
    2. Responsibility: System Administrator
    3. Function: Concurrent --> Manager --> Administration
    4. Select the Output Post Processor
    5. Click on the Processes button
    6. Select the Concurrent Process which was active during the time that the request ran
    7. Click on the Manager Log button to open the Output Post Processor log file

Maybe you are looking for

  • Logc 7.1 drops when triggering MIDI loops?

    I have an Akai sampler, and when i trigger loops within logic 7 via midi, at the end of every bar the Logic stops the loop short of the bar? So if i do a 4 bar loop the re-triggering is fine until it comes around to loop back to the start again?!? wh

  • The onhand quantity at sub inventory level it is not showing correctly

    For an item the org level quantityt is showing correctly but at sub inventory level it is not showing correctly. 1)For an item org level the avilablty as below :                On Hand / Avail to Reserve / Avail to Transact are      oRG level        

  • Start over? 5th Generation?

    I don't know if my ipod is considered "5th Generation." It's a 30GB I bought a couple of years ago, supposedly it has video capability, but I've never used it. My question is, Can I start over? I had a PC when I got it and loaded all of my CDs onto m

  • Opening ppt under leopard

    I have a class where my prof makes all of the powerpoints available online. I use them to take notes in but prefer to open them in keynote, take notes, and then save them back to powerpoint. I'm having a problem after upgrading from 10.4.10 to 10.5 w

  • Youtube application doesn't work

    Hello I've bought a Toshiba JournE. Have it updated. But youtube need 30min to load. After loading the video does not work anyway