XML - Output - HTML

hi,
I wrote the following statements:
public static void main(String[] args) throws Exception
   String docname = "test.xml";
       String sheetname = "test.xsl";
       SAXBuilder builder = new SAXBuilder();
       Document doc = builder.build(docname);
       XSLTransformer transformer = new XSLTransformer(sheetname);
       Document doc2 = transformer.transform(doc);
       new XMLOutputter().output(doc, "test.html");
}So I wrote a stylesheet named test.xsl which transforms the test.xml file and I want to write the result of the transformation in the test.html file. Unfortunately this does not work because the output-method expects as second argument an output-stream.
Does anybody know here how I have to change my code in order that the transformation result of the test.xml is written to the test.html file?:(
Message was edited by:
patrick270881

new XMLOutputter().output(doc, "test.html");You say you need to have an output stream for the second parameter of that method? Then how aboutnew XMLOutputter().output(doc, new FileOutputStream("test.html"));

Similar Messages

  • Can TestStand 3.0 generate XML output instead of HTML?

    Can TestStand 3.0 generate XML output instead of HTML?

    Hi
    TestStand can generate XML reports instead of HTML.
    This can be changed under Configure -> Report Options and choose XML instead of Html
    Hope this helps
    Regards
    Anand Jain
    National Instruments

  • Urgent! How to suppress indents in output from (XML , XSL) -- HTML

    I make transformation (XML , XSL) --> HTML using parser v2 of Oracle XDK for Java v 9.2.0.2.0
    I want to generate html in which several tags will follow one after another without new line, and indents.
    Like this
    <html>
    <body>
    <img src="1.jpg"/><img src="2.jpg"/>
    </body>
    </html>
    Only in this case images will be visualized in IE5 together without spaces.
    But xsl-processor is formatting output text: put each tag on new line and make indents for child tags.
    I tried to
    1) eliminate white spaces in xsl
    2) use <xsl:output indent="no"/>
    3) use <xsl:strip-space elements="*"/>
    4) use method setPreserveWhitespace(true/false) of XMLParser (oracle.xml.parser.v2.XMLParser)
    Xsl-processor continue to format output text.
    my xml
    <list>
    <element name="1.jpg" />
    <element name="2.jpg" />
    </list>
    my xsl
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="no"/>
    <xsl:strip-space elements="*"/>
    <xsl:template match="list">
    <html><body>
    <img src="{element[1]/@name}"/><img src="{element[2]/@name}"/>
    </body></html>
    </xsl:template>
    </xsl:stylesheet>
    html-output
    <html>
    <body>
    <img src="1.jpg"/>
    <img src="2.jpg"/>
    </body>
    </html>
    Please help me!

    html-output
    <html>
    <body>
    <img src="1.jpg"/>
    <img src="2.jpg"/>
    </body>
    </html>
    Please help me!

  • 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

  • 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 output HTML when called from a browser

    We are trying to replace a small web app with a bpel app so it has to return HTML. I keep getting XML of the HTML as output from this simple app. It doesn't interpret the html. The bpel uses a simple assign that puts an HTML string into the "body" message then passes it to the "reply".
    I have found out how to call this from the browser by changing "orabpel" in the url to "httpbinding" and then adding the "operation" onto the endpoint.
    from: http://server:7777/orabpel/default/ws1/1.0
      to: http://server:7777/httpbinding/default/ws1/processIs it possible to output html back to the browser and have the bpel look like a web page? Setting the mimetype of the output message type to "text/html" seems to have no effect at all.
    Here is my wsdl:
    <?xml version="1.0"?>
    <definitions name="HTTPGetService"
                 targetNamespace="http://services.otn.com"
                 xmlns:tns="http://services.otn.com"
                 xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
                 xmlns="http://schemas.xmlsoap.org/wsdl/"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                 xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
        <message name="HTTPGetServiceRequestMessage">
            <part name="Region" type="xsd:string"/>
            <part name="EffectiveDate" type="xsd:string"/>
            <part name="EndDate" type="xsd:string"/>
            <part name="acc1" type="xsd:string"/>
            <part name="acc2" type="xsd:string"/>
        </message>
        <message name="HTTPGetServiceResponseMessage">
            <part name="body" type="xsd:string"/>
        </message>
        <!-- portType implemented by the HTTPGetService BPEL process -->
        <portType name="HTTPGetService">
            <operation name="process">
                <input message="tns:HTTPGetServiceRequestMessage"/>
                <output message="tns:HTTPGetServiceResponseMessage"/>
            </operation>
        </portType>
        <binding name="HTTPGet" type="tns:HTTPGetService">
            <http:binding verb="GET"/>
            <operation name="process">
                <http:operation location="/process"/>
                <input>
                    <http:urlEncoded/>
                </input>
                <output>
                    <http:urlEncoded/>
                    <mime:content type="text/html" part="body"/>
                </output>
            </operation>
        </binding>

    Hi,
    Open up admin console. Expand "Servers" node to view servers in domain.
    Right click on a server (or select Logging/ General tab) and select "view
    server log".
    Regards,
    Jon

  • Passing through XML in HTML forms without it being displayed in Web Browser

    Dear all
    I have some MapViewer XML stored in a variable, which I wish to pass through a HTML form. However whenever I insert the variable into the form and run the procedure, my web browser starts reading the actual XML and treating it as HTML, since it is only part of a complete XML script. Even if it was a complete XML script, it would still try and display it. Is there away of making sure the value is passed through without being read by the browser?
    For example:
    PROCEDURE DISPLAY
    AS
    var_xml VARCHAR2(32767) :='<theme name="theme_county"/>';
    htp.print('<INPUT TYPE = "hidden"
                      NAME ="var_xml"
                      VALUE = "' || var_xml || '" />Then causes the output to the browser to become:
    htp.print('<INPUT TYPE = "hidden"
                      NAME ="var_xml"
                      VALUE = "<theme name="theme_county"/>" />The browser is of course reading the XML as HTML.
    Kind regards
    Tim

    Dear all
    I have now resolved the problem by submitting values which can then be used to recreate the xml in another function, rather than actually submitting the xml itself through the forms. This makes more sense and avoids people having to see any of the xml.
    Kind regards
    Tim

  • Controlling XML output Livecycle Designer 8.0

    Hello.
    I am new to XML and somewhat new to LiveCycle Designer, however I have acclimated rather well.
    Here is what I want to do:
    1) Create a PDF fill-in-form (including various fields...text, numeric, radio buttons, and some FormCalc functions)
    2) Create a Submit button that emails an XML file to the form administrator
    3) Use MS Excel to import XML files into pre-mapped fields
    Basically, I do not have server database support, and this is the best workaround (and most functional) I could come up with.
    After mapping fields in Excel, I exported the *.xsd and created a new data connection within LiveCycle. Then, I linked the schema fields with the bindings - corrected any errors, and have tested the form (form1). I made the submit button - that's all good, too. When I import the XML into Excel - that's where I have a problem, and it's not an issue with Excel to my knowledge, but rather how the form generates the XML output.
    For example, I have 25 fields that will be outputted via XML. My PDF form consists of 4 pages (8.5" x 11"). When I created the form and got to the end of the page, I "inserted new page" and went on my merry way. When I import the XML, Excel properly maps the fields, however, it does not import the info to a single row. What I have discovered is that since my PDF form consists of 4 pages (each bound to "sheet[*]"), the XML output looks like the following:
    Example of the XML output from my form:
    <form1>
    <sheet>
    <submissionID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >743</submissionID>
    <reviewerID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >234</reviewerID>
    <date xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >24/01/2008</date>
    </sheet>
    <sheet>
    <tag1>input</tag1>
    <tag2>input</tag2>
    </sheet>
    </form1>
    Wherever there is a "<form>" tag (hence a new page in my PDF document), Excel puts that data on a new column. All fields within form1 are imported and mapped to the correct field, however importing a single XML file will occur on 4 rows.
    I bound each "page" as "sheet[*]" mostly because that is the only way I knew how to use FormCalc to do calculations from fields that occur at different places throughout the document.
    So, I have tried to be as clear as possible, and would like suggestions/help as how to control the XML output from a LiveCycle document. If I am to modify the outputted XML and remove the multiple instances of <sheet> and </sheet> then Excel imports the data just fine and on a single row.
    I would love some help on this rather specific problem. I guess it's a very basic issue that someone with experience could help.
    Thank you so much!!
    Jim

    I have a vital form that clients fill out, which is passed to many people in the company along the workflow. The form is a Planner and we have in the following PDF, Word Doc..
    Well before, the Planner.pdf was originally created in Word, since most people have access to Word.. but evolved to a PDF form created from the Word Doc via Adobe LiveCycle Designer 8.0 w/ User Rights enabled so that the form could be filled out and saved using Adobe Reader.. which was a step better than Word.. being that it is free. But this needed to be easier and more to the point b/c some clients don't particularly like installing the latest version of Reader, even if you provide them the link. Nor do they like saving the form, filling the form, and attaching the form to send back.
    My goal is to have the client fill an HTML version of the form, submit and be done with it, but everyone in the workflow be able to easily receive the filled Planner as a PDF form.
    So some months ago I ran into this post Chris Trip, "Populate Livecycle PDF from mySQL database using PHP" #8, 22 Sep 2007 4:37 pm
    which uses the command line Win32 pdftk.exe to merge an FDF file into an existing PDF on the remote server, and serve this to whoever.
    My problem was with shared hosting and having the ability to use the Win32 pdftk.exe along with PHP which is predominantly used on Linux boxes. And we used a Linux box.
    so i created the following unorthodox method, which a client fills the HTML version of the Planner, all field values are INSERTED into a table in MySQL DB, I and all filled planners that have been filled by clients to date can be viewed from a repository page where an XML file is served up of the corresponding client, but someone would have to have Acrobat Professional, to import the form data from the XML file into a blank form.. altoughh this is simple for me.. I have the PHP file already created so that when a Planner is filled and client submits. >> the an email is sent to me with a table row from the repository of the client name, #, email, and a link to d-load the XML file,
    But I also have the PHP files created so that the Planner can be sent to by email to various people in the workflow with certain fileds ommitted they they do not need to see, but instead of the XML file beiong served up i need the filled PDF Planner to be served.
    I can do this locally with ease on a testing server, but I am currently trying to use another host that uses cross-platform compatibility so i can use PHP and the pdftk.exe to achieve this, as that is why I am having to serve up an XML file b/c we use a Linux server for our website, and cant execute the exe.
    Now that I am testing the other server (cross-platform host), just to use them to do the PDF handling (and it's only $5 per month) I am having problems with getting READ, WRITE, EXECUTE permissions..
    Si guess a good question to ask is can PHP do the same procedure as the pdftk.exe, and i can eleminate it.
    or how in the heck can i get this data from the DB into a blank PDF form, like i have described??
    here are some link to reference
    Populating a LiveCycle PDF with PHP and MySQL
    http://www.andrewheiss.com/Tutorials?page=LiveCycle_PDFs_and_MySQL
    HTML form that passed data into a PDF
    http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.htm l
    and an example
    http://accesspdf.com/html_pdf_form/

  • Need to reference file name within the XML Output

    Not sure if this is possible, as I'm new to the livecycle/XML world. But I need to be able to reference a file within the XML output from the PDF.
    The Scenario is that a pdf form of a business card will be issued to 50 franchisees for them to type in their names and mobiles, click submit and the XML file to be sent to myself, and be imported in to InDesign populating their data ready for printing. Up to here I have it working perfectly.
    However as each franchisee have a combination of up to 5 logos to place in the bottom corner to save having to have various templates with different combinations of logos and having to ensure the correct templates are used. I intend to reference each companies combination as an EPS and make the reference within the xml out and have it import directly in with the other data. I can type the code directly within the xml but I would like to have the form reference it directly in the xml output. Is this possible or am expecting to much of livecycle? Any help/advice greatly appreciated.
    David

    Hi MadhavaGanji,
    I have post how to validate the file name, header row against definition table which stored the file name and column definition. 
    Take a look and see if this is helpful.
    http://sqlage.blogspot.com/2013/11/ssis-validate-file-header-against.html
    http://sqlage.blogspot.com/

  • Help Please ! -- transform XML to HTML using xslt tag in JSP

    Hello,
    I have problem to do XSL transform in JSP.
    I have an XSL : test.xsl
    I have an XML : test.xml
    In JSP I have:
    <x:xslt media="html" xml="test.xml">
    <x:stylesheet media="html" uri="test.xsl" />
    </x:xslt>
    But It doesn't work the way it suppose to. What is wrong in my code ? I followed the URL http://e-docs.bea.com/wls/docs81/xml/xml_apps.html
    Thanks in advance,
    Christina

    Basically:
        try{
          //Setting up parameters.
          xml=new StreamSource(new File(xmlInput));
          xsl=new StreamSource(new File(xslInput));
          baos=new ByteArrayOutputStream();
          htmlResult=new StreamResult(baos);
          //Transform input(xml, xsl) onto html output.
          TransformerFactory tfactory=TransformerFactory.newInstance();
          Transformer transformer=tfactory.newTransformer(xsl);
          transformer.transform(xml, htmlResult);
          baos.writeTo(out);
          //System.err.println(htmlResult.getOutputStream().toString());
        catch(...){
        }I havent tested and I havent use this for a while, but I hope this can serve as a staring point.
    Regards,
    OO

  • How to output HTML from com.sun.HTTPExchange

    My trival web server outputs output plain text. How do I output HTML?
    Thanks,
    Siegfried
    package xml.webservicesDemo;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.InetSocketAddress;
    import com.sun.net.httpserver.HttpContext;
    import com.sun.net.httpserver.HttpExchange;
    import com.sun.net.httpserver.HttpHandler;
    import com.sun.net.httpserver.HttpServer;
    public class WebApp implements HttpHandler {
         public static void main(String[] args) {
              try {
                   HttpServer server = HttpServer.create(new InetSocketAddress(8123),0);
                   HttpContext ctx = server.createContext("/apps/myapp/myNewApp",new WebApp());
                   server.setExecutor(null);
                   server.start();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         public void handle(HttpExchange t) throws IOException {
              InputStream is = t.getRequestBody();
              byte[] bBody = new byte[1000];
              int count = is.read(bBody);
              String sBody = bBody.toString();
              String response = "hello siegfried";
              t.sendResponseHeaders(200, response.length());
              OutputStream os = t.getResponseBody();
              os.write(response.getBytes());
              os.close();          
    }

    For that kind of work, I wouldn't recommend this class ( sorry, my other reply is to your first question ).
    This is a SIMPLE http server. You would have to emulate an application server ( like Tomcat ) yourself if you want full-blown servlet / jsp functionality. You could define a simple jsp-ish domain specific language and parse it yourself, though.
    That might be an interesting exercise, but not one that would appeal to me.

  • Unable to use the Copy function while submitting the program for XML output

    Hi
    when i submit the concurrent program with XML output type, getting the output..
    when i submit he concurrent program using the copy button not able to get the output,
    my observation
    while submitting the program the xml template is not called....
    Diagnostics--> view xml -- able to view the ouput.
    do let me know if any of the steps is missing while registration in the xml responsibility..
    this is only with the custom conc program.. the standard program is working fine...
    do help me out..
    Regards
    Yram

    It's really a little difficult to answer your question without a bit more information. What version of JDeveloper are you using? What's your technology stack?
    If this is JDeveloper 11+g+, with the Fusion technology stack, you can use a technique like the one described here:
    http://groundside.com/blog/GrantRonald.php?title=jdeveloper_11_business_services_cascadin&more=1&c=1&tb=1&pb=1
    If it's JDeveloper 10.1.3, with the default Web technology stack, look here:
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#62
    If, as it looks like, this is really a question about generic JSPs (no JSF), you might actually have a bit more success on a generic JSP forum--using scriptlets hasn't really been best practices within JDev since...well, since JSTL became available, really. That was a number of years ago.
    Like I said, there's really no direct way to use Javascript output in a scriptlet--unless you mean something like storing Javascript output in a hidden field, and using the value in a scriptlet on the next request. But by the time Javascript runs, any scriptlet from the current request will already have executed.

  • BUG ? in xmlparserv2 to output html

    I have a problem to use XSLProcessor to output html for a space when it is in a href
    a space is escaped in a '+' (plus)
    but a '+' isn't escaped .
    I think that it's due to XMLUtil.encodeURL() which doesn't do the work properly
    Normally '+' must be escaped to %2B

    What exact version of the XML Parser are you using when you see this behavior? 2.0.2.9, 2.0.2.10, 2.1.0.0 Beta ?

  • XML Output

    Could you explain in simple words what is XML output used
    for? We don't use it now, but we have to decide whether we need it
    or not.

    Welcome to the forum.
    Well it's not quite in the same league as asking for a simple
    guide to splitting the atom but it's that sort of question.
    Think of XML as HTML where the tags are structured and give a
    sort of database effect. That enables the content to be reused.
    It's also one of those things where if you needed it, you
    would sort of know. Your developers would be steering you that way.
    Probably someone can give you a better answer but meantime
    you would do very well to look at
    http://www.xml.com and do some
    googling.

  • XML Output - II

    Hi All,
    I have an XML output with 4 columns and 1 row. I would like my output to look like individual fields placed one below the other (as opposed to a tabular XML format). Can somebody tell me the different options I got? Appreciate it.
    Regards,
    V M.
    Edited by: V M on Jul 21, 2008 9:50 PM

    Hi,
    You can also create your report as an HTML page.
    In HTML format however you want to display your report you can do.
    You can use BLS to write to the file and/or append to a string that builds up your HTML content. You create a "sub transactions" that take an xMII recordset and convert it to an HTML table in your main transaction.
    Thanks,
    Manisha

Maybe you are looking for

  • Com.oreilly.servlet.MultipartRequest from where to download the package

    Hi all From where to download this package. com.oreilly.servlet.MultipartRequest and where to copy it so that I can use this package. Vijay

  • ISE and LDAP Integration

    Hello, I have a question about the LDAP integration with the ISE: Since the ISE has a limitation of reading only 100 groups, I cannot find the groups that I need to use on the authorization, and also the ISE cannot find group if I search for it direc

  • Printer cannot print many fonts or pdf's

    Hi When using my Lexmark laser E322 many fonts that are installed in Fontbook will not print correctly when using Adobe InDesign and PDFs just disappear from the Print monitor after a few seconds. Is there a possible corrupted preference file? Or doe

  • USB Keyboard - Insert key not working

    I've an HP KU-9963 usb keyboard plugged into a Dell laptop running Windows XP (all the latest updates), where all keys appear to function ok except for the Insert keys. Pressing either Insert key doesn't cause the LED to light and I get no insert act

  • IPAD MINI cannot connect to my home wifi being run on a win 8 desktop. It used to connect earlier.

    My new IPad Mini was functioning on my home WiFi till a fortnight ago, when I had to go out of station. On return, I find that the IPad is not connecting. My WiFi is through Win8 desktop. I have given Firewall exceptions to ITunes. The Pad keeps on s