Remove and replace XML tags

How can I delete a XML tag and replace using script? There is a function for adding tags in the document (activeDocument.xmlTags.add("xml-tag")), but I cannot find a corresponding function to delete it and replace it with another, as you would in the GUI.

I tried to accomplish this by changing the name of the tag to one I tried using the code below, but it throws the error: "a label with the same name already exists.  Please choose another name. »

for(var i=0;i<xmlTags.length;i++){
     xmlTags[i].markupTag.name = "existing-xml-tag";
}

Anyone know of a way around this error or should I use another method entirely?

OK, it was not so difficult to solve. I was looking in the wrong place that's all. Function remove (replaceWith) is available in the XMLTag class. That means that the followin code removes the tag called "p-news-topic" and replaces it with the existing tag called 'p '.

myDoc.xmlTags.itemByName("p-new-section").remove("p");

Tags: InDesign

Similar Questions

  • Satellite A30 921: how to remove and replace the memory?

    Hi, can someone help me how to remove and replace the memory of satellite A30 921. and also, please give a detailed instruction.

    Thank you in advance.

    Hello

    There is not much to explain. On the low side in the Middle it is placed to cover memory (fixed with two screws). Remove the cover and you will see 2 slots there. I put t know how much memory you here but like Stefan says you can use max 2 GB of RAM (2 x 1024Mo PC2700 - PA3313U-1M1G). How to remove the memory modules, which you can see on http://www.hardwaresecrets.com/article/189/5

    Good bye

  • Laptop HP Touchsmart 15-D020: how to remove and replace the keyboard on laptop HP Touchsmart 15-D020NR

    I spilt a drink on my keyboard and now I can not turn off the caps lock and a number of keys does not work. I need instructions on how to remove and replace the keyboard frame. Thank you.

    On your page of support-look for Maintenance and Service of Guide in the manuals.

    http://support.HP.com/us-en/product/HP-15-D000-TouchSmart-notebook-PC-series/6627588/model/6761859/manuals

  • Steps to remove and replace the keyboard. HP Pavilion dv7-1448dx

    Hello. I have HP Pavilion dv7-1448dx. I have not available a manual where the path is directed to change the laptop keyboard. I need help to get the steps to remove and replace the keyboard. Please provide me with the support as soon as possible so that I can solve this problem. Thank you.

    Link to the .pdf manual

    Click above. We are not HP, all other users trying to help.

  • G61 does not illuminate unless I have remove and replace the battery.

    Even when the power cord plugged in it will not light. If I remove and replace the battery it lights mode battery and AC. At the same time my HP Support Advisor and HP s Advisor "stopped working".

    I restore to a previous point, no help. Downloaded a new HP advisor, ho help.

    This happened after the recent big WIN7 updated. Help

    Hello

    In the Menu start, open the all programs, open accessories, right-click on command prompt and select "run as Administrator".  In at the prompt, type the following command and press ENTER.

    sfc/scannow                (Note that there is a space between sfc and /)

    Let the entire process, then the output type and press ENTER.  Stop the laptop, unplug the AC adapter unplugged, remove the battery and then press and hold the power button for a minute.

    Now, plug in the AC adapter without the battery inserted, start Notepad, open windows control panel, open Device Manager, expand the entry for the battery, on the right, click on and compatible Microsoft ACPI control method battery and select Uninstall - do uninstall not something else here.  When the uninstall is complete, shut down the PC, unplug the AC adapter, reinsert the battery and then start the PC on just the battery.  Windows will automatically reinstall the driver - leave Windows running for a few minutes. Shut down the PC again.  Now plug the power adapter (with the inserted battery always) and start the laptop to see if it helped the issue at all.

    Kind regards

    DP - K

  • cartridge in the slot on the left is not intended to be used with this printer. Remove and replace

    Hello

    After using my printer on a regular basis and without any problem, I suddenly had this coming message: "cartridge in the slot on the left is not intended for use in this printer. Remove and replace.

    I have a computer that is running Windows 7, 64-bit and the cartridges that I use are all genuine HP cartridges, black and tricolor cartridges are XL.

    What surprises me the most, is that the left cartridge is not empty, I without touching it, there was no jam paper, or any other poor behaviour of the printer. It happened just in the middle of printing, the printer just finished a job, and was about to start the second in the queue. Maybe this detail can help or it's just a coincidence...

    Thank you for your help

    Tonphilou

    Hello

    Please follow the steps in the document below.

    http://support.HP.com/us-en/document/c00042821

  • How to remove and replace the internal Blu - Ray DVD RW drive on laptop HP HDX 16 t

    The internal dvd player does not work and I would like to remove and replace it myself. If anyone has a method step by step for me, or links to pictures or videos of the steps, I'd appreciate it. Thank you

    RayCE

    There is a screw on the bottom of the laptop that holds the drive in the screw about 4 inches from the front of the dvd player door.on the botom of the machine, remove the screw and remove the disc.

  • removed and replaced index page old index is always on the web

    removed and replaced index page old index is always on the web. I just after a new website, but BusinessCatalyst blinking an error message to fast as follows by saying I can't. I thought Muse for coders and technicians.

    Steven,

    The page could be cached in other places, such as cache network or your internet provider.  These are rare cases, but they happen, and you have no control over it.  Best to have friends / colleagues check from another place, this page has been replaced by fact.  If you have several locations showing the same old page, which means the page was either not removed properly, or home page of the site is perhaps used a different directory than where you are currently working.  It is common for people to create several directories test when booting with web creation programs and forget the one that serves content for the online site.

  • How to search and replace only tag values XML and tag not the columns?

    Hello

    I'm new to xml db, and I have a scenario where I need to find and replace the xml content. The search is based on a clear text and not on any column.

    I have a table as follows:

    ID VARCHAR2 (32 BYTE),
    MESSAGE_TYPE, VARCHAR2 (64 BYTE),
    XMLTYPE OF the MESSAGE_CONTENT,
    REJECTED_REASON VARCHAR2 (256 BYTE)

    And XML in the form of the sample:

    <? XML version = "1.0" encoding = "US-ASCII"? >
    < MessageEnvelope >
    < header >
    Renault < partner > < / partners >
    < MessageType > release < / MessageType >
    S74 < PartnerMessageType > < / PartnerMessageType >
    < MessageTime > 2001-12-17T 09: 30:47.0Z < / MessageTime >
    String of < LinkToRawMessage > < / LinkToRawMessage >
    < / header >
    < body >
    < version >
    < address >
    < DealerDestAddr > ABCD < / DealerDestAddr >
    < DestAddr > ABCD < / DestAddr >
    < NextDestAddr / >
    < StartAddr / >
    < / book >
    < assignment / >
    < ClientStatus / >
    < dates / >
    < HoldInfo >
    < HoldCode > HoldTest < / HoldCode >
    < / HoldInfo >
    < message / >
    < partner >
    < OrderGiverCode > CMR00BCV < / OrderGiverCode >
    < / partners >
    < ToDo / >
    < transport / >
    < vehicle >
    W0LGDM9A_Ran11115 < WINE > < / WINE >
    < / vehicle >
    < / Statement >
    < / body >
    < / MessageEnvelope >


    I'm running the query of foll:

    UPDATE t_xml D SET D.MESSAGE_CONTENT = replace (D.MESSAGE_CONTENT, "ABCD", "Chennai")
    (WHERE d.MESSAGE_CONTENT.existsNode('//*[*="ABCD"]') = 1;

    This works very well and replaces the two ABCD < DealerDestAddr > < / DealerDestAddr > and < DestAddr > ABCD < / DestAddr > tag values in Chennai. But the problem I encounter is if there is that a node with the name of the < ABCD > tag is also changed to < Chennai >. Please help me to fix this problem.

    Kind regards
    Sprightee

    What happens if I need to select and update a node that has the value null. Who doesn't have any value to it.

    You can test if the partner has a child text() node:

    existsNode(
      d.message_content
    , '/MessageEnvelope/Header[not(Partner/text())]'
    , 'xmlns="http://www.groupecat.com/CLV2/MessageEnvelope/20120501"'
    ) = 1
    
  • Search and replace all tags font

    Howdy,

    Might be a bit of a newbie question; but I need to remove all the tags of fonts; departure and arrival; include values within my page. I tried to use wildcards with find and replace, but could not work; could someone help me please.

    Thank you

    -Sam

    Backup entire site

    Edit > find & replace

    find in > all current local site or the current document (whichever you prefer)
    Search > specific tag >
    Click on the "-" symbol to remove tag modifier options
    action > Strip tag > replace all

  • How to remove and replace the missing keys Sat A30

    Hey folk,
    I guess that sounds simple, but I have just no idea.
    Broke and need to replace a couple of keys on my keyboard UK A30. At present, all what I have in place are the rubber bubble popper & locators of metal set in the empty spaces.
    The keys in question are the shift (I have no u lying in spring form) and? + / keys of RHS of KB.

    I have complete German and American replacement KBs, but to remove the necessary keys on the part and repair the United Kingdom KB.

    I don't want to end up with 3 broken KBs

    So I need clear and detailed instructions on removal and then reset the necessary keys.

    Any help or direction to the site that contains this kind of info would be greatly appreciated. Or response message directly by email to

    [email protected]

    Thank you very much.
    sparkiefive

    Hello

    I think you should go to a Toshiba Service partner.

    You can find them here:
    https://EU.computers.Toshiba-Europe.com
    Downloads support & - find an approved service

  • Want desolde/resolder, remove and replace the two damaged usb2 ports

    I have a Sat A30 perfect by all means other than 2 USB2 ports on the back that are damaged (black plastic seperaters between connectors jumped) not quite sure why this happened because I was simply unplug the connected usb plugs on both occasions.

    The connectors were not especially tight. fault is I have no insulation between copper connectors which are still found in the slots and causes a short circuit, when I plug in a usb device.

    I bought a card mother relpacement (damaged) and usb2 connections are OK! Have good technician experience in carring out Soldering/desoldering and has all the tools. Problem is that I have not the slightest idea what connections under the Board of Directors are required to unsolder my damaged usb2 card in order to remove/swop and perform the necessary replacement.

    I'm sure I'll be advised to contact an authorized reseller of Tosh. I tried this and they say that they will be already only the motherboard together and the cost is horrible. I would rather make the repair myself that's not rocket science.

    The techies out there who could counsel with picture of the relevent pins to desoldering in order to remove and repair the fault would be greatly appreciated.

    E-mail: [email protected]

    If you can help in any way or point me in the right direction to go repair.

    I hope someone can help. Thank you very much
    Stewart

    Hello

    Please don't be crazy about me, but in my opinion, is not a very good idea to open the notebook alone if you don't have a lot of experience with it. Laptops are designed on the specific way and exchange of material is not so easy as the exchange of material to work stations.

    Believe me that a small error in the assembly/disassembly procedure can case damage to equipment or the façade of the same laptop parts. I know that there's not much service partner assistance because they want to do. It costs money, but you must understand that if they give that kind of advice or information they may close the shop very soon.

    You can try to do it alone, but at your own risk and be careful.

  • &lt; b &gt; and &lt; /b &gt; xml tags displayed in pdf format

    Hi Experts,

    I use 10.1.3.3.2

    I shows the fillter view as well as the report on the dashboard. When I generate the PDF (printable version-> PDF) for it, the dates between filter condition shows the < b > and < /b > tags around 'and' instead of show "and" in bold.

    That is to say, it appears under the form-due Date is between * 07/01/2010 * < b > and < /b > * 31/07/2010 *.

    Whereas it should be-
    Due date is between * 07/01/2010 and 31/07/2010 *.

    In html view, it is correct. The problem is in pdf format.

    Someone at - it a solution to remove the < b > < /b > tags and?

    ... If you want to keep the operand ' between the ', another option is to click on Advanced Options > convert the SQL filter in the filter to create/edit window. This will also get rid of HTML tags...

  • How can I remove and replace all THE contacts on my iPhone 6 s

    I just got a new iPhone 6s and had my contacts migrated to she an old HTC Android phone at the office of my carrier. Migration not be passed not as planned and all my contacts are screwed up. I would like to delete all contacts and replace them in the good list which is on my MacBook Pro. How is the best way to do it? FYI, I'm long (Senior) Mac user, but a smart phone for novice user. Once I get the old deleted contacts, can I do a direct link to my MacBook via USB? Or should I create an Archive of my contacts and somehow get in the cloud and download it from there? Thanks in advance for your help.

    I fixed this problem myself. Here's how I did it...

    (1) on my new iPhone 6s, I went to settings > iCloud > Contacts and turned on OFF.

    (2) then I went to my MacBook Pro > address book. In my address book on the left hand side there was a list called "ICloud all.» I selected all the contacts in this list and deleted (it has not deleted the list "on my Mac".)

    (3) I went back to my iPhone settings > iCloud and turned the "Contacts" button. Back to my phone button and selecting 'Contacts' verified that there is no left of Contacts on my iPhone.

    (4) go back to my MacBook > addressbook, I copied the 'groups' I wanted to list "all iCloud.

    (5) I did a "hard reboot" on my iPhone and Voila! -all my contacts are now on my iPhone and I could turn the groups on or off because I am pleased.

    NOTE: I could have done the same thing except in step (4) above, I could have copied 'All the Contacts' in the field 'Cloud of all', but I wanted to only certain groups on my phone.

    I hope this helps others with the same problem.

  • HP PC laptop power cord safety program removal and replacement

    I buy laptop HP P r022tx last month. I saw that HP Notebook PC AC Power cord safety recall and the program of replacement on the HP site. According to the guidelines that I check my adapter, it is of type LS-15. But so far I can't find such a problem of large heating in it. Should I ask replacement if she will give such a problem in the future...

    Please follow the link:

    http://h30434.www3.HP.com/T5/notebook-hardware/HP-laptop-power-cord-safety-recall-and-replacement/m-p/4393930/highlight/true#M144809

Maybe you are looking for