Replace the text of an item by the tag < "BOLD" >

Hi all

I want to change the text of an element with a certain tag, for example "<"BOLD">".

I can get the name of the tag through prim. ElementDef.Name. but how () text - node of the element.

Y at - it something like the xslt text () - node feature? Any other ideas?

Thanks in advance

WA

function replaceElementText(doc, elem, newText)
{
    //Define a new element range and set it up
    //to represent the contents of the element.
    var er = new ElementRange();
    er.beg.parent = er.end.parent = elem;
    er.beg.offset = 0;

    if(ov(elem.FirstChildElement))
    {
        er.beg.child = elem.FirstChildElement;
        er.end.offset = 0;
    }
    else er.end.offset = Constants.FV_OBJ_END_OFFSET;    

    //Set the element range in the document and
    //execute Clear() to delete the current element contents.
    doc.ElementSelection = er;
    doc.Clear(0);

    //The insertion point will now be at the beginning of
    //the empty element. Execute AddText() to insert the
    //new text.
    doc.AddText(doc.TextSelection.beg, newText);
}

Tags: Adobe FrameMaker

Similar Questions

  • By URL, replace the tag "title" of a browser window/tab

    I have a dashboard that will connect on any other dashboards. Is there a parameter to URL of OBIEE known or another method to replace the title of the browser window? Right now, they're saying all generics "Oracle BI interactive dashboards." I know I can replace this in the world, but what happens if I want to change on a case by case basis?

    Each time I try to call the custom html pages and which must have the dashboard of the url to load this html page.

  • replace the text in html

    We have a column of type CLOB data table. This CLOB column store html text.

    the example data:

    < p >

    Do the same for the footer:

    < /p >

    < p >

    < br / >

    < table border = "0" cellpadding = "0" cellspacing = "0" style = "" width: 672px "width ="840">"

    < tbody >

    < b >

    < td nowrap = "nowrap" style = "height: 31px;" Width: 152px ">"

    < p >

    [Number of lines in the body]; 1 < /p >

    < table >

    < /tr >

    < / tbody >

    < /table >

    < /p >

    How can we replace the string 'body' with 'dummy' in this example without replacing the tag "tbody"?

    We want to apply a find and replace function of html data, without touching the html tags.

    How can achieve us on db oracle 11.2?

    TX

    For complex examples, you can use the parser HTML for example (JSOUP) available on this site: jsoup Java HTML Parser, with the best of the DOM, CSS and jquery

    You can load the jar with loadjava file into database and do a stored procedure for analyzing and replace java html code...

    It's simple and powerful library...

    Defining the content of the text of the items: jsoup Java HTML parser

    Selector syntax is used to find items: jsoup Java HTML parser

    You simply load html in the parser... and then you iterate tags and search of the string, you need to replace...

    Replace this string and save html updated the db back or where you want...

  • Replace the selected text with other content TextFrame

    Hello

    I am changing a text selected in something new, involving the movement of text and the paragraph style using a jsx script. At the present time, everything works beautifully:

    • I entered the select text
    • I have create a new temporary TextFrame
    • I build my new paragraphs and apply styles to them in the new TextFrame

    What I was not able to reach still is to replace the original selected text by temporary TextFrame content.

    Any help would be more than welcome

    A part of my script:

    myText = app.selection[0].contents;

     

    ... do some stuff


    var myDocument = app.documents.item(0);

    var myPage = myDocument.pages.item(0);

    var myTextFrame = myPage.textFrames.add();


    myTextFrame.geometricBounds = [0, -70, 150, 70];

    myTextFrame.contents = "Paragraph1\rParagraph2...";


    myTextFrame.paragraphs[0].appliedParagraphStyle = pStyleGroup.paragraphStyles.itemByName('Style1');

    myTextFrame.paragraphs[1].appliedParagraphStyle = pStyleGroup.paragraphStyles.itemByName('Style2');

    And now, in myTextFrame, I have my new paragraph formatted, and I would like to replace the original selected text with the contents of my TextFrame (keeping the paragraph styles).

    Hello

    Keep the logic of the code and edit utilities:

    var
        mSourceIdx = app.selection[0].index,
        mStory = app.selection[0].parentStory,
        mReplaceStuff = {
            elements: [
                ["Paragraph_1\r",  "Style_1"],
                ["Paragraph_2\r",  "Style_2"],
                ["Paragraph_X\r",  "Style_X"]
                ]},
        mTarget, cElement, cText, cParaStyle;
    
    while (cElement = mReplaceStuff.elements.pop()) {
        cText = cElement[0];
        cParaStyle = app.activeDocument.paragraphStyles.item(cElement[1]);    // modify if styleGroups present in a structure
      mTarget = mStory.insertionPoints.item(mSourceIdx);
        mTarget.contents = cText;
        mTarget.paragraphs[0].appliedParagraphStyle = cParaStyle;
         }
    
    app.selection[0].contents = "";
    

    MReplaceStuff allows to prepare stuff to replace

    Jarek

  • Expression to replace the image according to the text of the layer.

    Hello, I wanted to ask you is it possible to replace the image in the function composition text text layer. That is the text layer contains code # 34 and expression indicates what kind of image should be placed according to conditions in expression of image.

    Sincerely, Deimantas

    Hello

    Expressions can not add/replace images.

    All images must be here somewhere, in the form of layers in the model or in a precomp, but not only as items in the project Panel.

    Then you can play with the opacity of these layers, with an expression of opacity to each of them:

    textLayer = (pickwhip the text layer that transports information);

    If (textLayer.sourceText == thisLayer.name) 100

    0 otherwise;

    The condition can be something different, for example "if (textLayer.sourceText is thisLayer.index"), etc, etc.

    Not clear what should be this condition in your case.

    Xavier.

  • Text editor ' Save as... '. "broken - replaces the original file as well

    ' Save as... '. "removed some sort items of menu standards a long time ago, but I used this http://osxdaily.com/2012/08/27/enable-save-as-os-x-mountain-lion/ to restore a just as long. This addition of shortcut recently stopped working properly. Creates the new file, it also replaces the original file. Good OOP...

    I removed the keyboard shortcut and discovered that if I open the file menu, hold the Option key to activate twice in save Sub... than that STILL not work correctly. It seems something within the modified OS and buggered how to save under... anything works.

    Does anyone know how to save under... work again? Please do not respond if your answer is to use two copies. This isn't an answer as duplicate is a replacement of several wrong step of the simple and easy as... backup function.

    OS X El Capitan: save documents

  • replace the 1rent hard drive test item

    I have a laptop Compaq CQ50-139WM.  Unfortunately, I don't have back up discs.  It wouldn't start so I drive some tests to F11.  "Replace the disk hard 1rent test item" is what happens when you test the disc hard self-test.  And thought?

    If the hard drive needs to be replace I can retrieve the content.  The problem is only these last photos added to the top of the Tower from the last photos back.

    Thank you

    Hello

    First of all, regarding the disk error message hard, it sounds like the drive has failed and you need to replace.

    About your existing data, there are a few options, I would say.

    1. one possible way to try to recover your files from a disk non-boot is to follow the process described in the link below.  The CD of the Ubuntu operating system you create can launched from the CD alone (IE it doesn't have to be installed on the hard drive) and I've often found to successfully extract data even a hard failure.  When you created the CD, follow the instructions and see if you can save your existing files. 

    http://www.howtogeek.com/HOWTO/Windows-Vista/use-Ubuntu-Live-CD-to-backup-files-from-your-dead-Windo...

    2 another option would be to remove the drive HARD, place it in an external enclosure - is an example of the link below - connect to another PC and see if you can access your files.

    External 2.5 HARD drive caddy ".

    Kind regards

    DP - K

  • How can I replace the opened in the Mail application Menu item?

    Hi all -

    I want to provide my users through the queue of mail message. I receive a message formatted and I know I can add a customized via menu item

    repository.addMenuItem (MENUITEM_MESSAGE_LIST, MyCustomMenuItem);

    but it still requires the user select MyCustomMenuItem.

    I can identify which messages are specific to my application, so I want to replace the menu item open for e-mail messages to call my manager rather than the method of 'open email message"default conditionally.

    Can anyone provide assistance in how to achieve this? Or if this is not considered a best practices approach, what are the alternatives?

    Thanks in advance.

    Dave

    I understand your point.  I think I'd in memory when I responded to your original post,

    Go back and looking at some code:

    You can get a reference to the message using MessageEvent.getMessage ().

    You can then re-evaluate the flags:

    Boolean isOpened = ((mssgFlags & Message.Flag.OPENED) == Message.Flag.OPENED);

    Then you can say 'if the update and isOpened"to determine if the message was opened.

    It seems to work for us.

    I hope this helps.

  • Replace the text box with Image through breakpoints

    Hello

    I'm looking to replace the text boxes and icons with images and want to know if I can do this on several break points at the same time without having to go and manually change each breakpoint.

    My site is here: Movement of Boulder

    In the Services section of the wider breakpoint, you can see the images that I want, but if you minimize the browser window, you will see the images and the text that he was supposed to replace. Is it possible to replace all the text boxes with the images you want?

    Hello griffinb,

    If you delete a breakpoint text areas, they will be removed from all.

    After you have placed your image just right-click on it and select the option ' copy the style and position > to other breakpoints.

    Let me know if you have any problems getting there.

    Kind regards

    Ankush

  • Where is the tool replace the text since the update yesterday?

    I opened Adobe Reader DC today and thought that the toolbar was different. The text replacement tool has disappeared (the one with the crossed T and bubble comment next to it)!

    I think that Reader downloaded an update yesterday.

    If I want to replace the text (instead of simply delete or insert, I can always do it manually (by highlighting the text I want to change by typing my changes).) However, the changes appear in red and blue, which he has not done before (text was blue just before).

    I checked the tools available and there is no option for text replacement tool more.

    In addition, the highlight color has changed - it is now orange instead of yellow. Is it because of the update too? >

    This happen? I use a lot the text replacement tool. Please can have back?

    Hi janeh87695323,

    Please select the text and right-click on it.

    Then select the "Add a note to replace the text" option in the drop-down list.

    Kind regards

    Meenakshi

  • Replace the Image and add text - new edition of content of the javascript tools commands

    With the new content tools Adobe XI of edition, can someone please advise if there is javascript for the following commands:

    • Replace the Image
    • Add text

    Replace the Image

    I have a pdf document with an image that is manually replaced by content (it is a logo) of the editing tools.

    Add text

    The same pdf document has text added manually by the content of modification of the tools as well (it's the same text each time).

    Can someone advise please basic commands javascript I can use to help me get started, because the process described above is very tedious when done by hand and repeated several times a day?

    Script to add text via content editing tool method is the goal, I try to avoid adding a text field, the pdf will be flattened at the end of the process in this way.

    Advice and assistance will be most appreciated.

    Thank you.


    You can use a button to display an image and import an image as an icon of the button file programmatically. You will use the field.buttonImportIcon for this JavaScript method.

  • Replace the text

    Hi all

    I need your help regarding replacing the text with other text. I am trying to replace the text '-' with '-'. But I'm not able to get the correct result.

    I'm going to string as value
      '\\Computername\Path\comp_name\\domain\\location' 
    I want to replace the text '-' with '-' only for 2nd and 3rd appearance.

    Replace
     \\domain\\ 
    with
     \domain\ 
    I tried with query below...
    SELECT REGEXP_REPLACE('\\Computername\Path\comp_name\\domain\\location' ,
           '(\\){2,}', '\')
           AS Expression
      FROM dual;
    I get the below result to top query.
      \Computername\Path\comp_name\domain\location 
    But I want the result as below...
     \\Computername\Path\comp_name\domain\location 
    I use Oracke vesion 11g.

    Please help me on this.

    Thanks a lot for your help.

    Hello

    sunitha2010 wrote:
    Hi all

    I need your help regarding replacing the text with other text. I am trying to replace the text '-' with '-'. But I'm not able to get the correct result.

    I'm going to string as value

      '\\Computername\Path\comp_name\\domain\\location' 
    

    I want to replace the text '-' with '-' only for 2nd and 3rd appearance.

    I guess that the 1st appearance will not always be at the beginning of the string.

    Replace

     \\domain\\ 
    

    with

     \domain\ 
    

    I tried with query below...

    > SELECT REGEXP_REPLACE ('\\Computername\Path\comp_name\\domain\\location',

    '(\\){2,}', '\')
    AS Expression
    DOUBLE;

    REGEXP_REPLACE has an optional 3rd argument, which allows you to say what position in the string to begin the search, you can do something like this:

    SELECT  REGEXP_REPLACE ( str
                            , '\\\\'    -- 2 backslashes, escaped.  See note below
                     , '\'
                     , 2 + INSTR ( str
                                       , '\\'
                           )
                     )     AS expression
    FROM    table_x
    ;
    

    In the 2nd argument of REGEXP_REPLACE '-' has a special meaning. To say you want a literal character, you have to escape , by putting a '-' immdiately before the special character, which in this case is be '-' also.

  • Replace the text with formatting

    I need to replace every occurrence of the word with impatience! with forward! in italics. I have not found a way to do... Any ideas?

    Thank you

    JackL

    Captivate 7 - Windows 7

    I have the answer for those who are interested. Captivate (7) lets you export captions and subtitles to Word. Once in Word, simply replace the text sought by the text in the layout you want, save, and then re-import the Captivate projects. Works perfectly, with a caveat. If you use bullets (standard or numbers), the hyphen and the bullet formatting to these legends may require some manual adjustments after importation.

    In any case, this process has saved me a lot, a lot, a lot of hours!

    Jack Loganbill

  • Replace the message "No Items Found" with Javascript

    On this page http://www.sedonamagoretreat.org/test in the second box "Program Dates" in the sidebar on the right, I'm trying to set up a script that I found to replace the "No items found" message with a custom html file.

    The javascript is here: http://www.sedonamagoretreat.org/js/no-items-found.js and here is the html file that is used to replace the message: http://www.sedonamagoretreat.org/prog-dates-alternate-content.

    I'm sure this is an easy fix and I'm just on something... suggestions to get this script working are welcome - thanks!

    Linda

    Well Yes, it's easy to fix.  You are the javascript file requires jQuery is working properly and in the HEAD of your page or the page template you load the '/js/no-items-found.js' before calling jQuery.  Just move this SCRIPT reference in your page or your page template to the bottom of line to make AFTER the dismissal of javascript jQuery.

    Once correct you this error, it seems that the script is a not can prepare to deal with multiple instances of your web applications list.

  • replace the text in the initial value of the attribute

    Hi Forum,

    How to replace the original value of an xml attribute in the world?  I have an indesign document that has the month name attribute and the value jan13issue01.

    See the example below of the existing xml attribute and value.

    month = jan13issue01

    I need to change the value to mar14issue01 above in the world (see below).

    month = mar14issue01.

    Thank you

    LUN

    Good, in condition add attribute name verification.

    If ((elm.xmlElements [i1].xmlAttributes.item (i2) .name == 'months') & (elm.xmlElements [i1].xmlAttributes.item (i2).value.match (RegExp('^jan13'))! = null)) {}

    Kind regards

    Bala

Maybe you are looking for

  • My macbook is infected with a virus, adware?

    I clicked on the quest for the card, and all of a sudden, a red screen on my browser and a popup indicates that my computer is infected with a virus, adware. I read a few other posts telling us a scam, but I can't click out of this! I am in google ch

  • Presario cq70: BIOS admin lost PW

    Mr President. My presario compaq cq 70 I forgot the bios password (Administrator password enter?). After 3 attempts I got a 50061843 code please help me

  • hp110c - 1100ca: need the Bios Master Reset if possible

    Hi I just got this model of mini 110 c - 1100 HP XP it a little more than a member of the family I can't enter the bios Setup: password check failed fatal error... system halted. CNU9462VHT

  • Lack of space on hard drive

    Two days ago, I had 23 GB free on 86.7 GB on my hard drive portable.  Now, after update of Adobe Flash Player and the installation of the Windows updates, I only 3.72 GB left.   I'm looking for on which occupies the entire space?  I use Vista Home Pr

  • While surfing the Internet, the site freezes and give message "program does not.

    Original title: programs not responding I get on sites and a few minutes, the site crashes and it says in the top left corner "program addresses not"... is it my computer?... it's my internet provider?... any suggestions that I can do?