How to delete xml content without deleting the content of the object?

Hey, with the following code I am marking up a page item and deleting it's xml content:
text_value = text_area.xmlElements.add('text', current)
text_value.contents = '';
current is the current app.selection. The code works, with one downside: It also deletes the content of my text frame in my document. I only want to delete the xml content. Is this somehow possible?
Thanks in advance!!
Regards
Fred

Dear Fred,
Please use the below Code, this will helps you to achieve your target.
//============================== Script Starts ============================================//
var doc = app.documents[0];
//========================================================================//
/* Use Glue Code */
//==================================================================//
__RemoveXMLElments(doc);
function __RemoveXMLElments(doc)
      var elementXpath = "//text";
        var myRuleSet = new Array (new __RemoveXMLElments_XPath(elementXpath));
      with(doc){
        var elements = xmlElements;
        __processRuleSet(elements.item(0), myRuleSet);
function __RemoveXMLElments_XPath (Txts)
        this.name = "RemoveTexts";
        this.xpath = Txts;  
        this.apply = function(myElement, myRuleProcessor){
            with(myElement){
                try{  
                        var myCnts = myElement.texts.everyItem();
                        myCnts.remove();
                  }catch(e)
//============================== Script End============================================//
Thanks & Regards
T.R.Harihara SudhaN

Similar Messages

  • HT1473 I have two separate iTunes libraries on different computers and I would like to compact into one. But I cannot without completely erasing one of the libraries. How can I do this without deleting anything?

    I have two separate iTunes libraries on different computers and I would like to compact into one. But I cannot without completely erasing one of the libraries. How can I do this without deleting anything?

    Copy the content from one computer to another and import the media into iTunes.
    Any playlists, playcounts, etc on the computer the content is being moved from will be lost.

  • I have two apple accounts on one computer. How do i delete one account without deleting the other?

    I have two questions!!   
    I need to know how to delete one account without deleting the other account on the computer?
    I am deleting the account because i have a new laptop that now has the my account... will deleting the account on one computer affect the account on the other laptop?

    What do you mean by deleting the account? One can't delete an Apple ID/iTunes account. One just stops using it.
    Since yo can only have five computer authorized for one iTunes account you might want to deauthorize the computer for that account
    iTunes Store: About authorization and deauthorization

  • How do you import photos without deleting photos off the memory card?

    How do you import photos without deleting photos off the memory card?

    If you're using Image Capture, Aperture or iPhoto just say 'No' when it asks if you want them deleted.

  • I saw a post on how to load iMovie 6 without deleting iMovie 9 or iLife 11 I can't find the post now does anyone know if this is possible. I do not want risk not being able to reload iMovie 9 it appears that I would have to reload the whole  iLife suit

    I saw a post on how to load iMovie 6 without deleting iMovie 9 or iLife 11 I can't find the post now does anyone know if this is possible. I do not want risk not being able to reload iMovie 9 it appears that I would have to reload the whole  iLife suit

    Could have been mine!
    Happily this is easily achieved, but it has to be done backwards.
    Delete iMovie 9 (just drag it to the trash). Now install iMovie 6 from the iLife 6 install disks.
    Now re-install iMovie 9. This automatically moves iMovie 6 into a folder it creates in your Applications folder called iMovie Previous Version.
    Now you have them both, and you can have both in the Dock as well.
    Alternatively you could try this method, suggested by poster Uitech:
    Open a terminal and type "touch /Library/Preferences/com.apple.iLife08.plist"
    (No quotes)
    Install iMovieHD6 from the iLife 6 install disk.
    This works with both Leopard and Snow Leopard Macs.

  • I have an old macbook which i want to give away.  i want to delete all my contacts etc.  how do i do that without deleting on my new macbook and iPad?

    I have an old macbook that i want to give away.  i want to delete my information such as contacts mail etc.  how can i do that without deleting it from my new macbook pro or my ipad?

    Go to System Preferences > iCloud and turn iCloud off.
    Restart holding the Command and R keys and then choose to reinstall Mac OS X.  If you have applicaitons on the machine that should not be transfered to another party, after the restart choose Disk Utility and erase the hard drive and then install Mac OS X...that will return the machine to factory condition.

  • How to backspace through text without deleting letters?

    Hi,
    Am trying to remove a small piece of text from the middle of a long URL and cannot figure out how to backspace without deleting anything. Have tried to touch where I want deletion point to begin but iPad keeps jumping to the end of the string, then I can't get back to the beginning. Seems like you would be able to scroll backwards or use something similar to the "black X" on the keyboard but without deleting!! Help! This has been driving me nuts.

    Thanks, using "tap and hold" then magnifying glass works okay but seems so inefficient and fussy. Would be great of you could toggle between -backspace and delete- and - backspace without deleting- using the Backspace key.
    Is there a way to control the speed with which the -backspace and delete- jumps from deleting single letters to deleting blocks of letters?
    Thanks
    Chaboo

  • How to delete a page without deleting more than one

    how to delete a page without deleting more than one in pages

    Hi alldogsgotoheaven,
    Method 1.
    Menu > View > Show Thumbnails
    Click on a thumbnail.
    If it shows a yellow border around all the pages, they a part on a single section.
    Click in your document at the beginning of the page you want to delete, and Menu > Insert > Section Break.
    Insert another Section Break at the end of that page.
    The page is now isolated in its own section and you can delete its thumbnail.
    Regards,
    Ian.

  • I would like to edit my PDF file how can i do that without deleting it

    i would like to edit my PDF file, how do i do that without deleting it ???

    Hi Didds,
    Through Acrobat you can edit your PDF file.
    Kindly refer this link:PDF editor, edit text in PDF files | Adobe Acrobat XI
    Regards,
    Florence

  • Deleting Raw Files without deleting proxy files

    Hello,
    Another newbie question, is Deleting Raw Files without deleting proxy files possible? If it is, anyone have done this? I am thinking of implementing this but cannot find a way. Any suggestion / help is highly appreciated

    If what you want to do is delete the original file without deleting the proxies, the easiest way would be to set up an device for Archives. Then you can archive the asset, which will move the original file to the archive location without deleting the proxy and database records for that Asset. Once that is done you can just delete the file from the archive location.

  • How to open a URL without session ID and reuse the current browser session?

    Hi All,
    I have a question about HTMLDB 2.0
    How to open a URL without session ID and reuse the current browser session?
    That was the behaviour in HTMLDB 1.6 ...
    My usecase for this is the following:
    We have written an issue tracking application, which sends e-mail to the interested users, when something happens.
    In these email we've put a link to some page, with some parameters in the URL.
    The idea is for the user to be easy to click on the hyperlink and to see the details of the ticket.
    When the user clicks on such a link he is directed to a login screen (page 101) and he enters his Username and password, and is then forwarded to the details for the ticket.
    Then he receives another email (e.g. for another ticked). He clicks on the link and :
    a) in HTMLDB 1.6 he goes to the details as he didn't close his browser and session is remembered
    b) in HTMLDB 2.0 he is prompted to enter username, password with the username populated
    Please tell me how can I achieve the same behaviour in HTMLDB2.0 as it was in HTMLDB 1.6.
    I understand this change is somehow security related, althogh I don't understand how. If you can explain this either I would be very happy?
    Best regards,
    Mihail Daskalov

    Mihail - I detailed a couple of approaches here: Re: Application Link
    Scott

  • I have lost sound on my iPad in apps unless I use headphones ,does anyone know how to get sound back without them .I have used the mute volume on the bar at bottom of screen and the slider volume control there only shows when headphones are plugged in !

    I have lost sound on my iPad in apps unless I use headphones ,does anyone know how to get sound back without them .I have used the mute volume on the bar at bottom of screen and the slider volume control there only shows when headphones are plugged in !
    I also tried resetting settings all to no avail ...I looked up some advice and watched utube video advice on how to fix without success..
    The volume control button on side does not work ,I got the iPad last August and wonder if it is a fault that means I must return it for replacement from where it was purchased ?

    The Retrospect you used way back when is no longer around. The company was sold and that company produced a new version of Retrospect - Retrospect 8.x
    So, as you've been told, you would have to be running a Tiger system with an old version of Retrospect software (5.x or 6.x - you would need to know) assuming you can find the software.
    As best I can remember you cannot extract files from a Retrospect backup except using the software since Retrospect did not normally make a file by file backup rather it created an archive of the files in the backup. I'm assuming that the EMC/Retrospect people have told you that old Retrospect backups are not accessible by Retrospect 8.x?

  • I have a free app on my iphone, i would like to get it to my ipad..how do I get it without having to start over the entire game?

    I have a free app on my iphone, i would like to get it to my ipad..how do I get it without having to start over the entire game?

    If you use the same Apple ID on both devices, you can share apps, but you won't share the progress I'm afraid.

  • How to install PS CS5 without cd? I have the key but  my cd is not opening.

    How to install PS CS5 without cd? I have the key but  my cd is not opening.

    Download it from Adobe.con to you hard disk and install from you hard disk. Download CS5 products
    Once installed remember to download and install the CS5 updates Product updates

  • When I try to quit firefox, it hangs. I cannot force quit and I cannot restart. I tried the online help which directed me to uninstall, but I couldn't find library /application support. How can I fix this without having to turn off the computer?.

    I cannot force quit and I cannot restart. I tried the online help which directed me to uninstall, but I couldn't find library /application support. How can I fix this without having to turn off the computer?.

    Not sure if this Term is Relevant towards an iPhone but, my iPhone won't Post unless if it's plugged into a Charger.

Maybe you are looking for