How to REMOVE [b] H1 Tag[/b] from HTML without changing other Tags?

Hi there!
I'm searching for a method to remove Tags from HTML (using HTMLEditorKit, HTMLDocument ...).
My current code is as follows:
// first get the whole paragraph
   int iCaretPos = tpMyTextPane.getCaretPosition();
   Object oAttrib;
   HTMLDocument.BlockElement oElem = (HTMLDocument.BlockElement)oMyDocument.getParagraphElement(iCaretPos);
   AttributeSet oAttribs;
   SimpleAttributeSet oNewAttribs;
   int iParaStart = oElem.getStartOffset();
   int iParaEnd = oElem.getEndOffset();
   tpMyTextPane.select(iParaStart, iParaEnd);
   // the following only fetches the Tags that are valid for the whole paragraph!!!!!
   oAttribs = tpMyTextPane.getCharacterAttributes();
   oNewAttribs = new SimpleAttributeSet(oAttribs);
   if(iParaEnd - iParaStart > 0)
      // now analyse the attributes (remove all paragraph-tags)
      for(int iIndex = 0; iIndex < oaOurFormatTags.length; iIndex++)
         oNewAttribs.removeAttribute(oaOurFormatTags[iIndex]);
      if(iParaEnd - iParaStart > 0)
         oMyDocument.setCharacterAttributes(iParaStart, iParaEnd - iParaStart, oNewAttribs, true);
         tpMyTextPane.setCaretPosition(iCaretPos);
      tpMyTextPane.requestFocus();
      tpMyTextPane.repaint();
   }This code works for me, but all Tags of the selected paragraph are removed. That means:
<P><H1>This is a <B>test</B> text<H2></P>
will be converted to:
<P>This is a test text</P>
but I want it to be converted to:
<P>This is a <B>test</B> text</P>
Is there any other method to remove specific Tags (<H1>, ... <H6>) without touching other tags????

In February I wrote a feature request about this. Today it has been accepted to the bug database. Please make your vote:
http://developer.java.sun.com/developer/bugParade/bugs/4760082.html

Similar Messages

  • How to remove extract space between pages in smartform without changing output

    Hello Experts,
    I've been given a requirement where I need to remove extra space between pages of a smartform (refer to the attachment). If you look at the following screen shot then you will notice that that there is a command provided to display details on these pages which has a checkbox 'Go to New Page'.
    When I removed the above New Page comment then still I don't see the expected output (Refer to the attached screen shot 'Expected' to see what I need).
    Also there is another there is another New Page command (as shown below).
    When I tried to removed the above New Page Command then output was totally changed which user don't want (as shown below. Table should have been break on BCVI on red line, which happens today but with so much extra space).
    To view the correct output how user want please have a look at 'Expected' screen shot.
    Now the question is what change I should make in my smartform to accomplish the expected output.
    Many thanks in advance.

    Hello,
    I think that it should work, this construction of an loop node including all relevant items and at the event TAB event sort field only these items are copied in the OUTPUT_TAB which should be printed in a separate table on the form. After having printed the table, the content of the internal table is cleared.
    I suppose that you first should check if this TAB "event sort field" includes the correct criteria for the necessary group change. If this event is really defined correctly, then I only have one hint for you.
    I know that the only possibility to define a page break in a table in the Window MAIN is to use the following technique:
    Define an outside loop node and in this loop node a table node, but this table does not have a internal table to be looped through. It includes only the fields to be printed, maybe you have to re-design your table node.
    By the way only then you can define a command node including a page break during the processing of an internal table.
    Regards
    Juergen

  • How to remove my credit card information from my icloud account?

    how to remove my credit card information from my icloud account?

    iTunes Store: Changing Account Information
    http://support.apple.com/kb/HT1918
     Cheers, Tom

  • TS3274 How to remove an old iCloud account from my IPad.  The account (email) was on my dad's name and he resently change it and now i can't  reset or delete his iCloud account without his password.  Please advise on the procedure.  Thanks.

    How to remove an old iCloud account from my IPad.  The account (email) was on my dad's name and he resently change it and now i can't  reset or delete his iCloud account without his password.  Please advise on the procedure.  Thanks.

    If you are trying to activate an iPad or iPhone and it is asking for a previous owners Apple ID and password, you have encountered the Activation Lock. This is a security feature that prevents thieves from setting up and using a stolen or lost iPad or iPhone. You have no alternative. You must use the previous owner's password to get permission to use the device. If you cannot get the password your father put on the iPad you will never be able to activate the device and no one can help you do it.

  • How to remove plug in ._v1_.swf from safari

    How to remove plug in ._v1_.swf from safari. Can't do it the usual ways.

    Please post the crash report.

  • How to remove all the cleaup events from DBA_AUDIT_MGMT_CLEAN_EVENTS

    Dear gurus,
    how to remove all the cleaup events from DBA_AUDIT_MGMT_CLEAN_EVENTS
    Arun

    Hi,
    Take a look:
    http://www.morganslibrary.org/reference/pkgs/dbms_audit_mgmt.html
    Regards,

  • How to remove the system data details from the overview tab in crmd_order?

    Hi All,
    How to remove the system data details from the overview tab in crmd_order?

    Hi,
    It is a standard functionality. Those information will be very useful when you send a message to SAP.
    If you still want to remove them, raise an OSS message.
    Regards,
    Rajesh Kumar

  • TS4147 How to remove all the duplicated contacts from ICloud?

    How to remove all the duplicated contacts from ICloud?

    If your Mac is syncing contacts with your iCloud account, open Contact on your Mac and go to Card>Look for Duplicates, then Merge the found duplicates.  These changes will be synced to iCloud.

  • How to remove a old iCloud account from the iphone

    I purchase a iPhone from somebody and the phone has been reset but the iCloud shows that he phone has reach it max numbers of free account to sign. So how I remove a old iCloud account from this phone. I do not have phone support so I am unable to get help from apple can anybody help me

    is there anyone there who can help or any type of subjection to this matter or am i the only one who has come accross this issue.

  • How to remove a broken charger nib from my iPad?

    How to remove a broken charger nib from an iPad?
    <Email Edited by Host>

    Was it the old 30-pin connector, or the new Lightning plug? There have been sporadic reports of the new connector snapping just ahead of the two side "dimples" that are used to hold it in place, but this would be the first time I hear of similar failure on the older and bigger connectors.
    If at all possible, I would suggest a visit to an Apple Store for free assessment. Else proceed with caution either with tweezers and/or a pin to nudge the fragments out. Maybe a review of the corresponding teardown of your model at IFixIt.com may help you visualize how to attack the problem.

  • How do I download all my songs from iCloud without having to click on each one?

    I have two computers and I would like to have my iTunes library on both. How do I download all my songs from iCloud without having to click on each one?

    Create a smart playlist with the criteria being location - not on this computer. Then select all, right click and download.

  • This is my first mac i have 2 hard drives installed how do i move photos or documents from one to the other

    i just bought my first imac i have 2 seperate drives on it. how do i move photos and documents from one to the other.

    This is our resident iPhoto guru, Terence Devlin's, advice:
    You can move your iPhoto Library to an external or secondary internal disk:
    1. Quit iPhoto
    2. Copy the iPhoto Library Folder as an entity from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.

  • How to Transport standard text in scpits from 1 client to other

    HI I am veerendra,
    Can you please tell me,
    How to Transport standard text in scpits from 1 client to other
    THanks,
    Veerendra

    Hi veerendara,
    1. a little tricky
    2. goto se09 and create a new
    customizing rqeuest.
    3. after that
    in the object list,
    go in edit mode
    and a new window will come
    where u can add the objects(in table control)
    4. there u put
    program id = R3TR
    object type = TEXT
    object name = TEXT,YHRS_FNF_LTR,YHR1,E
    where
    TEXT = TEXT
    YHRS_FNF_LTR = name of standard text
    YHR1 = TEXT ID
    E = english language
    regards,
    amit m.

  • How can I import my music CD from an external drive (other PC) via LAN?

    How can I import my music CD from an external drive (other PC) via LAN?
    I have tried by "add..." but without success.

    Hello DIRP,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iTunes: About the Add to Library, Import, and Convert functions
    http://support.apple.com/kb/ht1347
    Best of luck,
    Mario

  • How To Access PAGE ITEM (single row) from HTML source

    Hi Guys,
    I have a page Item that return a string.
    I would like to show this string
    How To Access PAGE ITEM (single row) from HTML source?
    My desire final output is
    <marquee>:P1_PAGE_ITEM</marquee>
    Can please help me
    Thanks

    Hi,
    You can refer the page items in your page header as &itemname. For example, if I have page item P15_TEST, I will add the following in header:
    <marquee>
       &P15_TEST.
    </marquee>But make sure that you have a process before header to populate the value in your page item. Otherwise, there will be a null scrolling (which you can't see!) :)
    Regards,
    Zahid

Maybe you are looking for

  • Issue with Get-LogonStatistics in Exchange 2013

    Hi all, I run into an issue with the Get-LogonStatistics cmdlet. The error says: Cannot find LogonStatistics objects from the root 'DB1'. Please make sure that you specified the correct search root and that you have the correct permissions to perform

  • Inability of the staff to deal with the problem in the phone

    I bought the experia z1 in February 2014 . The phone was supposed to be waterproof.  I used it while standing on a rock againt which waves striked and their were splashes of water. I was cautious that the guard of the charging port was closed.  After

  • Help in alv display

    Hallow I doing a alv report that  display org. unit. for that I use function   That bring all the unit below  and the level of the org. unit .my problem is that I wont to display the org.unit below write side the father For that I can use the level b

  • How do you call a JavaScript function from a Java applet

    I have an Applet that needs to run on the following platforms: Internet Explorer (Windows-NT, Windows -2000), Netscape (Windows-NT, Windows-2000, Sun(Solaris), RedHat(Linux), HP(11.0), IBM(AIX)). The Applet needs to call a JavaScript function that is

  • Error while doing MB1B ( movement type is 413E)

    Dear friends, when we are trying to do the tranfer posting (MB1B), system is throwing an error, it is "Characteristic value  ZOLC( Sales document ype) does not exist for characteristic WW207 (Sales Order Type) Message no. KE0C133". As per as my conce