Cannot replace an Element with an Text using JDom?

Hello, guys:
I am trying to replace an element inside a document with a Text element using JDom:
List formChildren = formElement.getChildren();
int idx = formChildren.indexOf(tableElement);
formChildren.add(idx + 1, new Text("sample text"));
formChildren.remove(idx);
I got the following error:
org.jdom.IllegalAddException: Filter won't allow the org.jdom.Text '[Text: sample text]' to be added to the list
But I can replace it with another element. I am wondering if JDom can do this kind of stuff?
regards,

Hi
perhaps you can find something here :
http://javaalmanac.com/egs/org.w3c.dom/pkg.html

Similar Messages

  • TS2755 Does anyone know why: when using Messages on my iPad, a cannot send a message with only text on it? Strange though, I can send a message with text AND a photo??

    Does anyone know why, when using Messages on my iPad, a cannot send a message with only text on it? Strange though, I can send a message with text AND a photo??

    Hi Cass,
    If you are having issues with Messages on your iPad, you may find the following article helpful:
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Regards,
    - Brenden

  • Problem using text element with type TEXT INCLUDE in smartforms

    Hi,
    I am working on smartform.
    My requirement is to print the text which can range from 1 to 99 (free text). I am using TDNAME, TDOBJECT and TDID from STXH table and putting it in the fields Text Name, Text Object and Text ID of text element created with type "TEXT INCLUDE" in window in smartform.
    It works Fine only when I put exact value of TDNAME in Text Name field.
    But in my case TDNAME can vary according to value of AENNR from Table AENR.
    So I am trying to use a variable called W_TDNAME and pass TDNAME value to it. I am putting this W_TDNAME in the field TEXT NAME. And it says "Inlcude text W_TDNAME does not exist".
    HELP ME OUT.
    ANSWERS WILL BE AWARDED..
    Tushar

    Hi Tushar,
    When you see in Text name field, there is a small button at the end of that field. This is to switch the dynamic field value option on. Click that and use the format &field_name& to enter your variable in that field.
    Deepak Charanyan

  • How replace XML Elements with java

    I have been usint SAX 2.0 and DOM Level 2 api's to represent XML documents, which i parse with apache's Xerces parser... I am trying to delete certain elements and replace them with others, but none of the api's allow this the closes i have come is replacing attributes of elements....

    -jverd
    You might also want to look into jdom or dom4j.Thanks jdom worked for replaceing the elements and attributes...but when i tried to store the changes in a new file, the text nodes were processed. for e.g. if i had &#8217 the char ( ' ) appeared in the new file. how do i keep the unicode...

  • [Mail] Replacing a signature with a text in the plain text alternative..?

    Hi all.
    I just created a signature for Mail. All is good, I created it in HTML and adapted it accordingly. The issue is, I have my name on it in a sort of logotype so I'm not typing my name explicitly in any email. Now, if the application settings of the other party is set to display emails in plain text format, the plain text alternative of the email will naturally omit the signature thus my name.
    Is there any chance I can make it replace the signature with my name for the plain text version? I tried using the 'alt' attribute in the 'object', 'div' and 'img' tags, CDATA and some other tricks but no luck yet. Hope someone has an experience in this subject that has resulted in success...
    Thanks in advance.

    If you open a HTML document in a text editor (not TextEdit), you will see stuff like:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>Untitled</title>
    <meta name="generator" content="BBEdit 6.5.3" />
    </head>
    <body>
    </body>
    </html>
    The part that you need to keep is just the anchor tag:
    It depends on how the document is saved, so if an application includes the headers (you can't really tell by just looking at the rendered document), you need to manually remove them. I use BBEdit to create a HTML file with just the anchor tag, so I don't have to worry about what an application is going to copy it as.

  • Upload Material master with long text using LSMW

    Hello,
    i want ot upload material master data via MM01 using LSMW in following views: basic data 1 ,2,  purchasing, purchase order text, plant data 1,2.
    i have to upload long text in purchase order text with length more then 132 char. (approx 700 char long text). and i have text file in which long text is maintained in a single row. then how can i do it without formating text file or anyother possible solution.
    please help.

    ca u clarify how can i do it.
    suppos i have longtext   "Air cooled type air-conditioning unit complete with following components & distance between indoor & outdoor unit is  10 RMT.  A).Indoor evaporating unit comprising of cooling coils,insulated drain tray,20 micron HDPE washable filters,blower,motor,electical junction box etc. B).Outdoor condensing unit comprising of hermatic/semiharmetic compressor's.condenser coils,propeller/axial fans,motors,pressure switches/cutout etc.C).Charging of refrigerant gas & oil.D).Inter connecting refrigerating piping  of copper duly insulated with EXPANDED POLYETHYLENE tubing.E).Complete electical power wiring of AL.&Control wirng of copper required from indoor & outdoor units.Earthing of the complete system with 8 G G.I.wire.  F).Electrical panel will be completed with necessary starter,fuses,switches,timers,over-load relays,contactors,push button and indicating lamps,single phasing preventer etc..and also with remote control with cording. G).The panel should have 1 no.potential free contactor to connect with central fire detection system.The panel should have voltage scanner to ensure stabilized power input to the machine.H).Outdoor unit shall be mounted on MS angle base frame structure duly black painted with synthetic epoxy paint.I).The frame structure shall be mounted on MS plate & serrated rubber pads."
    then what i have to do changes in lsmw.?

  • How to replace namespace tag with new value using -JAVA MAPPING

    Hi Guys,
    I need to replace namespace Tag in Target xml with a new value.
    For Eg: My namespace Tag is - <ns0:TestHeader xmlns:ns0="http://0020.TestHeader.SS.com">
    I want My target xml to have value- <ns0:TestHeader>
    How can i achieve it using JAVA mapping?
    Can you provide me the code to do so.

    Sarjana,
    Not well-formed XML is only possible by Java Mapping. Please use below replace logic in Java map.
    inputContent.replaceAll("<ns0:TestHeader xmlns:ns0=\"http://0020.TestHeader.SS.com\">", "<ns0:TestHeader>");
    Link1, Link2.

  • Send E-mail with Body (text) using the FM CONVERT_COMM_TYPE_DATA

    Hi Experts,
    I am using the FMs ADDR_GET_NEXT_COMM_TYPE and CONVERT_COMM_TYPE_DATA to send my sapscript (ZMEDRUCK) as an e-mail. My requirement is to change the body of the e-mail but i cannot find any parameter in this FM where i can add or edit body of the e-mail.
    Can someone please help me?.
    Thanks and Regards.

    Hi Shihin11
    The variable "document", what type is defined?
    This is the my source code:
    CASE nast-nacha.
    WHEN '5'.
          xdevice = 'MAIL'.
          xdialog = space.
          CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
            EXPORTING
              strategy           = c_cstrategy
              address_number     = lfa1-adrnr
            IMPORTING
              comm_type          = lvs_comm_type
              comm_values        = lvs_comm_values
            EXCEPTIONS
              address_not_exist  = 1
              person_not_exist   = 2
              no_comm_type_found = 3
              internal_error     = 4
              parameter_error    = 5
              OTHERS             = 6.
          IF sy-subrc = 0.
            MOVE-CORRESPONDING nast TO w_snast.
            CLEAR w_smtp_addr.
            w_smtp_addr = lvs_comm_values-adsmtp-smtp_addr.
            CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
              EXPORTING
                pi_comm_type              = lvs_comm_type
                pi_comm_values            = lvs_comm_values
                pi_country                = nast-tland
                pi_repid                  = sy-repid
                pi_snast                  = w_snast
              IMPORTING
                pe_itcpo                  = lvs_itcpo
                pe_mail_recipient         = w_mail_recipient
                pe_mail_sender            = w_mail_sender
              EXCEPTIONS
                comm_type_not_supported   = 1
                recipient_creation_failed = 2
                sender_creation_failed    = 3
                OTHERS                    = 4.
            IF sy-subrc = 0.
            ENDIF.
          ENDIF.
          WHEN OTHERS.
          xdevice = 'PRINTER'.
          IF nast-ldest EQ space.
            xdialog = 'X'.
          ELSE.
            itcpo-tddest   = nast-ldest.
          ENDIF.
      ENDCASE.
    IF xscreen NE space.
        itcpo-tdpreview = 'X'.
      ENDIF.
    Bei Probedruck, wenn das Medium keine Drucker ist.
      IF nast-sndex EQ 'X' AND nast-nacha NE '1'.
        xdevice = 'PRINTER'.
        IF nast-ldest EQ space.
          xdialog = 'X'.
        ELSE.
          itcpo-tddest   = nast-ldest.
        ENDIF.
      ENDIF.
    itcpo-tdnoprint  = 'X'.
      itcpo-tdcover    = nast-tdocover.
      itcpo-tdcopies   = nast-anzal.
    IF sy-ucomm EQ 'DRPR' OR
         nast-sndex EQ 'X'.
        itcpo-tdnoprint  = ' '.
        itcpo-tdnoprev   = 'X'.
        itcpo-tdcopies = 1.
      ENDIF.
    *}   REPLACE
      itcpo-tddataset  = nast-dsnam.
      itcpo-tdsuffix1  = nast-dsuf1.
      itcpo-tdsuffix2  = nast-dsuf2.
      itcpo-tdimmed    = nast-dimme.
      itcpo-tddelete   = nast-delet.
      itcpo-tdsenddate = nast-vsdat.
      itcpo-tdsendtime = nast-vsura.
      itcpo-tdprogram  = sy-repid.
    *{   INSERT         PROK900574                                        8
      itcpo-tdnewid    = 'X'.
    *}   INSERT
    CALL FUNCTION 'OPEN_FORM'
           EXPORTING
                     form = xformular
                     language = ekko-spras
                     OPTIONS = itcpo
                     archive_index  = toa_dara
                     archive_params = arc_params
                 ARCHIVE_PARAMS = ALARC_PAR1
                     device = xdevice
                     dialog = xdialog
    *{   INSERT         PROK900574                                        3
                     mail_sender    = w_mail_sender
                     mail_recipient = w_mail_recipient
    *}   INSERT
           EXCEPTIONS
             canceled = 01.
      IF sy-subrc NE 0.
    *{   REPLACE        PROK900574                                        9
    *\    PERFORM PROTOCOL_UPDATE USING '142' EKKO-EBELN SPACE SPACE SPACE.
    *\    RETCO = SY-SUBRC.
        retco = sy-subrc.
        PERFORM protocol_update USING '142' ekko-ebeln space space space.
    *}   REPLACE
        EXIT.
      ENDIF.
    Thanks

  • Cannot pair my IPhone with iPad 3 using Bluetooth

    I bought a wireless music system and my iPhone 5 is pairing with it using Bluetooth but my iPad 3 is not. They are also not pairing with each other. What I am doing wrong

    You can't. It can only be done through iTunes.

  • CANNOT connect on Facetime with my iPad2 using 3g on AT&T

    I got my mom an iPad 2 with 3G from AT&T for the explicit reason that I would be able to Facetime with her.  So far I have not been able to connect with her using Facetime.  Do I need to get an iPad3?  What is the problem?
    Alan

    Facetime doesn't work on an iPad 2 3G; only using wifi. You need a newer iPad.
    iOS 6: Which software features does my iPhone, iPad, or iPod touch support?
    http://support.apple.com/kb/HT5457
     Cheers, Tom
    Message was edited by: Texas Mac Man

  • Help with Oracle text using CTX_DOC.SNIPPET

    I used to find the code as follows:
         SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE
                                       ,(SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_MOTA_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
                                        (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_NOIDUNG_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
                                        (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_TTHC1_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
                                        (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_TTHC2_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
                                        (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_TTHC3_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
                                        (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_TTHC4_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' MOTA
                                        FROM SEARCH_DNICT
                                        WHERE (CONTAINS(SEARCH_DNICT.TIEUDE,:tukhoa,1)>0
                                        OR CONTAINS(SEARCH_DNICT.MOTA,:tukhoa,2)>0
                                        OR CONTAINS(SEARCH_DNICT.NOIDUNG,:tukhoa,3)>0
                                        OR CONTAINS(SEARCH_DNICT.TTHC1,:tukhoa,4)>0
                                        OR CONTAINS(SEARCH_DNICT.TTHC2,:tukhoa,5)>0
                                        OR CONTAINS(SEARCH_DNICT.TTHC3,:tukhoa,6)>0
                                        OR CONTAINS(SEARCH_DNICT.TTHC4,:tukhoa,7)>0)- when I following query return 50 documents it takes 10.969 seconds load just for one use. Now my database is not only very little data
    - I find if such search is too slow, I have studied but have not found a way to accelerate your returns faster results like?
    - I want to improve performance query is how?
    - I hope people will help me solve
    Thanks every body!

    Hi,
    what is the plan for this query? I think it is maybe a full scan on the table and it uses not even the indexes. Is it possible to rewrite the query to use union?
    SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE ,
    (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_MOTA_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
    (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_NOIDUNG_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
    (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_TTHC1_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
    (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_TTHC2_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
    (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_TTHC3_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' ||
    (SELECT CTX_DOC.SNIPPET('SEARCH_DNICT_TTHC4_IDX',ROWIDS,:tukhoa) FROM DUAL) || '..' MOTA
    FROM
      SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE
      FROM SEARCH_DNICT
      WHERE CONTAINS(SEARCH_DNICT.TIEUDE,:tukhoa,1)>0
      UNION
      SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE
      FROM SEARCH_DNICT
      WHERE CONTAINS(SEARCH_DNICT.MOTA,:tukhoa,2)>0
      UNION
      SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE
      FROM SEARCH_DNICT
      WHERE CONTAINS(SEARCH_DNICT.NOIDUNG,:tukhoa,3)>0
      UNION
      SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE
      FROM SEARCH_DNICT
      WHERE CONTAINS(SEARCH_DNICT.TTHC1,:tukhoa,4)>0
      UNION
      SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE
      FROM SEARCH_DNICT
      WHERE CONTAINS(SEARCH_DNICT.TTHC2,:tukhoa,5)>0
      UNION
      SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE
      FROM SEARCH_DNICT
      WHERE CONTAINS(SEARCH_DNICT.TTHC3,:tukhoa,6)>0
      UNION
      SELECT ROWIDS,ID,NGAYTAO,NGAYXUATBAN,CHUYENMUC,FULLPATH,NGONNGU,NOIDUNG,TIEUDE
      FROM SEARCH_DNICT
      WHERE CONTAINS(SEARCH_DNICT.TTHC4,:tukhoa,7)>0
    ) If above doesn't help, then maybe a combined index on the fields will help. Examples are given in this forum if you search for multi colum index.
    Herald ten Dam
    http://htendam.wordpress.com

  • How can I view captivate files emailed with translated text?

    I cannot open captivate files with translated text. System states the file is not damaged. If file was an attachment make sure it was decoded correctly.

    I think I was encountering the same issue.
    I solved it installing Itunes 10.5.1(42), even if I'm not using Itunes at all.
    Albumarts will now appear in every folder from the finder.
    I closed my topic because I solved it :
    https://discussions.apple.com/message/16640910
    Is it the same for you ?

  • Table for text elements and selection texts

    Hi All,
    In which DB table does SAP stores program name and corresponding text-elements and selection texts used in that program.
    There is a table D010TINF which just stores basic information but not the text elements number and name.
    Thanks in advance.
    Regards,
    Atish

    hi,
    table name - RS38M (take se11 and give this, u can confirm)
    field name  - STEXTT
    rgds
    anver
    if hlped pls rwrd points

  • Create XML element without closing tag using Visual C++

    I know how to create xml element with closing tag (using WriteStartElement and WriteEndElement methods)
    <tag id="1234">
    </tag>
    but is there a way in Visual C++ to produce xml element like this
    <tag id="1234"/>
    i.e. without closing tag?

    Hi adamay,
    Please refer to this thread.
    http://stackoverflow.com/questions/8182245/create-xml-element-without-closing-tag-using-xslt
    I think you could try the way of write your own class derived from XmlWriter.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I cannot synchronize my contacts with my Blackberry with iCloud

    Since the move from Mobileme to Icloud I cannot synchronize my contacts with my Blackberry using desktop software from Rim. Has anyone an idea on how to do it ?

    With the move to iCloud your contacts live on the iCloud server - you will see them listed under 'iCloud' rather than 'On My Mac'.
    Blackberry cannot access the iCloud server: it can only sync with contacts held under 'On My Mac'. Therefore you have two options: leave things as they are and sync with iCloud but not Blackberry: or move your contacts back to 'On My Mac' and sync with Blackberry not iCloud.
    (Or I suppose you could maintain the contacts list on both, giving your duplicates on your Mac, and any changed or additions would have to be entered twice).
    To move your contacts, select them all, then from the File Menu choose Export>vCard. Set the default contacts list to 'On My Mac' in Preferences and import the vCard. You can then delete the iCloud contacts list (or just turn off iCloud syncing for contacts).
    A similar situation applies with calendars.

Maybe you are looking for

  • Re : maex table

    hai         any body tell me what is the purpose of maex table(legal control). what are the things we have to up load. thank you regards geetha

  • Macbook pro 15" display flicker/glitch

    i got a macbook pro retina last month which has recently started to have some display issues. recently this glitch/flicker has become permanent.  approx 5cm wide and runs down the length of my screen are colored lines. i have attached a picture i too

  • Loading of CLOB data in Oracle 10g 10.2.0.1 on linux 32 bit

    I am trying to load data (including clob field) in Table by using SQL loader, i got csv file and i am doing it by using control file Following are the contents of control file LOAD DATA APPEND INTO TABLE schema.c1 FIELDS TERMINATED BY ',' OPTIONALLY

  • DHCP server lease duration reporting

    I have a network team that controls their own scopes however we are responsible for the DHCP services and DNS. (i know it's a nightmare) Anyways, they go in and create new scopes all the time and they are always different with lease durations and oth

  • Can't close pop up ad in Words with Friends

    IWhile playing Words With Friends got a pop up ad for Verizon that will not close and can't continue playing. Clicking on top right hand close X does not work