Search for, edit, and delete XML tag (Adobe InDesign Server CS5)

Hi all,
I'm working with Indesign Server CS5 and JavaScript, though having some trouble coming up with a solution to a problem...
I need to build a JS script (called through SOAP) that will enable me to search an InDesign file for a given XML tag.
Upon finding the XML tag, if the 'action' variable is set to delete, it should delete the tag and its contents.
If the action is set to edit, it should change the contents of the tag to some user-specified content.
The primary caveat is that the XML tag is variable, as is the XML structure of the InDesign file.
Here's what I have in mind, in pseudocode:
function findXMLTag(tag, action) {
     app.searchForTag(tag);
     if (tagIsFound) {
          if (action == "delete") {
               tag.delete;
          } else if (action == "edit") {
               tag.contents = "Updated content";
Any help would be greatly appreciated!
Thanks,
Ben Kay

'searchForTag' can be implemented as a recursive function.
Recursion is defined like this: I thought, "I'll just search this forum for 'recursion'." The first post I found was one of my own, suggesting that the poster should search the forum for 'recursion'.
Here is an example: find the XML Element [<email>]
And another: Remove xml element using JS[CS3] (read carefully, as the OP got stuck on how to successfully remove an element and continue)
And one, using XML Rules -- which I'm totally unfamiliar with, but may work for you: Changing Values in XML tags

Similar Messages

  • Windows Server 2003 R2 Enterprise Edition 32 bits Service Pack 2 never finishes searching for updates and use 100% of CPU.

    Hi everyone, I am having issues updating a clean Windows Server 2003 R2 Enterprise Edition 32 bits Service Pack 2, so any help with be appreciated cause I've already tried all my cards for the past 5 days in this particular issue without success.
    All I did so far is installing Windows Server 2003 R2 Enterprise with Service Pack 2, open IE to update, it keeps searching for updates and never stop, after 20mn to 30mn the process svchost.exe start using 100% of my CPU.
    I already tried the following scenarios:
    1-  Install IE8, install the update KB927891 and the Windows Update Agent 3.0 (I already had this one installed). Reboot and run windows update trough IE8 and the problem did not solved.
    2- Install those 2 software "MicrosoftFixit.wu.MATSKB.Run" and "MicrosoftFixit50777", open IE to update, it still hangs and continues eating my CPU. This is the output of "MicrosoftFixit".
    Windows Update error 0x8007000D(2014-01-06-T-06_06_34A) --> Not Fixed
    Cryptographic service components are not registered (This service is actually running successfully) --> Not Fixed
    3- I found the following script that would register some DLL, deleting the "SoftwareDistribution" and forcing windows update to solve the problem and nothing happened either.
    Link to script:
    http://gallery.technet.microsoft.com/scriptcenter/Dos-Command-Line-Batch-to-fb07b159#content
    Here is a link to the content of my WindowUpdate.log file:
    https://skydrive.live.com/redir?resid=883EE9BE85F9632B%21105
    Thank you in advance for helping.

    All I did so far is installing Windows Server 2003 R2 Enterprise with Service Pack 2, open IE to update, it keeps searching for updates and never stop, after 20mn to 30mn the process svchost.exe start using 100% of my CPU.
    Herein is the root cause of your issue. A topic that's been discussed in several blogs, forums, and even in the media since September regards a known issue with attempting to patch IE6 RTM via Windows Update.
    Aside from that particular issue... browsing the Internet with an unpatched instance of IE6, especially from a Windows Server system, is also asking for a world of hurt.
    Might I suggest the following:
    Download the IE8 for Windows Server 2003 installer to a thumb drive.
    Download the latest Cumulative Security Update for IE8 for Windows Server 2003 to a thumb drive.
    Reinstall Windows Server 2003 with Service Pack 2.
    Upgrade to IE8 from the thumb drive installer and apply the
    Cumulative Security Update.
    Now your machine is capable of safely browsing to Windows Update to install the rest of the updates (well, maybe, there's also all those other Security Updates from the past seven years that your machine still has vulnerabilites for -- even those seven
    years of updates are going to take a Very Long Time to scan for, download, and install).
    Why don't you have a WSUS server? -- noting, wryly, that you've posted in the *WSUS* forum.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • Search file for text and delete the found text.  How?

    I need to know how to search a file for text and delete the found text. I think grep will let you do this but not sure of the syntax.

    Hi Dmcrory,
       In addition to what Camelot and nobody loopback point out, one must also consider the fact that UNIX text tools are largely line based. You also fail to tell us for what kind of text you are searching. If you are looking for multiple words, there's a very good chance of finding the expression wrapped onto different lines. With hyphenation, even single words can wrap to multiple lines. Tools that search line-by-line will miss these unless you use multiline techniques.
       Multiline substitutions require that you write "read-ahead" code for the command line tool that you're using and that you take that into account in the substitution. Given how you want the results to be printed out, you may also want to preserve any newlines found in the match, which is even more difficult. That could bring up the subject of line endings but that's a completely different topic.
       I apologize if this sounds discouraging. Multiline searches aren't needed that often and in most of those cases, exceptions can be dealt with by hand. I just didn't want you to get surprised by it. To give you an idea of how easy basic substitution is, have a look at Tom Christiansen's Cultured Perl: One-liners 102 and One-liners 101. Both have some "in-place" substitution examples.
    Gary
    ~~~~
       MIT:
          The Georgia Tech of the North

  • Permission to upload to KM folder, but edit and delete only usrs own file

    Hi guys!
    I need to allow users to upload document to some KM folder, but they must be able only to edit and delete their own file. How to achieve this?
    If someone has write permission to KM folder, he can edit also other documents. I need to disallow this..
    Thanx for answer!
    Peter

    Hi,
    please have a look at this HowTo: https://service.sap.com/~sapidb/011000358700000560192006E/MultipleAuthors.zip
    Kind ragrds
    Karin

  • Music Player continuously searching for songs and ...

    I have a N97 running firmware v.21.0.045 and about a week or so ago I was forced to do the hard reset because the phone became so unstable. I left my E: drive (the mass storage) intact including all of my songs, videos and pictures I had stored.
    Everything seems to be okay apart from the Music Player which everytime I use it it starts to search for songs and podcasts continuously. I can stop that and it lists all of my music and can play them but the volume control does not work, either from the telephone or the earpiece supplied.
    I have tried leaving it searching for hours but nothing changes - it just keeps on searching. Any suggestions as to how I can fix this please or does it mean I have to do another reset of the telephone? It all worked before.
    I have tried taking the battery out but this makes no difference.

    This is the solution
    ok i found the solution here by deleting the corrupted library
    http://portablevideo.blogspot.com/2008/12/music-player-database-problems.html 
    now one of these below is for the music and one for the photos and i didnt have a problem with the photos but did it anyways and now the player can see my music:
    these are the files that need deleting in order to get rid of the corrupted library.
    Storage Drives: (Mass storage E, Memory Card F)
    \private\101ffca9\harvesterdbvx_x.dat
    \private\10281e17\[string]mpxvx_x.db
    \private\10281e17\[string]pcvx_x.db 
    TIP: Connect the device in USB mass storage mode (File Transfer), to locate the private folder from the PC.
    TIP: STRING and x_x will change depending on your phone. (my files had slightly different names than above on the n97
    Kudos to diginoise and Google, I've used it and it works, so have many others, as I've poted this a few times
    If I have helped at all, a click on the White Star is always appreciated :
    you can also help others by marking 'accept as solution' 

  • Can VMD_EI_API handle Create, Edit, and Delete Vendor Master records?

    Hi Everyone,
    I have a development that requires to create, edit, and delete vendor master records through a webportal ui. Technically, it will be a background process in SAP because it must not have a dialog screen. In my search so far, there is no standard BAPI or Function module that can handle this one.
    Can the class VMD_EI_API handle the requirements?
    Regards,
    John

    Hi,
    Yes, You can use this class to create/modify/delete vendor master data. You can find in SCN documents with example how use it.
    Jarek

  • Restrict users from editing and deleting not owned items

    Hello guys.
    I'm trying to restrict users from editing and deleting items created by other users. I know, that it can be achieved by using SPList.WriteSecurity parameter, but if I change its value to 2 or 4 - nothing happens... 
    May be there are some list permissions that can override this security setting? I tried to combine permissions in different ways but users either cannot modify any items or can edit/delete all of them... 
    By the way, setting ReadSecurity=2 works as it should work regardless of user permissions...
    Please help.

    Hi,
    I understand that you want to change the write security for the document library. You can try the PowerShell script below:
    $web = Get-SPWeb http://serverURL
    $list = $web.Lists["Document library"]
    $list.ReadSecurity = 2
    $list.WriteSecurity =2
    $list.Update()
    $web.Dispose()
    This setting will not affect the site collection administrator, he will always be able to edit the documents. You need to sue another account to have a test. If this still doesn't work, I think you need to manually edit the permission for each documents.
    Thanks,
    EnTan Ming
    Entan Ming
    TechNet Community Support

  • How to delete xml tags Urgent

    on release function i am inserting this value
    "(&-box*&", "&*box-&
    " in to my text box,
    in text box will display like this (squarebox), when i am
    trying to delete
    squarebox ,
    box deleting but
    (&-box*&", "&*box-&
    these xml elements are showing , what i have to
    do ? it has to delete,
    it amy have multipule box in my equation. how do delete xml
    elements in this case, this is my xml code. how to delete? any one
    can help me?

    Then you should provide more details on what you want this new script should do.
    To "delete XML tags in already tagged text", all you need is use the "untag" command on an XML Element. But how would the script "know" what XML Element should be untagged?
    Disclaimer: This reply is in no way enforceable, legally binding, a promise or contract, an agreement (written, verbal, or otherwise), a commitment, obligation, or free or paid-for offer of any kind to further help, guide, aid, tip, or not hinder you, or contribute to, correct, investigate, comment on or assist with any existing, forthcoming, or planned project.

  • How to delete XML Tags in already tagged text?

    Hi everyone,
    I looked in all the topics but with no results.
    Is there anyone that can help me with this script?
    Thanks
    Ivan

    Then you should provide more details on what you want this new script should do.
    To "delete XML tags in already tagged text", all you need is use the "untag" command on an XML Element. But how would the script "know" what XML Element should be untagged?
    Disclaimer: This reply is in no way enforceable, legally binding, a promise or contract, an agreement (written, verbal, or otherwise), a commitment, obligation, or free or paid-for offer of any kind to further help, guide, aid, tip, or not hinder you, or contribute to, correct, investigate, comment on or assist with any existing, forthcoming, or planned project.

  • After upgrading to OS 8.1.3 on iphone 5, suddenly all contacts have facetime and ring on both my ipad and iphone.  Went to Contacts and Facetime to Edit and delete, but no field to do so. How can I delete Facetime from all these contacts?

    After upgrading to OS 8 on my iphone 5, suddenly all my contacts had Facetime capabilities. I only want to FT with a few people Unwanted FT calls now ring on both my iphone and ipad. I tried to edit and delete FT capabilities in both Contacts and Facetime icon, but there is no field to delete for this. How do I delete Factime from my contacts list? thanks for any help with this.

    Hi Ingo 2711,
    Thank you for your suggestion.  I backup on itunes. I went to itunes, deleted syncing my contacts, then re-synced them. But the Facetime capability option continues to be there on most (not all, for some curious reason) of my contacts. I am not sure I posed my question correctly.  I want to be able to FT with my family, so don't want to delete the FT capability totally from my iphone and ipad. But I don't want all these other iphone calls from various contacts to ring on my ipad as FT calls.  I want a way to select with whom I have FT capabilities. Any further suggestions? Thanks much, trekpal

  • What's the best app for editing and viewing office doc's

    What is the best App for editing and viewing office doc's, that will be compatable with IPhone 5S and Air pad?

    Search the app store, find one that you like and that works for you.

  • Someone sent me a recurring calendar appointment to my IPhone 4.  I accepted it but now I would like to delete it since I am no longer attending.  The planner was sent from Outlook.  I cannot hit "edit" and "delete" on the IPhone.  How can I delete this?

    Someone sent me a recurring calendar appointment to my IPhone 4.  I accepted it but now I would like to delete it since I am no longer attending.  The planner was sent from Outlook.  I cannot hit "edit" and "delete" on the IPhone.  How can I delete this?

    Try reading this forum post for suggested solutions as a start.
    http://discussions.apple.com/message/7606191#7606191

  • Enable advanced tagging vs. Enable Accessibility and Reflow with tagged Adobe PDF

    Does anyone know the difference between these two settings in the PDFMaker preferences?
    Enable advanced tagging vs. Enable Accessibility and Reflow with tagged Adobe PDF
    I can't find any information that distinguishes these two mutually exclusive settings. I'm trying to decide which is best when creating a tagged PDF from MS Word. If anyone has a clue, I'd greatly appreciate it.

    "Enable Accessibility and Reflow with tagged Adobe PDF" (Turn this on)
    Enable this to create a tagged PDF. If this is disabled, the PDF will not be accessible. Tags tell a screen reader where headings, lists, and tables are.
    "Enable advanced tagging" (Turn this off)
    This looked promising, as it changed the name of tags to match Styles used in Word. For example, it changes "H1" to "Heading 1" and "P" to "Normal". Unfortunately, this feature is buggy. Test thoroughly. Using this feature, I've had plain paragraphs tagged as "Heading 2", even though the tag name itself remained mapped to "P" in Acrobat Role Mapping screen (so error in naming the tag). However, some headings were mapped to paragraph tags (error in logical tagging). I've also had table cells tagged according to the style of an element in another cell. In short, it's risky feature. Adobe says this feature is "Useful for Microsoft Word forms". I have not seen that and don't recommend you use this until it's fixed.
    As of: Word 2007. Acrobat Pro X.

  • I want to use my Time Capsule as a central 'hub/hard-drive' in order to keep all my working files in one place. I then plan to use my laptops/desktops as peripheral devices for editing and creation of these files. Is it possible? Create a personal cloud?

    I want to use my Time Capsule as a central 'hub/hard-drive' in order to keep all my working files in one place. I then plan to use my laptops/desktops as peripheral devices for editing and creation of these files. Is it possible? To create a personal cloud?
    Can someone advise as to whether i can do the following:
                                Future Internet connection -------------------TIME CAPSULE (containing all files) -------------- Backed up on the WD 2T Hard-drive I have
                                      (not connected yet)                                         I                                                          (*connected to timecapsule physically)
                                                                                                            I
                    I                                         I                                                I                                                              I                                                I
          Macbook Pro                             iMac                                       HP (PC)                                             OLD Macbook Pro                         iPhone
    (used for remote working)       (Used for home working)     (used for heavy CAD and rendering)    (not being used for anything at the moment)        (& iPods)
    I am looking to have all my files in one place as i am hopelessly disorganised. I know the online clouds are a good solution (used Dropbox at work and uni for 3 years) however i am wanting to create my own 'dropbox/icloud' at home. So whenever i get back home with my laptop, any work i have been working on whilst out that day is updated to the timecapsule, and then ultimately as i turn on the other devices, they update to those newer versions of the files. Please tell me that the 3TB time capsule i have can do this, otherwise it feels rather overpriced as a wireless storage device?
    Another note (to those in the know) If i am to be working on large files (REVIT/SOLIDWORKS/KEYSHOT/CREO/AUTOCAD) - is the timecapsule connection good enough to support editing and updating these files?
    I know i may be asking a question that many have before, but as a bit of a technical novice I wanted a clear-cut answer to my specific circumstances. Your help is greatly appreciated.
    (*can i use this WD hard-drive that is connected to the Time Capsule as a back up? so that the time machine back-ups/any back ups are also backed up onto this one? can the WD be a backup for the TC?)
    Kind Regards
    Joe

    The diagram was supposed to look more like this......
    Internet ---------TIME CAPSULE(containing all files) --------WD 2T Harddrive
                                                I
         I                           I                          I                            I                                   I
    Macbook Pro         iMac                 HP (PC)            OLD Macbook Pro           iPhone
    Sorry!
    Regards
    Joe

  • I have problem with my wifi in 4 S, i cant connect to any wifi itried resetting network setting and reset all setting but the result was the same, its only keeps searching for wifi and cant find any, itried to use OTHER but also didnt work.please help me

    i have problem with my wifi in 4 S, i cant connect to any wifi itried resetting network setting and reset all setting but the result was the same, its only keeps searching for wifi and cant find any, itried to use OTHER but also didnt work.please help me???

    If Join was on then your home wi-fi must be set to Non-Broadcast.  If you did not set this up (maybe your provider did) then you will need to find the Network Name they used, and any password they used.  The SSID is Security Set ID and to see more try http://en.wikipedia.org/wiki/SSID .  Basically it is the name used to identify your router/network.  A lot of times the installer will leave it set as LinkSys, or Broadcom or whatever the manufacturer set it as for default.  Your best bet is to get whoever installed it to walk you through how they set it up, giving you id's and passwords so you can get in.  HOWEVER, if you are not comfortable with this (if you set security wrong, etc.) you would be well ahead of the game to hire a local computer tech (networking) to get this working for you.  You can also contact the vendor of your router and get help (if it is still in warranty), or at least get copies of the manuals as pdf files.  Sorry I can't give you more help, I hope this gives you an idea where to go from here to find more.

Maybe you are looking for