p tags with attributes not removed from JTextPane

We are using HTMLEditorKit with JtextPane to create a HTML Document Editor, for our project. [JDK 1.3.1.]
When we have a simple <p> tag for paragraph in HTML and we start deleting things from end of the document, it works fine. But when we have a <P> tag with attributes like <p align='CENTER'> the delete key deletes the characters but the cursor remains in the line below and doesnot move up as the characters of above para get deleted. The HTML also retains the <p align='CENTER'> tag, which should have been removed. It seems its not able to identify <p> tags with attributes as Html para tags, and so not deleting it.
How do we solve this without migrating to jdk1.4 ? Please help.

Usually attributes such as 'align=center' are deleted along with a tag, regardless of whether it is a p tag or another one. But you would have to carefully test what exactly gets deleted because attributes are not only stored with paragraphs. They can exist for single characters and as well come from a style sheet.
The best is to generate a dump of your document before and after deletion.
You can use something like the below code (it is not optimized at all and thus could be implemented better but it works) to produce a dump
  public void listElements(Element elem, int indent) {
    int i;
    String is = getIndent(indent);
    String elemName = elem.getName();
    Document elemDoc = elem.getDocument();
    String cont = "";
    String theText = "";
    System.out.println(is + "--start-----");
    System.out.println(is + "Element Name:" + elemName);
    if(elemName.equals(new String("content"))) {
      try {
        theText = elemDoc.getText(
                elem.getStartOffset(),
                elem.getEndOffset() - elem.getStartOffset());
        System.out.println(is + "Content: " + theText);
        if(theText.indexOf("\r") > -1) {
          System.out.println(is + " plus \\r");
        if(theText.indexOf("\n") > -1) {
          System.out.println(is + " plus \\n");
      catch (Exception e) {
    listAttributes(elem, indent);
    if(!elem.isLeaf()) {
      for(i=0;i<elem.getElementCount();i++) {
        listElements(elem.getElement(i),indent+2);
    System.out.println(is + "---end----");
  public void listAttributes(Element elem, int indent) {
    Object key;
    String attr;
    String attrName;
    int pos;
    String is = getIndent(indent);
    AttributeSet as = elem.getAttributes();
    Enumeration an = as.getAttributeNames();
    try {
      while(an.hasMoreElements()) {
        key = an.nextElement();
        attrName = key.toString();
        attr = as.getAttribute(key).toString();
        System.out.println(is + "Attribute Name: " +
                  attrName + " Attribute Content: " + attr);
        if(attr.indexOf("\r") > -1) {
          System.out.println(is + " plus \\r");
        if(attr.indexOf("\n") > -1) {
          System.out.println(is + " plus \\n");
    catch (Exception e) {
      e.printStackTrace();
  }Hope that helps
Ulrich

Similar Messages

  • After deleting users they are not removed from portal30.wwsec_person

    I am building a customized script to carry on users self registration.
    the script is going great and user is created and i can log into portal
    successfully with this new created user.
    I relogin as portal administrator and delete this new user and now if i tried
    to list portal users I cant see the user.
    But when I try to rerun my script to recreate this user again it fails when I
    investigated I found that it fails because the entry of this user is removed
    from portal30_sso.wwsec_person while it still exists in portal30.wwsec_person
    so the script fails as there is duplicate in primary key.
    Is this a bug in portal 309 that when the user is deleted it is not removed
    from portal30.wwsec_person

    This is actually a combination of intended behavior/design and a bug.
    Let me first explain why there is a user in both the PORTAL30_SSO schema as well as the PORTAL30 schema.
    The definition of the user, that can log in, and defines the single sign-on account, is the user's entry in the
    WWSEC_PERSON$ table in the PORTAL30_SSO schema. The SSO server actually just uses a subset of the
    columns in this table -- those defined in the WWSSO_SSO_USER view.
    The same table exists in the PORTAL30 schema, because there is a lot of common infrastructure code
    shared by both applications (Login Server, and Portal). The Security and Session Management code
    is common, and this code includes the dependency on the WWSEC_PERSON$ table.
    Now, assuming that the code was independent (for the sake of argument), why do we still have an entry
    for the user in both schemas? As I mentioned earlier, the user entry in the SSO schema is the "master".
    The SSO server can have multiple partner applications connected to it. Indeed, on my.oracle.com, the
    login server there has at least 4 portals hooked up to it, and a few other non-Portal partner applications,
    such as Oracle Mobile.
    Each partner application may have a local user profile that it uses to store application specific attributes
    of the user. This is stuff that the Login Server is not interested in, and could in no way predetermine for
    all conceivable partner applications. So, it is not unreasonable for each partner application to also have
    a user record which stores additional attributes of the user (not related to user authentication), and which
    can be used to reference other user-related data. For example in the Portal, all the user's privileges
    and group memberships are tied to the Portal's user record (foreign key constraints). So, the Portal
    being just one partner application of the Login Server, it adhere's to this model and has a user entry
    in it's schema corresponding to the user entry in the Login Server.
    When a user logs on and accesses a partner application for the first time, the partner application (read Portal)
    is expected to automatically create a local profile entry for the user on demand. The Portal does this.
    In 3.0.9 and previous versions, to delete a user, you need to delete the user in the Login Server AND the Portal.
    The only way to do this is to first delete the user in the Login Server, using the User Portlet.
    Then type the user's name into the Portal User Profile portlet (they won't be in the LOV anymore since
    you just deleted them from the login server), and click Edit, then Reset To Defaults (this means delete).
    You will then get a User Not Found error, since the page is trying to go back to show the details about this user.
    (All this has been fixed in 9.0.2 v2, by the way).

  • Workitem is not removed from User Inbox

    Hi,
    There is requirement, when the PR is created by user, first it has to go his department Head and then to Manager, AGM, GM, etc. There are different departments.
    I'm maintaining organizational structure and giving positions in Release Strategy. Now how can i know who has created and to whom it has to go first. Shall i create different release strategy for that ?? Or is there any other way ??
    And i tried to create custom workflow and using two release steps instead of one. And giving Rule in my first release step. And in second release step i'm using the strategy. When i create the PR and release, it is not removing from User Inbox.
    Do anyone know what could be the problem ??

    Hi,
    From your requirement, its not a good idea to have all department heads assigned to a single position.
    But, you can have different positons for different departments and the association between department and the corresponding position number can be maintained in  ztable. Then have a custom rule based on function module which will make a call to this ztable and find the corresponding postion given the department of user, get this position out and use it as agent assignment in step. However to use above first you should be able to find the Deparment to which a given user belongs to.
    the position that you are talking about in your question, is it a position with relevance to HR structure or is it just that you have created for workflow purpose. In general its a good idea to have bit strong dependency with HR structure rather than going for workflow specific positions. If your position is a HR position then probably with bit of reengineering the HR organization structure with respect to your departments would be good and with a good design of org structure you can also get rid of any new custom table to maintain the relation between department and corresponding position.
    Good Luck !!
    Regards
    Krishna Mohan
    ooops !! many replies came in while drafting this mail itself, i guess rule using custom table already tried !!
    Edited by: Dubbaka Krishna Mohan on Jan 29, 2008 9:20 AM

  • Long time ago I trialed elements 9  and could not remove from Programs; still can't

    Long time ago I trialed Elements 9  and could not remove from Programs at the time; still can't?
    I didn't go forward with '9' because of its size and it didn't appear to provide advantages for the cost.
    How do I uninstall it when conventional methods fail. Message received in Windows Installer is, ' The feature you are trying to use is on a network resource that is unavailable.' Elements 9 cannot be used.

    " When I did this, my library showed all the music I have "purchased" from itunes but did not have the music that I downloaded a long time ago through itunes from my old CDs."
    Correct.
    " How can I get that music to show up in my library now on my new computer?  "
    Copy it from your old computer or your backup copy of your old computer.
    The sync is one way - computer to ipod.

  • Machines not removed from AD when reimaged - Not Installing client- how to resolve client not installing

    Hello, i have across a machine that does not have the sccm agent installed, but states on the server that it is installed. Now I am assuming that someone in the team reimaged but did not remove from AD. If this is the case, how do i resolve this? I have
    2,000 clients so need to know how widespread this is.
    i checked the client logs but there are no ccm/sccm entries. I know i could probably remove from SCCM then run a Discovery Method, but if there are more out there, i need to find a fix potentially. The client is not installed on the image. Boundarys all
    set ok.
    SCCM 2012 R2
    Cheers

    You could create a new collection with a query to find out when a clients last heartbeat was or maybe hardware inventory data age? This isn't going to completely solve the problem, but it will narrow down which clients your after. The queries I have below
    have an age value of greater than or equal to 30 days. Just increase this obviously to query for clients that haven't reported back in longer amounts of time.
    Heartbeat Query
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where AgentName in ("Heartbeat Discovery") and DATEDIFF(day,AgentTime,GetDate())>=30
    Hardware Inventory Scan Date Query
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where ResourceId in (select SMS_R_System.ResourceID from SMS_R_System
    inner join SMS_G_System_WORKSTATION_STATUS on SMS_G_System_WORKSTATION_STATUS.ResourceID = SMS_R_System.ResourceId where DATEDIFF(dd,SMS_G_System_WORKSTATION_STATUS.LastHardwareScan,GetDate()) > 30)
    Its also likely that clients in this situation will be marked by Config Manager as inactive. So you could also just sort by your inactive clients but this again will have a % of error as your inactive clients may be a result of workstations being off your
    network for a prolonged period of time or simply turned off.
    If you can ping a client that has a hardware inventory age of greater than 30 days but you have a client policy to run it say daily, then you could argue they fall into the category your after.
    You could also look at this outside of the Console all together. A possible option could be to use a startup / login script to check for the presence of the Config Manager client and then install it if its not (there are quite a few about). If you're not
    comfortable with this, then you could use a startup / login script to check for the presence of the client and write say a hostname or something similar to a text file.
    Cheers
    Damon

  • Deleted attachments are not removed from Content Server

    We have setup Content Server to store business documents and create attachments in documents in CO. Both types are stored ok and can be opened without any problems. After deleting them though, they disappear from the Attachment List but when looking in CS, attachments created on the document still exist in CS. Stored business documents on the other hand are removed properly.
    Looking at statistics in CSADMIN shows that the deletion of the created attachment does not increment the "delete" counter.
    Any ideas on why the created attachments are not removed from CS upon deletion?
    Thanks

    We have solved this issue now. By design, the attachments are not removed directly from the content server upon deletion; Instead you will need to run report RSBCS_REORG to completely remove them from the Content Server.
    Edited by: Christian Nordvaller on Jan 26, 2010 3:53 PM

  • PO Approval Items Workitems are not removed from the Universal Worklist UWL

    Hi,
    Certain of our purchase orders require approval, they are sent to the relevant approver via workflow to their SAP inbox (SBWP) and universal worklist.
    When the user executes the workitem (Approve or Reject) The workitem should be removed from the universal worklist and SBWP when refreshed.
    The problem we experiencing is that the Workitems are not removed from the UWL after they have been executed. The SBWP is behaving correctly and the items are removed.
    It is not all the workitems that have this problem, only certain ones - but there is no pattern.
    Thanks for the help.

    Hi,
    The user B approved the PR accessing the transaction SBWP or via PR transaction directly?
    If via PR transaction directly, then your workflow needs a Wait Event step.
    Regards,
    Kleber

  • IPad not backed up icon will not remove from screen

    iPad not backed up icon will not remove from screen

    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Infopath form not removed from central admin after retracting the solution

    I have InfoPath form admin appvoed deployed through Stat machine workflow when I retracting some forms are not removing from Central admin
    when trying to deploying it says
    Error 3 Error occurred in deployment step 'Add Solution': An object of the type Microsoft.Office.InfoPath.Server.Administration.FormTemplate named "urn:schemas-microsoft-com:office:infopath:" already exists under the parent Microsoft.SharePoint.Administration.SPFarm
    named "SharePoint_Config".  Rename your object or delete the existing object.
    I have tried renaming the file as well
    MCTS,ITIL

    Hey shahid
    try to use force command to uninstall/remove solution,then only add solution.
    if this not work out then first uninstall feature using force and manually delete feature folder from file system inside layouts.
    Regards,
    Rajendra Singh
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
    http://sharepointundefind.wordpress.com/

  • I just bought my iphone5c on ebay, but the previous owner will not remove from their account, what do i do?

    I just bought my iphone5c on ebay, but the previous owner will not remove from their account, what do i do?

    You won’t be able to use it. Ask eBay for a refund.
    (120398)

  • When i want delete music in my ipad i make sync in itunes without music but the music not remove from ipad i get problim please help me my email

    when i want delete music in my ipad i make sync in itunes without music but the music not remove from ipad i get problim please help me my email

    hi i think you can used itools is very esye for add and delete eny thing that is link http://www.itools.cn/multi_lang_pc_download.htm

  • XML tag with attributes and one value via XSU

    I need to generate a XML structure with attributes in the opening tag, and just one value in the body, like this:
    <PRODUCT-LIST-PRICE NET-PRICE="0" CURRENCY="USD">9.99</PRODUCT-LIST-PRICE>
    Without an object type, I can just create tags like this
    XML3
    <PRODUCT-LIST-PRICE>9.99</PRODUCT-LIST-PRICE>
    (with no attributes, but a single value) via the followig statement
    SELECT sys_xmlgen ('9.99',
    sys.xmlgenformattype.createFormat('PRODUCT-LIST-PRICE')
    ).getClobVal() "XML3"
    FROM DUAL;
    Having an object "productlisteprice_type", defined by
    CREATE OR REPLACE TYPE productlisteprice_type AS OBJECT
    "@NET-PRICE" VARCHAR2(10),
    "@CURRENCY" VARCHAR2(10),
    "PRICE" VARCHAR2(20)
    I just get XML like this
    XML2
    <PRODUCT-LIST-PRICE NET-PRICE="0" CURRENCY="USD">
    <PRICE>9.99</PRICE>
    </PRODUCT-LIST-PRICE>
    (with attributes, but no direct value beneath the "PRODUCT-LIST-PRICE" tag) via the following statement
    SELECT sys_xmlgen ( productlisteprice_type(0,'USD','9.99'),
    sys.xmlgenformattype.createFormat('PRODUCT-LIST-PRICE')
    ).getClobVal() "XML2"
    FROM DUAL;
    Not what I need :-(
    Are there any possibilities in XSU to get the needed XML code? Or do I have to do some post-production via XSQL???
    Another question: Is it possible to use specific keywords like "online" as XML tagnames, via objects? The objects don't allow "online" as a field name...
    Thanks in advance,
    Holger

    I need to generate a XML structure with attributes in the opening tag, and just one value in the body, like this:
    <PRODUCT-LIST-PRICE NET-PRICE="0" CURRENCY="USD">9.99</PRODUCT-LIST-PRICE>
    Without an object type, I can just create tags like this
    XML3
    <PRODUCT-LIST-PRICE>9.99</PRODUCT-LIST-PRICE>
    (with no attributes, but a single value) via the followig statement
    SELECT sys_xmlgen ('9.99',
    sys.xmlgenformattype.createFormat('PRODUCT-LIST-PRICE')
    ).getClobVal() "XML3"
    FROM DUAL;
    Having an object "productlisteprice_type", defined by
    CREATE OR REPLACE TYPE productlisteprice_type AS OBJECT
    "@NET-PRICE" VARCHAR2(10),
    "@CURRENCY" VARCHAR2(10),
    "PRICE" VARCHAR2(20)
    I just get XML like this
    XML2
    <PRODUCT-LIST-PRICE NET-PRICE="0" CURRENCY="USD">
    <PRICE>9.99</PRICE>
    </PRODUCT-LIST-PRICE>
    (with attributes, but no direct value beneath the "PRODUCT-LIST-PRICE" tag) via the following statement
    SELECT sys_xmlgen ( productlisteprice_type(0,'USD','9.99'),
    sys.xmlgenformattype.createFormat('PRODUCT-LIST-PRICE')
    ).getClobVal() "XML2"
    FROM DUAL;
    Not what I need :-(
    Are there any possibilities in XSU to get the needed XML code? Or do I have to do some post-production via XSQL???
    Another question: Is it possible to use specific keywords like "online" as XML tagnames, via objects? The objects don't allow "online" as a field name...
    Thanks in advance,
    Holger

  • Users Are Not Removed From Old Position Via Structural Auth

    Hello...
    Has anyone experienced an issue where someone move from one position into a new one, the old reporting manager can still see this person information via structural auth?  There's a general structural profile with the evaluation path o-s-p and function module RH_GET_ORG_ASSIGNMENT which is assigned to all accounts in the system.  This profile works as intended when Person A moves to a different position reporting to Manager B.  Manager B can view Person A information (time, personal, etc.); however, the system does not remove Person A from Manager A.  In addition, the RHPROFL0 is scheduled twice a day.
    Thanks for any insights or thoughts on this issue.

    Hmm...
    Which release and SP are you on?
    Also check the depth of the profile (just in case the employees were demoted...) and the period (although you mention that it should be current only).
    I have only been involved is custom implementations of "structural authorizations" because the standard is quite tricky and complex to find an error or inconsistency - so hopefully one of the other gurus who are more familiar with it can help as well.
    Cheers,
    Julius

  • Deleted message not removed from iPhone Inbox

    Since updating my iPhone 3G to 4.01 I have found that when I delete messages from the inbox the messages are not completely removed from the inbox. I am left with a blank unread message. The only way I can completely delete is to turn the phone off and restart. Is anybody else having this problem? I have also found that I lose service in places I have been able to use the phone.

    theguz4l wrote:
    bump ... any response RIM?
    While VF provided a reply above, such is never expected here...refer to this information posted at the top of every page on this site:
    Also, given VFs reply above, you might want to contact your carrier for formal support.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Previously deleted messages are re-downloaded, not removed from server??

    I have a POP email account that I access from my iMac using Mail. I regularly delete mail from my inbox in Mail, so there are only a few hundred messages in the inbox. But the other day I logged onto my mail account via the web and discovered thousands of my previously deleted messages still in my inbox on the server. I opened Mail Preferences and discovered that the checkbox "Remove mail from Server ... when I move it from my inbox" was not checked, so I checked that box. However, I figured that would only cause future messages that are removed form my inbox to be removed from the server, but would not do anything about the thousands of previously deleted messages that were still on the server. So I also clicked the button labeled "Remove Now". I figured that would cause Mail to tell the server to remove all the old messages on the server that had previously been removed from the local Mail inbox.
    The next day I discovered that thousands of old messages I had already deleted (many of them long ago) had mysteriously reappeared in my Mail inbox. And of course, checking the account via the web, I discovered they were still on the server too. What did I do wrong? I thought Mail would tell the server to delete all those old messages. Instead it seems to have told the server to download them all to my Mail inbox again, the exact opposite of what I intended. I don't know if this is a disconnect between the Mac Mail client and the mail server, or if I misunderstood the purpose of these options in the Mail preferences dialog.

    Hello,
    I have never tried this exact action, but I think the Remove Now will not do much, with When Moved from the Inbox. This would require the action of removing the message, after this setting has been changed. I don't think it would remove any previously moved from the Inbox, because no check to correlate the current contents of Inbox to a POP account.
    Does this make sense, to you?
    However, there would appear to be some corruption in the file to prevent duplicate downloads, or messages previously downloaded.
    In Mail 2.x, Apple introduced a way to look a the server, of even POP accounts. To do this, control-click on any inbox or any mailbox, and choose Get Info. Once the dialogue window is presented, and if you have more than one account, choose the account, and you can not observe the server contents, but also choose and delete individual messages.
    Keep us posted about future behavior.
    Ernie

Maybe you are looking for