HTMLDocument.getText() issue: HTML tag br is translated to ' ' (space)??

HTMLDocument.getText() issue:
<br> (HTML.Tag.BR) is translated to ' ' (space), but I've expected the '\n'!
I have the HTMLDocument that contains
<html><body>
<br>
<br>
<br>
SOMETEXT
<br>
</body></html>
The JTextPane is perfectly showing this formatting, but after I translate the HTML to plain text using
getText(o, getDocument().getLength())
I receiving the " SOMETEXT "? all line brakes are lost! I have only spaces instead line brakes! (using <p></p> instead of <br> in general is not solution)
Help me please! It's not normal to make the manual "html to plain text" translation..
Strange that I can't find any existing solutions here...
JDK1.4.1 and 1.4.2_03

Here is the sample of how I get the plain text from HTMLDocument:
HTMLDocument htmlDocument = (HTMLDocument)getDocument();
String plainText = htmlDocument.getText(0, this.getDocument().getLength());
"... SOMETEXT..."
plainText string contains plain text
the same document - alternative way to get the HTML file from this document:)
               HTMLDocument htmlDocument = (HTMLDocument)getDocument();
               Writer w = new FileWriter(new File("/home/ovrubl/temp/AAAAAAAAAAAAAAAAAAAA"));
               htmlEditorKit.write(w, htmlDocument, 0, htmlDocument.getLength());
               w.flush();
               w.close();
<br>
<br>
<br>
SOMETEXT
I'm looking for solution how to get
"...\n\n\nSOMETEXT..." from htmlDocument.getText(0, this.getDocument().getLength())

Similar Messages

  • Textarea escapes html tags

    I am using a textarea to display text information. The text information contains HTML tags such as < B> and < font> etc. The textarea however displays the tags as text and does not translate them into HTML formatting!! how can we use a text area to display the HTML formatting?? (ie want the functionality of the textarea with editor but with out the editor toolbars)
    is this possible??
    Message was edited by:
    [email protected]

    scott,
    Is there anyway of formatting a Display as Text item type so that you can fix the width and height and have a scrollbar. (Ie is there anyway of making the displayas Text item type look like a textarea??)
    we want to have the item displaying the text a fixed size as it is based on a clob and we want the user to be able to scroll up and down to view all of the text. We are using ctx_doc.markup to highlight search criteria so require the ability to show HTML to display the highlighted text; hence the original problem of HTML tags not being translated into commands but displayed as normal text

  • Replacing html tags in a htmldocument

    Hi Java Gurus
    I have a htmldocument which has the bacjground set to black and foreground to white.
    When i print the document i see the text in white color ( rather invisible).
    I thought the foreground color of the document needs to be changed.
    How can i do this ?
    Thanks in advance
    Naveen

    rest_in_peace wrote:
    You'll get a faster, more effective response to your questions by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB version and edition
    <li>Web server architecture (EPG, OHS or APEX listener)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s)
    Read the FAQ and forum sticky threads for more information on using the forum effectively.
    With APEX we're fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues.
    I have created a form on a table. Now one of the fields in the form is a display only field and its datatype is varchar2.There are a number of different ways of "creating a form on a table" and of making "display only fields". Describe exactly what you mean using actual APEX terminology of regions, items, and their attributes.
    The data in the database column of the field contains html tags which is getting displayed as it is without being parsed. It is not possible for me to edit the data in the table itself since there are thousands of data. So I need a way to display the data with the html tags parsed and not displayed as it is. Please any help would be grealy appreciated. How this is achieved is version-dependent: provide the full APEX version.

  • Inserting custom HTML tags into a HTMLDocument to be displayed in a JEditor

    Does anyone know how to insert custom tags into a HTMLDocument to be displayed in a JEditorPane?
    I have tried using the following code,
    kit.insertHTML( doc,
                    jep.getCaretPosition(),
                    "<testtag>FFFF</testtag>",
                    0,
                    0,
                    new HTML.UnknownTag("testtag") );When the above code is run the handleStartTag, handleEndTag and handleText methods are called on the HTMLReader but nothing is inserted into the document model? Can anyone help?
    I have created an instance of HTML.UnknownTag,
      public static HTML.Tag testTag = new HTML.UnknownTag("testtag");I have subclassed HTMLEditorKit and overridden the getParser() method,
      protected Parser getParser(){
        DTD dtd = null;
        try {
          dtd = createDTD( DTD.getDTD("html32"), "html32" );
        } catch ( Exception e ) {
          e.printStackTrace();
        dtd.getElement( "testtag" );
        Parser p = new ParserAdaptor( new DocumentParser( dtd ) );
        return p;
      }I have subclassed HTMLDocument and HTMLDocument.HTMLReader and created a TagAction for my new tag.
    The following code works fine, the custom tag is in the document model,
        String contents =    "<html>"
                           + "<body>"
                           + "<testtag>Here is some text</testtag>"
                           + "</body>"
                           + "</html>";
        ((HTMLDocument)jep.getDocument()).setPreservesUnknownTags(true);
        jep.setText( contents );

    I've been trying to get <blockquote> insert working in an editor but it seems to be a quite difficult task even if it's only about inserting a couple of tags into the right slot! This is the closest I got:
    HTMLDocument doc = (HTMLDocument)editor.getDocument();
    int start = editor.getCaretPosition()
    int paraStart = doc.getParagraphElement(start).getStartOffset();
    int paraEnd = doc.getParagraphElement(start).getEndOffset();
    String insideBlockQuotes = doc.getText(paraStart, paraEnd - paraStart);
    doc.setOuterHTML(doc.getParagraphElement(start),"<blockquote><p>"+insideBlockQuotes+"</p></blockquote>");
    This is how it works: Get the current paragraphs start and end positions, read the text between the start and end into a string, replace the paragrapElement with <blockquote><p>..the text from string..</p></blockquote>.
    This works 'in about' but it's far from perfect.. it has the following problems:
    1. It looses all formatting from the quoted paragraph (bold etc. tags from the quoted part)
    2. It assumes that the paragraphElement was a <p> (could have been another element too!)
    3. It's ugly
    Anybody come up with a better way to use blockquote?

  • Issue with HTML tags visible in Outlook emails

    Hi everyone, I'm having an issue with a website I'm working on.
    On our site, we have a page that generates emails after certain events occur. These are sent to a forwarding address on our mail server, which is then sent to several users on our mail server. These users have their accounts set up in Outlook (one in 2007,
    one in Mac 2011).
    We're are having an issue where these emails are displaying in Outlook with all of the HTML tags in the email visible. One of the users spoke to Microsoft support, and they remoted in and went through their Outlook settings and were not able to find any issues
    there.
    This issue is not global exactly. When one of the users added their email to their iPhone, the email displayed correctly. We added a Gmail account and my work account (which I also access through Outlook) to the forwarding list, and it displayed correctly in
    both. When we view these emails in the server's webmail client, the emails display fine. The issue seems to be with some discrepancy between Outlook and our email server.
    I spoke to our webhost about the issue, and they swore up and down the issue had nothing to do with them, and that it had to be an Outlook issue. I've had several professional web developers analyze the code that creates these emails, and they found nothing
    wrong with it. Something that several of my colleagues and our webhost suggested is that the issue could be with the email headers. This is the header for the email, as viewed through Outlook:
    Return-Path: <[email protected]>
    X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on clubcrown.com
    X-Spam-Level: *
    X-Spam-Status: No, score=1.5 required=7.0 tests=HTML_MESSAGE,MIME_HTML_ONLY,
    NO_DNS_FOR_FROM,NO_RELAYS autolearn=no version=3.3.1
    X-Original-To: [email protected]
    Delivered-To: [email protected]
    Received: by x.com (Postfix, from userid 30)
    id 50F7123D9E; Tue, 11 Feb 2014 14:20:00 -0500 (EST)
    X-Original-To: [email protected]
    Delivered-To: [email protected]
    Received: by x.com (Postfix, from userid 10000)
    id EC28323DA2; Tue, 11 Feb 2014 14:19:58 -0500 (EST)
    To: [email protected]
    Subject: A wholesale order has been placed
    X-PHP-Originating-Script: 10000:thanks.php
    MIME-Version: 1.0
    Any help would be greatly appreciated. Let me know if more information is needed. Thank you.

    Glad to hear that you have found the solution. And thank you for sharing the solution here, it will be helpful to other community members who have same questions.
    Cheers,
    Steve Fan
    TechNet Community Support

  • How to change inner content of HTML tag using HTMLDocument?

    I want to change the inner content of an HTML tag from a HTMLDocument. The tag is like
    <span id ="id1">Replace me</span>.
    So I want to change the text "Replace me" inside the span tag and replace it with an other text.
    I can get the span element using
    HTMLDocument.getElement("id1")
    I have tried many things with the Element instance i got from getElement. But I find no way to change the inner content of the HTML element. Any ideas?

    If I use JDK 1.5 the SPAN tag works, so I checked the core of the problem which is inserting HTML code in an HTML tag.
    setInnerHTML works fine for block tags like DIV but not if the tag is a leaf element like the SPAN tag. I have tried to use the following code for leaf elements:
    Element elem = m_htmlDocument.getElement(id);
    int nStartOffest = elem.getStartOffset();
    int nEndOffset = elem.getEndOffset();
    int nLength = nEndOffset - nStartOffest;
    m_htmlDocument.replace(nStartOffest, nLength, html, elem.getAttributes());
    This works, but only if the new HTML string does not contain HTML tags like a link <href..... >. If the string contains HTML tags the replace method masks all characters like < or >. So the link is not shown as link in the HTML page but as HTML text.
    The next thing I have tried is using
    m_htmlDocument.setOuterHTML(elem, html);
    This works too but it replaces the whole original HTML element like the SPAN tag.
    So there is still the question how to insert HTML text into a leaf Element in a HTMLDocument.

  • HTML Tag issue

    Hi all,
    Html tag line is displaying as button and text box in Report region. When i enter the following text (*<input type="button" value="Submit" />*), it is displaying as textbox and button in report region. Here i am setting the column link and when i click the column it takes me to another page. If i remove the column link, then the text is displaying as i entered. Here i need to set the column as well as the text needs to be displayed as i enter.
    Thanks for help!

    apexlearner wrote:
    Html tag line is displaying as button and text box in Report region. When i enter the following text (*<input type="button" value="Submit" />*), it is displaying as textbox and button in report region. Here i am setting the column link and when i click the column it takes me to another page. If i remove the column link, then the text is displaying as i entered. Here i need to set the column as well as the text needs to be displayed as i enter.It is not at all clear what you are attempting to describe here. To avoid confusion, try reproducing the problem on apex.oracle.com.

  • Wls 8.1 sp2: weblogic.jspc complains about struts-html tags

              Hi,
              I am trying to compile jsps with weblogic.jspc, which use struts' html tags. However,
              the compilation fails with the following message:
              [java] Translation of /views/viewPageBody.jsp failed: (line 3): Error in using
              tag library uri='/tags/struts-html' prefix='html': The Tag class 'org.apache.struts.taglib.html.BaseTag'
              has no setter method corresponding to TLD declared attribute 'server', (JSP 1.1
              spec, 5.4.1)
              I opened the BaseTag class from the struts jar and found the setter exists for
              the attribute 'server' of html tld. So does the property 'server'. The property
              'server' is a string and the parameter in the setter is a string. I read about
              the jspc errors in wls 8.1 about the setter parameter being of different type
              than the property. However, that is not the case here. I tried using both Sun's
              and BEA's jdk. None of them help. Btw, there is another attribute mentioned in
              the html tld, which is 'target'. The compiler doesn't complain yet about this.:(
              Also, I happened to compile other apps which have struts logic tags.
              My environment:
              OS: Win2k sp3
              WLS: 8.1 sp2
              JDK: Sun's 1.4.2 sp4 / Bea's 1.4.1 sp5 (tried both)
              Ant: 1.5.3 (I had an issue earlier with ant until I found that Bea officially
              without any mention supports only ant 1.5.3.)
              I would appreciate any help in this regard.
              Thanks,
              Abbas
              

              What version of Struts are you trying to use?
              Are you certain you're not encountering a different instance of that class in
              an unexpected location in your classpath?
              "Abbas" <[email protected]> wrote:
              >
              >Hi,
              >I am trying to compile jsps with weblogic.jspc, which use struts' html
              >tags. However,
              >the compilation fails with the following message:
              >
              >[java] Translation of /views/viewPageBody.jsp failed: (line 3): Error
              >in using
              >tag library uri='/tags/struts-html' prefix='html': The Tag class 'org.apache.struts.taglib.html.BaseTag'
              >has no setter method corresponding to TLD declared attribute 'server',
              >(JSP 1.1
              >spec, 5.4.1)
              >
              >I opened the BaseTag class from the struts jar and found the setter exists
              >for
              >the attribute 'server' of html tld. So does the property 'server'. The
              >property
              >'server' is a string and the parameter in the setter is a string. I read
              >about
              >the jspc errors in wls 8.1 about the setter parameter being of different
              >type
              >than the property. However, that is not the case here. I tried using
              >both Sun's
              >and BEA's jdk. None of them help. Btw, there is another attribute mentioned
              >in
              >the html tld, which is 'target'. The compiler doesn't complain yet about
              >this.:(
              >Also, I happened to compile other apps which have struts logic tags.
              >
              >
              >My environment:
              >OS: Win2k sp3
              >WLS: 8.1 sp2
              >JDK: Sun's 1.4.2 sp4 / Bea's 1.4.1 sp5 (tried both)
              >Ant: 1.5.3 (I had an issue earlier with ant until I found that Bea officially
              >without any mention supports only ant 1.5.3.)
              >
              >I would appreciate any help in this regard.
              >
              >Thanks,
              >
              >Abbas
              

  • Replacing HTML tags using HTMLEditorKit etc.

    Hi
    Not sure if this is the best place to ask this. I've searched without finding much.
    Basically I am trying to create a HTML template system for output. User's can change the templates to change the program output.
    The templates are basic HTML with custom tags inserted, that reside in a templates directory. For example, a simple template might be:
    <html><body>
    <table width="100%"><tr><td width="25%">Here is the output:</td>
    <td> <insertOutputHere> </td>
    </tr></table>
    </body></html>
    ^^ Users would be able to edit these template .htm files to affect the output .htm files. For instance, changing where the <insertOutputHere> tag is, or formatting the table it is output to.
    I am using the Swing HTMLDocument, HTMLWriter, HTMLEditorKit classes to load and parse the .htm files, iterate the tags and replace any custom tags (defined in code) with the program output. I have been able to locate these custom tags no problem, but I don't know how to replace this tag entirely with my output (Which will be formatted HTML string). I have been trying to use the insertBefore, insertAfter methods with limited success. In particular I have an 'include' custom tag which includes other files by recursion - it works except the <include> tag is not removed, and depending on which insert method I use, it usually goes into an infinite loop of parsing the <include> tag WITHOUT removing it, then picking it up again when its done.
    Basically I'm looking for any advice as to how to go about COMPLETELY REPLACING these tags with a well structured HTML string. I can post some code if need be but I barely comprehend what I've done, LOL.
    TIA

    I've looked over my mess of comments :)
    setOuterHTML is what I was previously using and it was quite unpredictable at times, as far as I could tell it is very strict with it's requirements for structured HTML (EG no floating line breaks, everything must be "paragraph-ised" which b0rks up the layout) and I can't rely on anyone using/extending these classes to write well structured HTML.
    I remember the problems being quite odd, such as the output for one custom tag being displayed twice for some and not at all for others, and while it isn't critical data, it was still displayed in a way that it could be interpreted as correct - I just knew it wasn't.
    So I dropped setOuterHTML to try insertAfterEnd - this leaves the tags in there and, like roughly explained above, it would pick up tags infinitely because they were not being replaced.
    Here is a relevant method to give a better idea of what I've done:
           public HTMLDocument parseHTMLfile(String filename, Custom_HTML_Tag tags[]) {
          //create a document
             HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
             fileDepth++;
             try {
             //read in the file
                BufferedReader rd = new BufferedReader(new FileReader(filename));
                kit.read(rd, doc, 0);
                if (tags != null) {
                //replace tags with page content
                   ElementIterator it = new ElementIterator(doc);
                   Element e;
                   while ((e = it.next()) != null) {
                   //look for includes
                      if (e.getName().equals("include")) {
                         if (fileDepth >= 5){
                         //WARNING:
                            System.out.println("fileDepth has reached 5, include may be recursive. aborting.");
                            continue;
                         String href = (String)e.getAttributes().getAttribute(HTML.Attribute.HREF);
                      //grab parent of current file (IE the folder in which it sits)
                         File f = new File(filename);
                         String include = f.getParent() + sep + href;
                         f = new File(include);
                         if (f.exists()) {
                            HTMLDocument htmld = parseHTMLfile(include, tags);
                            StringWriter sw = new StringWriter();
                            HTMLWriter w = new HTMLWriter(sw, htmld);
                            w.write();
                            doc.setOuterHTML(e, sw.toString());
                         else {
                         //couldnt find include file - warning
                      for (int i=0; i < tags.length; i++) {
                         if (e.getName().equals(tags.getName())) {
    //doc.setOuterHTML(e, tags[i].getText());
    doc.insertAfterEnd(e, tags[i].getText());
    //System.out.println("found tag: " + tags[i].getName() + ": " + tags[i].getText());
    catch (BadLocationException ble) {// cant happen?
    System.err.println("ERROR (" + 999 + "): Could not parse document " + filename + "; BadLocationException");
    System.err.println(ble);
    catch (FileNotFoundException fnf) {
    System.err.println("ERROR (" + 999 + "): Could not parse document " + filename + "; File not found");
    //System.err.println(fnf);
    catch (IOException ioe) {
    System.err.println("ERROR (" + 999 + "): Could not parse document " + filename + "; I/O Error:");
    System.err.println(ioe);
    fileDepth--;
    return doc;
    setInnerHTML kills it with the 'Can not set inner HTML of a leaf' error
    Thanks

  • HTML-TAG br

    Hello,
    I found out a strange thing in my HTML-Editor-Applet.
    I defined shift+ENTER as a <BR>-Tag (break row):
    htmlKit.insertHTML((HTMLDocument)editPane.getDocument(), editPane.getCaretPosition(),
    "<br>",0,0, HTML.Tag.BR);
    The strange thing is he following case:
    I've written some text, press shift+RETURN, writing some other text and again press shift+RETURN.
    When I press shift+RETURN the second time all he text I've written after the first shift+RETURN is deleted and the caret change it's position.
    Any ideas what this could be?
    thank you in advance.
    J&ouml;rn

    in case u still have problems in inserting the <br> tag, i am sending an example which is working perfectly. much of the code is taken from the discussion forum..thanks to richard and drew. http://forums.java.sun.com/thread.jsp?forum=57&thread=126795
    public class breakTest extends JApplet
         private JTextPane pane;
         private JButton dump;
         private JToolBar tb;
         private HTMLEditorKit kit;
         private HTMLDocument doc;
    public void init()
         pane = new JTextPane();
         kit = (HTMLEditorKit)(pane.getEditorKitForContentType("text/html"));
         doc = (HTMLDocument)(kit.createDefaultDocument());
         pane.setEditorKit(kit);
         pane.setDocument(doc);
         tb = new JToolBar(JToolBar.HORIZONTAL);
         dump=new JButton("Dump");
         //prints the underlying html code on the console for verifying
         dump.addActionListener(new ActionListener()
              public void actionPerformed(ActionEvent e)
                   System.out.println(pane.getText());
         tb.add(dump);
         getContentPane().setLayout(new BorderLayout());
         getContentPane().add(tb,"North");
         getContentPane().add(new JScrollPane(pane),"Center");
         breakAction brAction = new breakAction();
         Keymap map = pane.getKeymap();
         KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 1);
         map.removeKeyStrokeBinding(key);
         map.addActionForKeyStroke(key, brAction);
    public void fireAction(String name)
         Action[] actions = pane.getActions();
         Hashtable actionHash = new Hashtable();
         int count = actions.length;
         for(int h = 0; h < count; h++)
              actionHash.put(actions[h].getValue(Action.NAME), actions[h]);
         Action action=(Action)actionHash.get(name);
         action.actionPerformed(new ActionEvent(this,0,"blah"));
    //inner class for break action
    class breakAction extends AbstractAction
         public breakAction()
              super();
         public void actionPerformed(ActionEvent event)
              int offset = pane.getSelectionStart();
              HTMLDocument doc = (HTMLDocument)pane.getDocument();
              EditorKit kit = pane.getEditorKit();
              if(kit instanceof HTMLEditorKit){
                   try{
                        ((HTMLEditorKit)kit).insertHTML(doc, offset, "<br>", 0, 0, HTML.Tag.BR);
                        fireAction("caret-down");
                        pane.requestFocus();
                        pane.setCaretPosition(offset+1);
                        }catch(Exception e){
    //<applet code=breakTest.class width=500 height=300></applet>
    hth

  • How do I modify a Html tag attribute?

    Hi.
    I tryed to modify the witdth and height attributes of <applet> tag but I have not obtained it. I run this:
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.text.html.parser.*;
    class OtraPrueba{
         public static void main(String[] args){
              String infile = "c:\\Page1.htm";
              String outfile = "c:\\outPage1.htm";
              String applethtml = "<applet code=\"class1.class\" codebase=\"v_10\" width=\"100\" height=\"100\" archive=\"class1.zip\"";
              Reader r;
              Writer w;
              HTMLDocument htmldoc;
              HTMLEditorKit kit = new HTMLEditorKit();
              HTMLEditorKit.ParserCallback callback =          
                   new HTMLEditorKit.ParserCallback(){
                        public void handleText(char[] data, int pos){
                             for(int i=0;i<data.length;i++)
                                  System.out.println ("data[" + i + "]" + data);
                        public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos){
         System.out.println ("handleStartTag " + t);
         if (t == HTML.Tag.APPLET){
              a.removeAttribute(HTML.Attribute.WIDTH);
              a.addAttribute(HTML.Attribute.WIDTH, "100");
              try{
                   r = new FileReader(infile);
                   w = new FileWriter(outfile);
                   System.out.println ("antes del parser");
                   new ParserDelegator().parse(r, callback, false);               
    Can you help me?
    Thanks.

    Hello uhilger.
    I do it what you tell me last week but I get a NullPointerException at write the document extends HTMLDocument. It seems tries to write a empty tag. this is the exception text:
    _______________________exception text_____________________________
    java.lang.NullPointerException
    at javax.swing.text.AbstractWriter.write(AbstractWriter.java:489)
    at javax.swing.text.html.HTMLWriter.emptyTag(HTMLWriter.java:315)
    at javax.swing.text.html.HTMLWriter.write(HTMLWriter.java:187)
    at javax.swing.text.html.HTMLEditorKit.write(HTMLEditorKit.java:289)
    at Editor.setAppletAttributes(Editor.java:1017)
    at Editor.saveMenuItemActionPerformed(Editor.java:535)
    at Editor.access$13(Editor.java:24)
    at Editor$14.actionPerformed(Editor.java:421)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
    67)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
    ctButton.java:1820)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1
    092)
    at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
    d(BasicMenuItemUI.java:932)
    at java.awt.Component.processMouseEvent(Component.java:5021)
    at java.awt.Component.processEvent(Component.java:4818)
    at java.awt.Container.processEvent(Container.java:1380)
    at java.awt.Component.dispatchEventImpl(Component.java:3526)
    at java.awt.Container.dispatchEventImpl(Container.java:1437)
    at java.awt.Component.dispatchEvent(Component.java:3367)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
    at java.awt.Container.dispatchEventImpl(Container.java:1423)
    at java.awt.Window.dispatchEventImpl(Window.java:1566)
    at java.awt.Component.dispatchEvent(Component.java:3367)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:190)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
    ___________________end_exception text_____________________________
    I make a subclass of HTMLDocument with name EditableHTMLDocument :
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.text.html.HTMLDocument;
    class EditableHTMLDocument extends HTMLDocument{
         public void addAttributes(Element e, AttributeSet a) {
              if ((e != null) && (a != null)) {
                   try {
                        writeLock();
                        System.out.println("SHTMLDocument addAttributes e=" + e);
                        System.out.println("SHTMLDocument addAttributes a=" + a);
                        int start = e.getStartOffset();
                        javax.swing.text.AbstractDocument.DefaultDocumentEvent changes =
                        new javax.swing.text.AbstractDocument.DefaultDocumentEvent(start, e.getEndOffset() - start,
                             DocumentEvent.EventType.CHANGE);
                        AttributeSet sCopy = a.copyAttributes();
                        MutableAttributeSet attr = (MutableAttributeSet) e.getAttributes();
                        changes.addEdit(new AttributeUndoableEdit(e, sCopy, false));
                        attr.addAttributes(a);
                        changes.end();
                        fireChangedUpdate(changes);
                        fireUndoableEditUpdate(new UndoableEditEvent(this, changes));
                   }finally {
                        writeUnlock();
    And this is the method of program main class than call you addAttributes method:
         private void setAppletAttributes(){
              BufferedReader br;
              BufferedWriter bw;
              HTMLDocument htmlDoc;
              EditableHTMLDocument editHtmlDoc;
              HTMLEditorKit kit = new HTMLEditorKit();
              try{          
                   br = new BufferedReader( new FileReader( jTxtHtmlFile.getText() ) );
                   //htmlDoc = (HTMLDocument)kit.createDefaultDocument ();
                   editHtmlDoc = new EditableHTMLDocument();
                   kit.read (br, editHtmlDoc, 0);
                   br.close ();
                   javax.swing.text.Element rootElem = editHtmlDoc.getDefaultRootElement ();
                   javax.swing.text.Element elem =
                        editHtmlDoc.getElement (rootElem, HTML.Attribute.CODEBASE, jTxtCodebase.getText ());
                   SimpleAttributeSet sas = new SimpleAttributeSet();
                   sas.addAttribute ( HTML.Attribute.CODE, jTxtCode.getText () );
                   sas.addAttribute ( HTML.Attribute.CODEBASE, jTxtCodebase.getText () );
                   sas.addAttribute ( HTML.Attribute.ARCHIVE, jTxtArchive.getText () );
                   sas.addAttribute ( HTML.Attribute.WIDTH, jTxtAnchoApplet.getText () );
                   sas.addAttribute ( HTML.Attribute.HEIGHT, jTxtAltoApplet.getText () );
                   editHtmlDoc.addAttributes (elem, sas);
                   editHtmlDoc.dump (System.out);
                   bw = new BufferedWriter( new FileWriter( jTxtHtmlFile.getText() ) );
                   System.out.println ("length " + editHtmlDoc.getLength ());
                   kit.write (bw, editHtmlDoc, 0, editHtmlDoc.getLength ());
                   bw.flush ();
                   bw.close ();
              }catch(BadLocationException ble){
                   System.out.println ("BadLocationException " + ble.getMessage());     
    }catch(FileNotFoundException fnfe){
                   System.out.println ("FileNotFoundException " + fnfe.getMessage());     
              }catch(IOException ioe){
                   System.out.println ("IOException " + ioe.getMessage());
    Which you think that it is the problem?
    Thank you.
    Sergio Mart�n
    I visited your great page and download your SimplyHTML. I'll probe later.

  • List of stripped HTML-Tags in Publication Mode

    Hi,
    I'm doing some research about the printing abilities of MDM PCM.
    For this reason im searching for the HTML-Tags which are stripped out in the different Modes (especially Publication Mode)
    I got a hind in "MDM Data Manger Reference Guide" on Page 521, that HTML tags are stripped out, but I can't find a List with the tags.
    Regards
    Christoph Kohler

    Hi Christoph,
    In terms of properly viewing HTMLs in the publication modes, there is actually a small piece of intermediary software that is available to our customers who use MDM to publish catalogs. It is called the HTML filter. Basically what it does is translate your HTMLs to tags that may be read by the publication modes. Tags that are supported by this filter are:
    attributesStr << " border-top-style:solid; border-top-color:black; border-top-width:" << borderWidth << "pt;";
    attributesStr << " border-left-style:solid; border-left-color:black; border-left-width:" << borderWidth << "pt;";
    attributesStr << " border-bottom-style:solid; border-bottom-color:black; border-bottom-width:" << borderWidth << "pt;";
    attributesStr << " border-right-style:solid; border-right-color:black; border-right-width:" << borderWidth << "pt;";
    attributesStr << " font-style:italic;";
    attributesStr << " font-weight:bold;";
    attributesStr << " font-size:" << dFontSize << "pt;";
    attributesStr << " font-family:" << fontFamily << ";";
    attributesStr << " text-align:" << textAlign << ";";
    attributesStr << " vertical-align:top;";
    attributesStr << " vertical-align:middle;";
    attributesStr << " vertical-align:bottom;";
    attributesStr << " background-color:" << bgColor << ";";
    attributesStr << " vertical-align:sub;";
    attributesStr << " vertical-align:super;";
    Hard coded table attributes are
    cleansedHtmlStr += StringNL("<table cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse:collapse\"");
    The table cells support rowspan and colspan attributes.
    <br/> is used for hard returns.
    tags that are picked out of the source HTML are:
    mainTags.push_back(StringNL("table"));
    mainTags.push_back(StringNL("#text")); //meaning any text outside of the table
    mainTags.push_back(StringNL("br"));
    These three types of objects are represented in the filtered HTML with style attribute markup.
    For example, #text is filtered to <span style = "font-family:Helvetica; font-size:7pts;"><p>my text</p></span>
    The use of this filter is a temporary workaround. Development is planned to incorporate this process into the Data Manager so that the user will eventually have the option of creating HTML "variants" similar to the variants that can currently be created for images. This way, you will be able to store a version of the HTML code that is appropriate for both web and print.
    Please contact me directly via email [email protected] for further information regarding this issue.
    Hope this is helpful,
    Neta

  • Reports does not show data which contains HTML tags

    Dear Gurus
    Im trying to resolve this problem but im really stuck in it. I have the requirment to customize PO reports in R12 and at the end of every report we have to show its Terms and Conditions.I have the following query wich brings me the data i need.
    SELECT
    otu.document_number po_segment1,
    otu.document_id,
    otta.template_id,
    otta.template_name,
    otta.description,
    otta.intent,
    otta.status_code,
    otta.start_date,
    otta.end_date,
    otta.instruction_text,
    otu.document_type,
    otu.document_number po_segment1,
    otu.document_id po_header_id,
    osb.HEADING titulo_seccion,
    oav.display_name,
    oav.article_text article_text
    FROM
    apps.okc_terms_templates_all otta,
    apps.okc_template_usages otu,
    apps.okc_k_articles_b okab,
    apps.okc_sections_b osb,
    apps.okc_articles_all oaa,
    apps.okc_article_versions oav
    WHERE otta.template_id = otu.template_id
    AND otu.document_id = okab.document_id
    AND osb.scn_id(+) = okab.scn_id
    AND okab.article_version_id = oav.article_version_id
    AND oaa.article_id = oav.article_id
    AND otu.document_number='21000000111' -- Purchase Document
    AND otu.DOCUMENT_TYPE NOT IN ('RFQ_RESPONSE', 'RFQ','RFI_RESPONSE','RFI','AUCTION_RESPONSE','AUCTION')
    The problem is the field okc_article_versions.article_text storage data with HTML tags as an example : ''<P>COMPANY will make it’s best effort to provide an accurate forecast to CONTRACTOR, <B><I>at the end of every quarter,</I></B> however, a forecast in any form, shall not represent a firm commitment by COMPANY.,</P>"
    So when i tried to show the information my .rtf template nothing comes out. Does anybody knows whats happenig and how to resolve it??
    Please, resolve this issue is more than urgent an i guess somebody have the answe Thanks a lot
    Mily

    Hi ,
    Currently image url have value http://serverip:port/reports/rwservlet
    I don't know is this correct? Suggest What value it should have?
    Thanks
    Vinod

  • HTML Tags escape while exporting to PDF

    Hi friends,
    I have two columns in my BI report like
    Business Group(BG) and OU
    Since in the BG column under the edit formula i used the html tags to show each and every BG column value in bold like below
    '<b>' || "D1.Company"."Business Group Full Name" || '</b>'
    Now the report is appearing fine in answers and dashboard but when i export the same report to PDF i can see the html tags in each and every name of the BG group.
    Is there anything to be done to escape these html tags in PDF while exporting.
    And also if we give the tooltip for the numeric columns like below under the column properties-->Data format-->Custom like
    [html]<p title=\""Employee Count" \">#
    And after that if i tried to escape the same report with the tooltip on the numeric column to pdf means, the number values are missing for the entire column in the PDF, but this case is not appearing while exporting the report to pdf if i set the tooltip to the text column, as the values is missing only for the tooltip of the numeric column. What could be the fix for this problem.
    Thanks
    Regards,
    Saro

    Hi svee,
    Thanks for the reply.
    For an example i tried with the bold option in the edit formula inorder to portray the html tags problem while exporting it to the pdf inspite of using the default bold option within the column properites like u said.
    Suppose if i used html tags like
    <br>, </br>
    in the edit formula section or if i used any other html tags which is not present as a default option in bi like bold. At that time while exporting the report to pdf i can face the issue.
    And also i need ur suggestion regarding with the values disappearing for the numeric column if a tooltip is used in it while exporting it to the pdf.
    Regards,
    Saro

  • Unable to handle html tags in BI publisher trial edition

    Hi,
    I am very new to BI publisher and having issues reading rich text field from database and reading into the report.
    BI Publisher - 11.1.1.6 trial edition
    test case: I have a rich text field that stores html tags in the database. I have created a data model using sql query and am selecting rich text field from the database. When trying to display that field on the report in BI publisher I get the html tags.
    I even tried Tim Dexter solution mentioned in the below blog but now when I run the report nothing shows up for that rich text field in the report. I am not sure if I am missing any steps while using html2fo.
    https://blogs.oracle.com/xmlpublisher/entry/html_in_xml_support
    Please help since I am struggling with this for past few days. Also below is the sample xml data where element "PROJECT_DETAILS" is the rich text field.
    Thanks,
    Saurabh.
    <G_2>
    <EMPLID_1>0001</EMPLID_1>
    <PROJECT_DETAILS><![CDATA[<p class="Resume-JobSum">Managed and led twenty members technical team to successfully complete development on time. Took over management of behind schedule development and provided direction and discipline to complete development cycle on time.</p> <p class="Resume-ExperienceBullets" style="margin-left:43.0pt;text-indent:-.25in;mso-list:l0 level1 lfo1;tab-stops:.5in;"><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol;">·<span style="font-size: 7pt;font-family: 'Times New Roman';">         </span></span>Improved delivery by prioritizing development items.</p> <p class="Resume-ExperienceBullets" style="margin-left:43.0pt;text-indent:-.25in;mso-list:l0 level1 lfo1;tab-stops:.5in;"><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol;">·<span style="font-size: 7pt;font-family: 'Times New Roman';">         </span></span>Improved efficiency by removing dependencies and delegating work.</p> <p class="Resume-ExperienceBullets" style="margin-left:43.0pt;text-indent:-.25in;mso-list:l0 level1 lfo1;tab-stops:.5in;"><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol;">·<span style="font-size: 7pt;font-family: 'Times New Roman';">         </span></span>Improved cost management by controlling over time hours on the team.</p> <p class="Resume-ExperienceBullets" style="margin-left:43.0pt;text-indent:-.25in;mso-list:l0 level1 lfo1;tab-stops:.5in;"><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol;">·<span style="font-size: 7pt;font-family: 'Times New Roman';">         </span></span>Provided infrastructure planning for support and future phases.</p> <p class="Resume-ExperienceBullets" style="margin-left:43.0pt;text-indent:-.25in;mso-list:l0 level1 lfo1;tab-stops:27.0pt;"><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol;">·<span style="font-size: 7pt;font-family: 'Times New Roman';">         </span></span>Planned and Managed change management and migration process.</p><p></p>]]></PROJECT_DETAILS>

    are u using an RTF template?
    u need to use
    <?html2fo: COLUMN_NAME?>
    instead of <?COLUMN_NAME?> in the RTF template
    http://docs.oracle.com/cd/E23943_01/bi.1111/e22254/create_rtf_tmpl.htm#CHDCEEIJ
    Edited by: anupma.s on Feb 21, 2013 11:12 AM

Maybe you are looking for

  • Re-scheduling Propagation following an error

    Hi, Im currently testing how streams perform when there are problems at the remote database. I've shutdown the mate database and then run traffic. OEM, under the propagation tab shows that there are errors and that the propagation job will start runn

  • My Ipod Touch 4G can't connect to my internet

    My Ipod Touch 4G won't connect to my internet anymore.  I have had this Ipod for about 2 months and have never had any noticeable problems with my internet connection, but today I left the house for an hour and when I came back I couldn't get it to c

  • SWFLoader - SWF showing objects outside stage

    Hi... I have a SWF that I am loading with SWFLoader. For some reason, all of the elements that are outside the stage in the SWF (animated objects) are showing in Flex. How do I only show the SWF as it is supposed to be seen? I have set height and wid

  • [SOLVED] yaourt -Syua wants to update a package which hasn't changed

    I built a modest package, vi-vim-symlink, tested it extensively with pacman, and then uploaded it to AUR. Recently some user reported that every time he runs yaourt, the package wants to be reinstalled.  I installed yaourt and confirmed this behavior

  • I need help with setting 2 decimal places

    I am using netbeans to create a GUI. My math works I need help formatting the result to 2 decimal places. Thanks for any help. This is part of my code.. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {