Find, edit, and remove the tag XML (Adobe InDesign Server CS5)

Hi all

I work with Indesign CS5 server and JavaScript, although having some difficulties to come with a solution to a problem...

I have to build a script JS (called through SOAP) that will allow me to search for an XML tag in an InDesign file.

After you find the XML tag, if the variable 'action' is set to remove, it should remove the tag and its content.

If the action is set to edit, he should change the content of the tag to the user-defined content.

The main warning is that the XML tag is variable, as is the XML of the InDesign file structure.

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 = "update content";

}

}

}

Any help would be greatly appreciated!

Thank you

Ben Kay

'searchForTag' can be implemented as a recursive function.

Recursion is defined as follows: I thought: "I'll just get this forum for"recursion"." The first post I found was one of my own, which suggests that the poster should search the forum for "recursion".

Here is an example: find the XML element []

And another: remove the xml using JS [CS3] element (read carefully, as the OP is stuck on how to remove an item and continue successfully)

And the other using XML rules - which I am quite familiar with, but may work for you: changing values in XML tags

Tags: InDesign

Similar Questions

  • Help in removing the tag XML! 1

    Hi all

    I wrote the following query

    "SELECT ' < ns0:Employee_Details xmlns:ns0 ="http://BizTalk_Server_Project1.Employee_DesirableFormat">"
    || Chr (10) | dbms_xmlgen.getxmltype ("SELECT xmlforest (emp_id, name, dept_id, xmlforest (add1, add2) AS address, City) as employees
    EMPLOYEES WHERE EMP_ID =' | 101) | Chr (10) | ' < / ns0:Employee_Details > ' AS XML
    from Dual;

    and out put:

    -ns:Emp xmlns:ns = "http://BizTalk_Server_Project1.Employee_DesirableFormat" >
    -< ROWSET >
    -< ROW >
    -< EMPLOYEES >
    < > 101 EMP_ID < / EMP_ID >
    < NAME > KING < / NAME >
    < DEPT_ID > 10 < / DEPT_ID >
    -< ADDRESS >
    < ADD1 > PH-1 < / ADD1 >
    2-SEC < ADD2 > < / ADD2 >
    < / ADDRESS >
    ABCD < CITY > < / CITY >
    < / EMPLOYEES >
    < / ROW >
    < / LINES >
    < / ns:Emp >


    Now I want to remove the < Rowset > and < r > tag in my result... I can do on top of the query changes... or if there is another way... Please let me know...

    Thank you

    Now I want to remove the and the tag in my result

    Just use EXTARCT:

    SQL> select ''
           || dbms_xmlgen.getxmltype (
                 'select xmlforest(empno, ename, deptno, xmlforest(job) as job,sal) as employees from emp where empno ='
                 || 7788).extract ('ROWSET/ROW/*')
           || '' as xml
      from dual
    /
    XML
    --------------------------------------------------------------------------------
    
        
            7788
            SCOTT
            20
            
                ANALYST
            
            3000
        
    
    
    1 row selected.
    
  • Need to remove the tags file Nullable while generating XML files

    Hello.

    I have a requirement where I have to generate an XML file, but the generated XML file does not display the tags when the column is null. An example below:

    CREATE TABLE emp_tab (emp_id NUMBER PRIMARY KEY
    name VARCHAR2 (20).
    dept_id NUMBER);
    Table created.
    INSERT INTO emp_tab VALUES (30, 'Scott', NULL);
    1 line of creation.
    INSERT INTO emp_tab VALUES (31, 'Mary', NULL);
    1 line of creation.
    INSERT INTO emp_tab VALUES (40, 'John', NULL);
    1 line of creation.
    COMMIT;

    When I generate the XML code, you can find the output like below:
    < EMPLOYEE >
    < EMP_ID > 30 < / EMP_ID >
    Scott < NAME > < / NAME >
    < / EMPLOYEE >

    I just the Worklfow Developer's Guide and the example above was taken from Page 561 and 562 by looking at the DBMS_XMLGEN.setNullHandling using DBMS_XMLGEN procedure. DROP_NULLS as a parameter.

    Now, I understand the concept, but my requirement is a little different. I get a record as my procedure parameter PLSQL type, but requires the choice of a base table, which means maybe I have to insert first the folder I get as parameter in a table of basic and then select in the same when you set the context, which is what I don't want in the DBMS_XMLGEN.newContext. This is an additional burden.

    I've previously planned to use XMLELEMENT and XMLFOREST to generate the XML file (and was rather more simple), but this requirement to remove the tags altogether when the values are NULL led me to believe that maybe I might have to go down the path of using the API DBMS_XMLGEN.

    Can you suggest a better way, replacement to achieve what I want? Or perhaps give an example on how I can get there using XMLDB?


    Thank you and best regards,
    JD

    Can I use just the XMLElement and XMLForest to achieve?

    Sure. As said, XMLForest does not create elements for NULL values:

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb13gen.htm#ADXDB5006

    If the expression value is null, then no element is created for this expression.

    This is the code I wrote your above mentioned suggestion discussion forum

    Yes, but this solution is taken out of context.
    Here, it is obviously preferable to not generate empty items in the first place:

    SELECT XMLElement("Address"
           , XMLForest(
               lr_addr_rec.account_name     as "AccountName"
             , lr_addr_rec.address_line_1   as "Addressline1"
             , lr_addr_rec.lot_number       as "Addressline1"
             , lr_addr_rec.address_city     as "City"
             , lr_addr_rec.address_state    as "State"
             , lr_addr_rec.address_postcode as "PostCode"
             )
           )
    FROM dual;
    
  • I want to save as a .wmv file, so I can burn it to a CD, but I keep getting an error 0 x 87160139 "find missing or remove the unusable items in your project and then try again.

    I have a movie... great... now I want to save as a .wmv file, so I can burn it to a CD, but I keep getting an error 0 x 87160139 "find missing or remove the unusable items in your project and then try again."  so I tried to change the format of mp4 to mi/gal (what I know now was not necessary), but it will not save yet. I would like to make photos and videos I use.   I think that this video might be too big? not sure... also, all files have the same name and in the same folder that I shot, I'm in a block, any help appreciated! Thank you.

    -Mark

    Hi Mark,

    Thanks for posting your query on the Microsoft Community.

    According to the description, I understand that you are getting an error code.

    I suggest you to refer to the Microsoft Help Article below and check if that helps.

    http://answers.Microsoft.com/en-us/windowslive/Forum/MovieMaker-program/Windows-Live-Movie-Maker-error-0x87160139/9e94fc1a-1542-E011-9BAC-78e7d160ad4e

    You can also check:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-pictures/sorry-your-movie-cant-be-saved-find-any-missing/7fc5ae42-8297-4e64-B27F-f48d30658d08

    Hope this information helps. Please let us know if you need any other help with Windows in the future. We will be happy to help you.

  • I have Adobe Reader XI. Is it possible I can fix asymmetrical pdfs and remove the white pages? If so, how?

    I have Adobe Reader XI. Is it possible I can fix asymmetrical pdfs and remove the white pages? If so, how?

    Not possible with Adobe Reader.

  • Remove the tags in Windows Photo Gallery

    This question is about the photo gallery Windows on a Vista operating system. My question is about the drop-down auto-liste of tags that grows each time you enter a new tag. Handy if you want to use something you've used before but a nuisance if you want to erase it. I figured out how to remove tags on the pictures still on the computer. My question is about the images that have been deleted and is not recoverable. There is always this tag leftover junk that applied to these photos that I deleted. appears whenever you try to add a new tag and resists all efforts to remove it. I contacted gateway computer people since they installed the operating system and got the solutions really wild just to remove the unnecessary tags. I thought that everything you enter, you should be able to delete... just... but this has proved to be a great puzzle. I hate to have to do a restore to original factory specifications and lose everything I've added to this day to get rid of these pesky tags. In addition, it simply repeats the problem unless I have find how to remove the little monsters.

    I hope someone can help...

    Hi Jo,.

    It's a good thing to be careful when you edit the registry.  In your case, as the registry key seems to be very specific to the Windows Photo Gallery, we can export the folder safely we are change.  Be sure to close the Windows Photo Gallery before you start.

    • Click the ball to Start .
    • Type regedit in the box start the search.
    • Navigate through the folders on the left at the following key:

    HKEY_CURRENT_USER\Software\Microsoft\Windows Gallery\Library\PreviewPane\LabelAssignment\MRU photo

    • Right click on the folder MRU in the left hand window and choose export.
    • Give it a file name (no matter what you name it) and save to the desktop.
    • In the right window, you will see keys named MRU00, MRU02, MRU03 etc...
    • Right-click on these keys and click on delete.

    Once you are finished, close the registry editor by clicking the x in the upper right and restart your computer.  When she returns to the top, open the Windows Photo Gallery and see if the tags are gone.

    If you receive errors of ANY opening of photo gallery, simply, do a right click on the file that you have already saved on the desktop and choose Import.  That will undo any changes that we have made.

    Please let me know if that helps.

    Standard WARNING:
    Change the settings of the REGISTRY can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the REGISTRY settings configuration can be solved. Changes to these settings are at your own risk...

    Brent
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I want to allocate more disk space for my c drive and remove the drive d

    I want to allocate more disk space for my c drive and remove the drive d. I 26 gig on the d drive and only using less than 1% of it, and I have the same amount on c, but only 39% c left. How to do this.

    LEM explained the problems that you tried to resize partitions on the same drive.

    You can create more free space in C in carrying one of the measures suggested below.

    The default allocation for the restoration of the system is 12% on your C partition is more generous. I have them would be reduced by 700 MB. Make my computer right click on your icon, and select System Restore. Place the cursor on your C drive select settings but this time find the slider and drag it to the left until it shows 700 MB and output. When you get to the settings screen, click on apply and OK and leave.

    A flaw that might be useless which is for temporary internet files, especially if you keep no copies on the disk offline. Setting the default value is 3% of the walk. Depending on your attitude to copies offline, you could bring it to 1% or 2%. In Internet Explorer, select Tools, Internet Options, general, temporary Internet files, settings to make the change. At the same time, look at the number of days, the story stands.

    The default allocation for the basket is 10% of the disk. Change to 5%, which should be enough. In Windows Explorer hover over your Recycle Bin, right click and select Properties, Global and move the slider from 10% to 5%. However, try to let you become so complete that if it is complete and you delete a file by mistake it will bypass the Recycle Bin and have gone forever.

    You can generate more space in the system (usually C) the folder move partition.

    For temporary Internet files, select Start, Control Panel, Internet Options, temporary Internet files. Settings and move back.

    To move the storage folder Outlook Express select from Outlook Express Tools, Options, maintenance, store folder and change.  http://www.tomsterdam.com/insideoe/files/store.htm.

    How to change the default location of the My Documents folder: http://support.microsoft.com/?id=310147

    You may also change the default locations of the files in Microsoft Office programs when you choose to move the My Documents folder. For Word, go to tools, Options, file locations, highlight the Documents, click on edit and change the path. For Excel, go to tools, Options, general, and change the default path.

    My Documents is one of the many the created system of special folders, which include my pictures, and my music. It can be more easily modified using TweakUi. Download TweakUI, one of MS powertoys, here: http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp.

    In TweakUi, select workstation, special folders. You can scroll down to see the full list of special folders to the left of the button to change the location.

    You can move programs, but to do this, you must uninstall and reinstall the program. With Word and Excel, the existing data files are not affected by reinstalling. Most of the work in question is going to be reinstall all updates issued after those that are included with the original Microsoft CD / DVD.

    If your drive is formatted as NTFS another potential gain arises with your operating system on your C drive. In the Windows directory of your C partition you will some uninstall files in your Windows folder in general: $NtServicePackUninstall$ and $NtUninstallKB282010$ etc. These files can be compressed or not compressed. If compressed text the name of the folder appears in blue. If these files are not compressed you can compress. Right-click on each folder and select Properties, general, advanced, and check the box before you compress contents to save disk space. On the general tab, you can see the winning amount by deducting the size on disk size. File compression is only an option on an NTFS formatted disk partition / partition.

    I'd be interested to see a report of Disk Defragmenter. Open Disk Defragmenter and click analysis. Select view report, and then click Save as and save. Now find VolumeC.txt in your My Documents folder. Open the file, place the cursor anywhere in the file, select Edition, select all to select all the text and copy and paste into the body of your message. To do this, before you run Disk Defragmenter because it is more informative.

    Select Start, all programs, accessories, System Tools, cleaning disk to emptying your trash, delete temporary Internet files and other selected options. I recommend also you click Other Options, System Restore and delete all but the last system restore point. Run Disk Defragmenter

    Using the system restore option is most appropriate when your system is slow and you need to increase the free disk space on your C partition. If you have errors that could be solved by using the system restore to your system settings back to before that the error occurred initially, do not use this option.

    Select Start, Control Panel, Folder Options, view, advanced settings and check the box in front of "show files and folders" and 'Hide protected operating system files' are unchecked. You may need to scroll down to see the second element. You should also make sure that the box before "Hide extensions of known file types" is not checked. Notwithstanding, there are some files that are hidden. Again, you will not see the System Volume Information folder.

  • I instaled Windows 7 64-bit Enterprise edition and installed the latest version of Firefox and it freezes every time that I run. Please help me.

    I instaled Windows 7 64-bit Enterprise edition and installed the latest version of Firefox and it freezes every time that I run. Please help me.

    4d4aae27-34ee-4620-b349-c03002813b2003-Jan-1312:30 AM

    54e24e0e-dfc4-466b-A347-4bd95536773e03-Jan-1312:30 AM

    22d351d2-6461-4F33-9FBD-6d31f769e73103-Jan-1312:30 AM

    8a8da99b-335e-43bb-AA12-4634aa0b431003-Jan-1312:30 AM

    A15bb095-aeb9-44E1-A79C-1a17cee207d503-Jan-1312:28 AM

    A few videos that use the Flash plugin contain a menu entry in the context menu that allows to disable hardware acceleration in flash player.

    To disable the mode you will need to edit the file C:\Windows\SysWOW64\Macromed\Flash\mms.cfg as explained in the knowledge base article protected.

    See also: how to solve the safe_mode of Flash Player for Firefox? :

  • Problem with movie maker and edit and remove a superimposed title.

    I'm doing a movie with Windows Movie Maker.  I added a title I've superimposed, but do not because it is too much and covers the image.  I tried to remove the title by clicking on the table of the storyboard by clicking edit to remove the title.  It does not remove the title.  I also tried to remove the photo thinking the overlay would remove with the image, but rather the superimposed title passes just to the next image.  I'm frustrated.   Help, please.

    I'm doing a movie with Windows Movie Maker.  I added a title I've superimposed, but do not because it is too much and covers the image.  I tried to remove the title by clicking on the table of the storyboard by clicking edit to remove the title.  It does not remove the title.  I also tried to remove the photo thinking the overlay would remove with the image, but rather the superimposed title passes just to the next image.  I'm frustrated.   Help, please.

    ==============================
    Try the following...

    Go to timeline view and... Right click / Delete...
    the unwanted track "title Overlay". John Inzer - MS - MVP - digital media experience

  • How can tag photos - I remove the 'Tag' because it's in every picture!

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Ideas: How can I remove the "Tag" I didn't tag each photo. I thought that I have WAS MARKING ALONE.  I can't get rid of the label on each photo

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Right click on the tag in the left pane, click on remove, then click Yes. (Windows Photo Gallery)

    Click on the descriptive tag, click on manage tags, right click on the tag you want to delete, then click on delete and then Yes. (Windows Live Photo Gallery)

    teengeek.freehostingcloud.com

  • How can I edit 360 see the video through adobe program?

    I would like to know is it possible to edit 360 see the video through adobe program?

    In fact, I used Adobe Premiere Pro for regular video editing, and I've heard say that sky box 360/VR plugin and first Pro CC

    to change the view 360 video.

    If so, first of all, I would like to know the means to purchase or download the program edit.

    Secondly, I would like to know if there is a video instruction to learn how to use the program.

    Working with VR video | Adobe first Pro CC tutorials

  • How can I remove the tags in a PDF?

    How to remove all the tags to a PDF document using acrobat pro XI?

    See the images

    1. go on the view menu, and then select Show/Hide > Navigation panels > Tags

    2. click on the Panel tags and right click on tags, and choose the command remove the tags, this will remove all tags.

    To remove tags and expand tags and right click and choose Delete.

    Thank you

  • Is it possible to add the tag XML columns in Table

    Hello world!

    I'm the new baby of the indesign forum. I need apply the tag XML to each column of the table (name probably test1, test2...)

    Please help me on this problem or even to correct my codes.

    -yajiviki

    My code.

    var docRef=app.activeDocument;
    var ColLen=app.activeDocument.stories.everyItem().tables.everyItem().columns.length;
    for(i=0; i<ColLen; i++){
        var mySel=app.activeDocument.stories.everyItem().tables.everyItem().columns[i];
        app.activeDocument.xmlElements[0].xmlElements.add({markupTag:"Test"+(i+1), xmlContent:mySel});
    }
    

    Hello

    You can easily mark the table initially with the automatic tag command.

    myTable.autoTag();
    

    Once this is done, you can target the cells in columns and reset the tag applied:

    var xes = myTable.columns[0].cells.everyItem().associatedXMLElement;
    var n = xes.length;
    while ( n-- ) xes[n].markupTag = "foo"
    

    HTH

    Loïc

    www.ozalto.com

  • Select reverse and remove the effect from Photoshop to Illustrator

    Hello

    I'm new to Illustrator and do my best to understand how it works! I'm used to working with Photoshop and there are some things that I could do it on Photoshop and am now trying to find a way to make it look as I want... So here goes

    I'm looking to have this effect on Illustrator. (For those who you don't see the image, mimage is a globe with the text that appears only on continents. The text disappears when the image is empty. I forgot to save it as a png, but white is transparent.

    Logo PEI.jpg

    I managed to write my text in Illustrator and change the text to "Color Burn" effect, so that it looks the same on all continents. However, I am unable to remove the text where it leaves the other layers. The text remains black where the background is transparent.

    Logo PEI Illustrator.jpg

    So I was wondering if there is a way to remove the text outside the continent. The same effect, you should achieve in Photoshop by selecting reverse and removing the text (pixelated).

    Make a copy of the shape of the continent. Select the copies, and then choose the command object > path > make a compound path.

    Then use the new compound path as a clipping on the text mask. With her before she and the text and the text selected, choose object > path > make a clipping mask.

  • Moves from 2014 version to version 2015, considered an update? If this is not how to deploy the 2015 version and remove the 2014 version?

    Moves from 2014 version to version 2015, considered an update? If this is not how to deploy the 2015 version and remove the 2014 version?

    We currently have Adobe CC deployed on more than 4,000 computers, I am now looking to update installation on the newer versions that are 2015. If I create a new package it installs the latest but it also lets older versions of 2014.

    Is there a way to delete the versions of 2014? Or can we update the versions of 2014 and 2015?

    It's actually an upgrade.

    If the two can exist side-by.

    in the cc office application, there is an option to remove the older versions, but I don't know about the enterprise deployment.  You should check the documentation of the company.

Maybe you are looking for

  • Question about DVD drive on Satellite Pro A200 PSAE7

    Although the [Specification | http://uk.computers.toshiba-europe.com/cgi-bin/ToshibaCSG/jsp/productPage.do?service=UK&PRODUCT_ID=131911] told my Sat - Pro A200 (PSAE7) comes with a drive DVD Toshiba, it is * NOT * installed in my machine. I tried to

  • Laptop HP shows ' speakers and the headphones ' as a healthy option

    I recently got a new computer hp laptop. When I plugged my headphones in, sound still came through the speakers. I looked in the sound menu, and it was classified as two options "Speakers and headphones" and "helmet of Communications." I could hear m

  • get the 641 and 80070641 error code during the installation of Windows updates

    Original title : not able to have windows updates installed on the pc have vista and get code error 641 and 80070641 - what it means and how can I solve this problem please? Not able to install updates windows for my pc with the vista system. I keep

  • Copy on a printer wireless HP4620 function

    Everything is good with my printer wireless HP 4620... except, when I copy a paper it comes out too big and not is not on one page.  Scanning and printing works well, it's the COPY feature... where should I go to the default value of the smaller COPY

  • All the desktop icons show emblem of Mozilla

    original title: change my icons My son uses this laptop and every icon has changed to the emblem of Mozilla/Firefox. Please help me solve this problem. I can't get anywhere on this thing, because I don't know what program will open. There is so much