JEditorPane - How to display XML Linked HTML File in JEditorPane ?

Dear Friends,
I have a HTML File consisting of stylesheet, xml linked (for data) and with headers, footers...
When i called a ordinary html file using setpage property of JEditorpane..it's working no problem...but when i call the html file having xml linked or buttons...it's not properly displayed....
If anybody hits this problem....pls...help me....
Regards,
V.Prasanna

If you only need to display it, consider your HttpServletRequest just as byte stream. :) Just read from ServletInputStream and write it back into ServletOutputStream of HttpServletResponse.
If you want to process incoming XML, please give some details first, what exactly you want to do. :)

Similar Messages

  • How to display xml to html using xsl?

    hi all...may i know how to display xml to html page?
    i ve included <xsl:output method="html" indent="yes" /> inside my xsl file. i clicked on output.xml file and everything is displayed correctly but the format is xml instead of html. is there anyway to transform it to html?
    below are my xsl and xml codes:
    // xsl file
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="yes" />
    <xsl:template match="/">
    <html>
    <body>
    <h2>Document Contents</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
         <th align="center">Document Name</th>     
         <th align="center">Document ID</th>          
         <th align="center">Owner</th>               
    </tr>
    <xsl:for-each select="Document/Contents">
    <tr>
    <td><xsl:value-of select="DocumentName"/></td>
    <td><xsl:value-of select="DocumentID"/></td>
    <td><xsl:value-of select="Originator"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    // xml file
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="xsltStyleSheet.xsl"?>
    <Document>
         <Contents>
              <DocumentName>register</DocumentName>
              <DocumentID>1</DocumentID>
              <Originator>hhh</Originator>
         </Contents>
    </Document>
    </xsl:template></xsl:stylesheet>

    your XSL transforms to HTML (in fact XHTML): what more do you expect? did you expected anything different from the following output? if yes: what and why?
    <html>
         <body>
              <h2>Document Contents</h2>
              <table border="1">
                   <tr bgcolor="#9acd32">
                        <th align="center">Document Name</th>
                        <th align="center">Document ID</th>
                        <th align="center">Owner</th>
                   </tr>
                   <tr>
                        <td>register</td>
                        <td>1</td>
                        <td>hhh</td>
                   </tr>
              </table>
         </body>
    </html>

  • How do i send an html file exported from muse as email blast with images and live links?

    My question it:
    How do i send an html file exported from muse as email blast with images and live links?
    I have designed a "website" in adobe muse and exported it as an html file. I am not sure how to send my .html file in an email!
    Best,
    Nicole

    Unfortunately, the answer is, you don't. The requirements for HTML displayed in an e-mail reader are very different than those for HTML displayed in a browser. The output of Muse won't work as an HTML e-mail. You could upload the Muse site as a website and provide a link to it in an e-mail, but the HTML generated by Muse is not suitable for direct display by an e-mail program.

  • Displaying a local HTML File

    I wish to include a help file in my Java application. The easiest format for me to use is a local HTML page, resident in the same directory as my installed application - but I am having trouble displaying it using the jEditorPane. I realise this may look lazy, but could someone please put me out of my misery and tell me how to display a local HTML page ?

    if you want to use a button to show the file in a new window - try this one
    void button1_mouseClicked(MouseEvent e)
    AppletContext ac=getAppletContext();
    try {
    ac.showDocument(new URL("http://....."));
    catch(MalformedURLException x){showStatus(x.toString());}
    }

  • How to read a text/html file in java regardless of its encoding?

    Hi All,
    How to read a text/html file in java regardless of its encoding?
    1. Is there any way to identify that a file (read using FileInputStream/or any other means with java.io package) has been saved with which type of encoding i.e. whether the file is using ANSI encoding or Unicode encoding or other?
    2. Is there any standard way to read an encoded file (i.e. files having UTF-16 format for Asian locales character support) and un-encoded file (i.e. files having ordinary ANSI format) correctly without knowing the user input?
    The problem is that while creating an instance of 'InputStreamReader' (ISR) we can pass the encoding type used (otherwise it takes the system's default encoding type), and the ISR expects the file to be in the same encoding format otherwise it reads it as some junk. But we don't know which file the user is going to pass whether it is Unicode (for Asian locales file should be in Unicode) with or ANSI coded (for non-Asian / English locales user generally uses ANSI encoding).
    Regards,
    Sam

    1. There is no reliable way of guessing the encoding of a file without that information. Thats why XML for example has very strict rules wrt. it's encoding (short form: use UTF-8 or UTF-16, if you use anything else, you'll have to specify it)
    2. you might be able to make an educated guess if the possible range of encodings is limited, but it will probably never be 100% certain
    3. The HTML file might have a header entry "<meta http-equiv..." that tells you about it's encoding. You could try to read the start of the file and see if you find that, then if you found it re-read the entire file.
    regards

  • How may load an external (html) file in swf? Anyone!!!!!

    hi all,
        How may load an external html file in swf? such as google.com in a movieclip.
    anyone may help me.........????????

    With Flash, you can't do this.
    Just with FlashBuilder and Air (something like HTMLLoader  , not sure now)
    I mean loading in a movieclip..
    Of course you can open a page to display in a browser.

  • How to Display XML in a UIWebView?

    Hi everybody. I like how Safari displays XML files and I would like to emulate that functionality in an iPhone UIWebView. However, I just can't get it to look the same when passing a URL to the UIWebView.
    For example, take a simple XML file like http://molottery.com/rss-num.xml. Viewing that in Safari looks okay, but passing that same URL into a UIWebView just shows a blank page.
    I changed the web protocol from http to feed (feed://molottery.com/rss-num.xml) and it launches the page in Safari instead of my UIWebView. Looks good, but it quit my app... :- (
    I noticed that XML files on the iPhone get re-routed through reader.mac.com so I tried appending that to my URL (http://reader.mac.com/mobile/v1/http://molottery.com/rss-num.xml) but that did not work either.
    When I tried URLEncoding the string like Safari does (http://reader.mac.com/mobile/v1/http%3A%2F%2Fmolottery.com%2Frss-num.xml) I get a UIWebView saying that "This Application Is Viewable Only On iPhone".
    So how can I emulate the regular Safari XML functionality inside my UIWebView? I will post my code upon request, if that will help. Any assistance from the Developer Community would be greatly appreciated.
    Thanks!

    You may have better luck in the iPhone dev forums...
    https://devforums.apple.com/community/iphone/web

  • How to display archive link picture in pdf

    Hi, Experts
      I create a pdf form using tcode SFP, and create a graphics element in the form,
    but i don't want to use the MIME object to disaplay,because our pictures are archive link.
    How to display archive link picture in pdf form?
    Thanks you very much!
    Ken.li
    Edited by: Ken.Li on Nov 17, 2009 3:50 AM
    Edited by: Ken.Li on Nov 17, 2009 4:30 AM

    Hello,
    I can recommend you go through the tutorial called How Tou2026 Integrate ADOBE form on WebdynPro for ABAP and Deploy it on portal by Bhawanidutt Dabral. Ignore the fact it uses WD, I have tried the proposed solution how to load in the picture on a simple offline/ print form. Look around for this tutorial.
    It propose to use the FM as follows:
    CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
        EXPORTING
          p_object       = c_graphics
          p_name         = lv_pernr1
          p_id           = c_bmap
          p_btype        = c_bcol
        RECEIVING
          p_bmp          = ls_z_if_test_cv-im_photo
        EXCEPTIONS
          not_found      = 1
          internal_error = 2
          OTHERS         = 3.
    It passes the picture as XSTRING into the form and there you bind this data stream to a Image Field (not an Image!!! check this twice). Don´t forget to check the checbox to include picture data into the form file.
    Hope this helps, Otto

  • How do I Open an HTML file for iOS?

    How do I open an HTML file for iOS using acrobat?

    This is a forum for Adobe Reader for iOS. Acrobat doesn't run on iOS. You need to run it on a Mac or Windows computer. In Acrobat, you can choose File > Create > PDF from Web Page to do what you want. You cannot do that in iOS.

  • How to load external storage html file in web view

    hi all,
        how to load external storage html file in web view, please help me
       " ms-appdata://local/index.html" not working
    veerasuthan veerakesan

    It need be read as string. Then load the string by  Webview.NavigateToString.
    Sample as below
    string htmlstring = string.Empty;
    try
    var htmlfile = await Windows.Storage.ApplicationData.Current.LocalFolder.OpenStreamForReadAsync("a.html");
    using (System.IO.StreamReader streamReader = new System.IO.StreamReader(htmlfile))
    htmlstring = streamReader.ReadToEnd();
    webview.NavigateToString(htmlstring);
    catch(Exception ex)
    Debug.WriteLine(ex.ToString());
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

  • How to recover missing index.html files

    How to recover required index.html files in Pages?

    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=308&mforum=iworktips ntrick
    Peter

  • Adf11g how to open pdf or html files from  webservice

    hi all,
    adf11g how to open pdf or html files from webservice .

    Hi,
    This is standard functionality, that you can read more about in the OLM User Manual. You can upload the files to an OLM content server or to any other content server that can be accessed with a URL.
    Regards Anders Northeved

  • How can display the link Personalize

    In the portal I am displaying the links:
    I have the role of admon.
    Help, Logoff in Head Area(MastHead) How can display the link Personalize?
    Regards

    Assign yourself eu_role.
    Thanks
    Prashant

  • How to display Xml in a JEditorPane(in an applet)

    Hi All,
    I have an applet and i want to display xml in a JEditorPane in an applet. This xml document has a xsl attached to it for transformation. How can i do the transformation??
    Help or sample code or link to a sample code is highly appreciated!!!!
    Thanks
    Ragu

    Look this servlet which does a transformation. JEditorPane could call this servlet (with the method setPage) to do the transformation:
    public class SampleXSLTServlet extends javax.servlet.http.HttpServlet {
    public final static String FS = System.getProperty("file.separator");
    // Respond to HTTP GET requests from browsers.
    public void doGet (javax.servlet.http.HttpServletRequest request,
    javax.servlet.http.HttpServletResponse response)
    throws javax.servlet.ServletException, java.io.IOException
    // Set content type for HTML.
    response.setContentType("text/html; charset=UTF-8");
    // Output goes to the response PrintWriter.
    java.io.PrintWriter out = response.getWriter());
    try
    javax.xml.transform.TransformerFactory tFactory =
    javax.xml.transform.TransformerFactory.newInstance();
    //get the real path for xml and xsl files.
    String ctx = getServletContext().getRealPath("") + FS;
    // Get the XML input document and the stylesheet, both in the servlet
    // engine document directory.
    javax.xml.transform.Source xmlSource =
    new javax.xml.transform.stream.StreamSource
    (new java.net.URL("file", "", ctx+"foo.xml").openStream());
    javax.xml.transform.Source xslSource =
    new javax.xml.transform.stream.StreamSource
    (new java.net.URL("file", "", ctx+"foo.xsl").openStream());
    // Generate the transformer.
    javax.xml.transform.Transformer transformer =
    tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource,
    new javax.xml.transform.stream.StreamResult(out));
    // If an Exception occurs, return the error to the client.
    catch (Exception e)
    out.write(e.getMessage());
    e.printStackTrace(out);
    // Close the PrintWriter.
    out.close();

Maybe you are looking for

  • How to incorporate URL in iOS Mail?

    In Mail under MacOS X I am using often the possibility to 'hide' a URL with Command-K. I like to do this in iOS' Mail too, but I didn't find how it can be done. Somebody knows a workaround? Thanx in advance!

  • Removing shadows from charts (both column AND pie)

    I can see there is a ShadowBoxItemRenderer (that I have no idea from the help docs HOW to actaully implement to turn off shadows) hoever - when/if this works - it only works on my column chart? How can I turn off this nasty drop shadow beneath my pie

  • What do I use instead of igoogle when it goes off 11-1-13

    I use Firefox as my primary ( love it) and igoogle. When it goes out in November what can I use o maintain all my bookmarks ?

  • 2960x vs 3850

    Hi, I am deciding which switch to by to replace some of our old switches. Looking for some direct comparison between 2960x and the new 3850 (In exception of the Wireless controller and stack power). looking for one to one comparison on PoE, performan

  • Issue with VAT ID in Vendor Master

    Hi All, While creating Vendor Master ,system is not accepting VAT ID: Error message is "VAT registration number contains invalid characters" Input VAT ID :GB0109413534 Vendor Country : GB (United Kingdom) I checked country settings also: VAT registra