Removing tags on selection

Hi all,
I think I've read all the topics about this "subject" but I still did not found a solution with it, so I'll tell my problem and hopefully you have a solution for me ;-)
I am writing a WYSIWYG editor and it is possible to switch from HTML to Plain (source code view). When a user selects some text and give that selection the element H1 and the text was a div class like:
<div class="redtext">This is my text</div>
I would like to get:
<h1>This is my text</h1>
Another problem is, when someone made a sentence h1 and later on he discover that he would like to have a h3 tag instead, the h1 tag still exists and I would like to remove that too.
I have already a function from this forum that removes the tags from a string but I do not know how to get the source from the HTML textpane. If I select "This is my text" in the HTML textpane the getSelectedText() returns (logically) "This is my text" I would like to get the HTML source from it! :-) thus like: <div class="redtext">This is my text</div>
Is there someone who can help me with this?
I hope I made myself clear, and if I did not ask me for further details...
Thanks,

The problem is that I only have to remove the tags from the selected text. When I use the function getSelectedText() I only get the text, and not the text including his h tags.
And I do not know how to get the source from the selection.. I only can get the whole source with the getText() function...
:S

Similar Messages

  • Impact of selecting "Removing Query from Selection List" in 2 channels.

    HI All ,
    I have customized a query in one channel (My Agreements and Contract Documents query in Master Agreements List channel) and have removed the standard query from the channel by checking the  "Remove Query from Selection List" and introduced my custom query in that query group .
    But  it resulted in break in chain for  "Master Agreements" link in "Contracts To Do List" channel as the link was pointing to standard  "My Agreements and Contract Documents" query and is displaying "The query can not be executed. Contact your system administrator" when ever I click on that.
    Any pointers on how to overcome above scenario wud be gr8!
    Regards,
    Uday

    Hi Uday,
    In order for To Do List channel to work, the query definition should be in the Master Agreement List query group. Do you still want the standard query in the To Do List? If so, you would have to leave it on the Query Group as To Do list is pointing to it. May be change the display name of the query so you can differentiate between the 2 queries. The other option is change the To Do channel to point to the custom query.
    Regards,
    Vikram

  • How to remove tag using filter

    I want to use a filter to remove tags already on emails. I can add tags using a filter but cannot see how to remove tag using filter.

    The FiltaQuilla add-on provides a "remove tag" option.
    https://addons.mozilla.org/en-US/thunderbird/addon/filtaquilla/
    http://www.ramsden.org.uk/3_How_to_install_Add-ons_in_Thunderbird.html
    But, out of interest, what's the use case for removing tags by filter? Tags are normally used to facilitate or prompt human intervention and I don't immediately see the value of clearing a tag in a filter. Why tag if a filter will be dealing with it anyway?

  • [CS3][JS] Apply XML tag for selected text

    Hi
      I need to apply XML tag to selected text in a tagged content.The XML tag is already applied for paragraph.I need to apply XML Tag for selected text in a paragraph.
    I have used following code, it applies tag for entire paragraph,not a selected text in a paragraph.
    app.selection[0].associatedXMLElements[0].markupTag=myDoc.xmlTags.item("italic");
    Please suggest me.
    Regards
    kumar

    The example script, markup.jsx
    //Markup.jsx
    //An InDesign CS4 JavaScript
    //Shows how to use the markup method.
    main();
    function main(){
        mySetup();
        mySnippet();
        myTeardown();
    function mySetup(){
        var myDocument = app.documents.add();
        var myPage = app.activeWindow.activePage;
        var myRootXMLElement = myDocument.xmlElements.item(0);
        var myXMLTag = myDocument.xmlTags.add("xml_element");
        var myXMLElementA = myRootXMLElement.xmlElements.add(myXMLTag);
        myXMLElementA.contents = "This is a paragraph in an XML story.";
        var myTextFrame = myPage.textFrames.add({geometricBounds:myGetBounds(myDocument, myPage)});
        myTextFrame.contents = "This is the first paragraph in a text frame.\rThis is the second paragraph in a text frame.\rThis is the third paragraph in a text frame.\rThis is the fourth paragraph in a text frame.\r";
    function mySnippet(){
        //<fragment>
        var myDocument = app.documents.item(0);
        var myPage = myDocument.pages.item(0);
        myDocument.xmlElements.item(0).xmlElements.item(0).markup(myPage.textFrames.item(0));
        //</fragment>
    function myTeardown(){
    function myGetBounds(myDocument, myPage){
        var myPageWidth = myDocument.documentPreferences.pageWidth;
        var myPageHeight = myDocument.documentPreferences.pageHeight
        if(myPage.side == PageSideOptions.leftHand){
            var myX2 = myPage.marginPreferences.left;
            var myX1 = myPage.marginPreferences.right;
        else{
            var myX1 = myPage.marginPreferences.left;
            var myX2 = myPage.marginPreferences.right;
        var myY1 = myPage.marginPreferences.top;
        var myX2 = myPageWidth - myX2;
        var myY2 = myPageHeight - myPage.marginPreferences.bottom;
        return [myY1, myX1, myY2, myX2];
    I think you can use the markup function on the selected item (Text Object have a markup method)
    Thomas B. Nielsen
    http://www.lund-co.dk

  • Create new tag for selected text using API?

    Hello,
    I want to add new tag for the selected text just like 'Create Tag from selection' .
    is it possible to create tag for selected text using acrobat api?
         please,help me.

    As per sample of snippetRunner for adding tag for selected text.
    I tried below code
    PDPage pg;
    AVDoc avDoc = AVAppGetActiveDoc();
    PDDoc pd = AVDocGetPDDoc(avDoc);
        pg = PDDocAcquirePage(pd, 0);
    ASAtom theSelectionType = AVDocGetSelectionType(avDoc);
    if (theSelectionType == ASAtomFromString("Text")){
        PDTextSelect ts = static_cast<PDTextSelect>(AVDocGetSelection(avDoc));
        PDSTreeRoot pdsTreeRoot;
        CosObj pageObj = PDPageGetCosObj (pg);
        PDSElement newElem;
        PDSElementCreate(pd, &newElem);
        char buf1[64];
        strcpy (buf1, "A new structure element");
        // set its type as "Document" standard type
        PDSElementSetType(newElem, ASAtomFromString ("Document"));
        // set its title
        PDSElementSetTitle(newElem, reinterpret_cast<const ASUns8*> (buf1), strlen(buf1));
        PDSTreeRootInsertKid (pdsTreeRoot, aElem, kPDSAfterLast);
        PDSElementInsertMCAsKid // here something i have to add
    If i have PDTextSelect how i can add tag for selected text.like user add tag using "CreateTagForSelectedText" option.
    please,help me.
    thanks.

  • How to remove tags (not color tags)

    How to remove tags (not color tags)
    I love the idea of the tags, however there comes a point when some become irrelevant.  How can I remove them.  I highlighting them in the dialogue box and hitting the delete key, that does not work.  ?

    I accidentally found that you can remove some tags while in the Sidebar view by just draggng them to the trash.
    But after a certain point when you have drug all of tags in the list, you are then left with the "All Tags" button. When you click on that final button, you find that all of the tags you have ever created are still there in the All Tags category. So I guess what I do is just not create any new tags because the list just becomes too long to be useable. I liked the idea of Tags as a management tool, but like so many times before I will just go back to the file name workarounds that I have been using since 1988.  They work because they were developed and tested by an actual user, me.  Just toss a project number into the file name.  Works every time, unlike the undocumented "features" that are apparently not tested.
    But, if what I hear is true that Apple does not monitor these discussions, what was the point of writing this.
    Would like to think they would look at these "discussions" as a resource, but.......

  • Having problems removing tags from script.

    I'm not using the browser to run Adobe Story, but the Desktop version from my iMac.  Cmd + Double Click works, but once every 30 times.  Is anyone else having this problem removing tags from a script?

    There are other ways to remove tags from a script
    From Tagging Panel:
    - Open Tagging Panel from View Menu
    - Click on Edit button. Here you have the option to delete individual tag-items or remove all from the scene.
    From File Menu
    - Open File - Tagging menu
    Here you will find the options to delete all/manually added/automatically added tags.

  • Remove Tag Contents In Dreamweaver?

    I have a XML file that has about 40 lines of code. Some of the tags have content inside and some are empty. I want to create a XML template out of this file for future use where I can easily insert the desired text into the empty fields.
    I need a command in Dreamweaver that I can use line by line to remove the content inside each set of tags, but leaving the tags themselves intact (so I can insert text into in the future).
    What command in Dreamweaver CS4 will easily clear these fields while preserving the tags themselves?

    rotoscopels wrote:
    Is the information your requesting not in the above post? You can clearly see the text in the tags I need removed is 5.0, 121 and 1. Is that not what your asking for?
    No, it's not. As I've said before, Dreamweaver cannot search and replace by line number.
    What it can do is search for patterns. If you want to remove the values from the  <version>, <duration>, and <titleNum> elements, you can do so with the following regular expression in the Find and Replace dialog box:
    Search: Source Code
    Find: (<(version|duration|titleNum)>)[^<]*(<\/\2>)
    Replace with: $1$3
    Make sure the "Use regular expression" check box is selected, and click Replace All.
    That will leave the tags, but remove the text from between them.
    If you want to remove the tags as well, just leave the "Replace with" field blank.
    However, and this is where it becomes difficult to provide the answer you need, the regular expression I have created won't remove the value from <movieReleaseYear>.
    Are you looking to remove all values or just some?
    Since it's XML, and you can predict the line numbers, you must be able to predict the names of the elements you want to clear. Or are the element names going to be different?

  • HOW TO SELECT MIN VALUE UNDER DEFAULT TAG OF SELECT LIST

    GREETINGS,
    I M USING APEX 4.1 AND CREATED SELECT LIST ON PAGE, I WANT TO SHOW MIN VALUE OF THE SELECT LIST FOR THAT I WROTE IN THAT SELECT LIST PROPERTIEC UNDER DEFAULT TAG MIN; AND CHOOSE PL/SQL EXPRESSION BUT ITS GIVING ERROR "Error computing item default value for page item P1_PRODUCT."
    BUT IF I HARCORE THE VALUE CONTANING IN MY DATA LIKE PRODUCT ID = 1, I HARDCODED IN DEFAULT VALUE 1 AND SELECT PL/SQL EXPRESSION IT WORKS.
    BUT ITS NOT DONE LIKE THIS I WANT TO SELECT BY DEFAULT MIN VALUE OF THE SELECT LIST, SO THAT THE DATA SHOULD BE DISPLAYED ACCORDING TO THAT.
    THE EXACT REQUIREMNT IS TO ENTER THE SELECT LIST DEFULAT VALUE IN SESSION SO THAT DATA IS TO BE DISPLAYED

    Hi,
    you have some options:
    1) you can try setting default value of P1_SELECT_PRODUCT item, I was do it
    2) or you can try send the value of P1_SELECT_PRODUCT value in URL, like this:
    http://apex.oracle.com/pls/apex/f?p=45296:1:0::::P1_SELECT_PRODUCT:4
    3) or you can set the session state of P1_SELECT_PRODUCT item on page 101 (login page) by seting this value in Login process on page 101
    HELLO kIAS !
    SETTING DEAFULT VALUE VALUE OF P1_SELECT_PRODUCT_ITEM IS NOT A SOLUTION ON THIS MATTER, BECASUE P1_SELECT_PRODUCT IS CALLED DYNAMICALY AFTER THE LOGIN DEPEND UPON THE RIGHTS OF THE USER THE SELECT IS POPULATED ID USER IS E.G ABC AND IT DOESBNOT CONTAIN SELECT LIST VALUE 4 THEN IT DISPLAY NOTHING.
    AND THIRD POINT MAY BE HELP ME BUT I DONT KNOW HOW TO SET SESION STATE BECASUE WHEN I GO TO LOGIN PAGE AND CREATE SESSION STATE PROCESS FOLLOWING RADIO BUTTOPN APPEARS
    Clear Cache For Applications (removes all session state for listed applications)
    Clear Cache For Current Application (removes all session state for current application)
    Clear Cache For Current Session (removes all state for current session)
    Clear Cache for Items (ITEM,ITEM,ITEM)
    Clear Cache for all Items on Pages (PageID,PageID,PageID)
    Reset Preferences (remove all preferences for current user)
    Set Preference to value of Item (PreferenceName:ITEM)
    Set Preference to value of Item if item is not null (PreferenceName:ITEM)
    WHICH ONE I HAVE TO SELECT ?

  • Remove tag

    hoe do I remove a given tag in a file?

    There are a number of ways. 1 is to select the item in the Finder and then Get Info (right click to see a menu of options or look under the File menu for Get Info). There is a comment box where the tags go. Click inside and backspace over the tags.
    I use tags a lot so I added a tag icon to my Finder window. Open a window, right click somewhere on the grey command box of the window and select Customize Toolbar. Select the Edit Tags item and drag it onto the command bar. (While you are there are there others you'd like added?) Now you can easily select the item and then click on the Tag Editor to add a tag, delete a tag etc

  • How to remove tags from a folder

    I have reset my tags, but I still have a few folders that will not allow me to remove the colour tag. On other folders I simply clicked the X in the coloured dot to remove the tag, but a few the opition is greyed out. I also tried checking and unchecking the tag colours in the Finder>Preferences menu.
    These folders that seem to be affected at the ones I had originally tagged with the old system where it highlighted the whole text.

    I solved my own problem.
    The "Blue" tag was a duplicate tag from the old system. So I had two blue dots with different labels. To fix it I right clicked on the old blue dot in the left side bar of finder and deleted it. I did this for all of the duplicate coloured tags.

  • How to remove spaces at selection screen coming from logical database

    Hi Experties,
    When we hide some selection from the logical database.  The spaces still occupied and this make our selection screen looks awkward.
    How to remove the spaces left by hidden selection ?
    Regards
    Nislina

    Hi,
    I came across your un-answered question while searching for a solution on the similer problem. Though I couldn't fine a solution on SDN, but figured out one myself. Thought its a good idea to share it.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group4 = '003'.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Here screen-group4 contains the sequence number of the select-options field starting from 000 onwards.
    You may like to assign points and close the question.
    Kind Regards,
    Khalid Mustafa

  • Remove tags from XML using transformation

    Can anybody tell me how to remove empty tags using xsl transformation.
    <App_Data App="MOD" Name="Metadata_Id" Value="SP1282"/>
    <App_Data App="MOD" Name="Metadata_Spec_Major_Version" Value=""/>
    <App_Data App="MOD" Name="Metadata_Spec_Minor_Version" Value=""/>
    My XML will have tags similar to above. My requirement is to remove all tags having attribute Value="". How can i achieve this using transformation.
    Thanks
    Krish

    You need to add the xsi:nil="true" attribute to your xsl-construct to be able to ommit the xml-element which are empty.
    To be able to do this you need to add a choose-when-otherwise xsl construct inside your mapping file to test for ""-values.
    The xsi:nill='true' isn't supported in the transform-activity yet, you need to add this attribute manually inside your xsl-mapping file.
    Kind regards,
    Nathalie

  • Remove arrow from selection screen

    Hallow I have a arrow in my selection screen (for multiefile selection) and I wont to <b>remove</b>
    It from my selection screen how can I do that?
    (i remove x from set_mode but its not working)
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS c_course FOR pchdy-objid_str NO INTERVALS OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR c_course-low.
    *======================================================
      REFRESH: c_course.
      CLEAR:  c_course.
      PERFORM get_objid USING 'E '
                        CHANGING c_course-low.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR c_course-high.
    *======================================================
      REFRESH: c_course.
      CLEAR:  c_course.
      PERFORM get_objid USING 'E '
                        CHANGING c_course-high.
    CALL FUNCTION 'RH_OBJID_REQUEST'
         EXPORTING
           plvar                   = '01'
           otype                   = p_otype
            seark                   = '*'
          seark_begda             = sy-datum
          so_date-low
          seark_endda             = sy-datum
          so_date-high
          set_mode                = 'X'   "When active moltefile selection
      DYNPRO_REPID            = ' '
      DYNPRO_DYNNR            = ' '
      DYNPRO_PLVARFIELD       = ' '
      DYNPRO_OTYPEFIELD       = ' '
      DYNPRO_SEARKFIELD       = ' '
      CALLBACK_PROG           = ' '
      CALLBACK_FORM           = ' '
      RESTRICT_FB             = ' '
      RESTRICT_DATA           = ' '
      WITHOUT_RSIGN           =
      WITHOUT_RELAT           =
      WITHOUT_SCLAS           =
      ORGBEG                  = SY-DATUM
      ORGEND                  = SY-DATUM
      WIN_TITLE               =
      APP_DATA                =
         IMPORTING
           sel_plvar               = wa_plvar
           sel_otype               = wa_otype
           sel_object              = wa_objid
       TABLES
      OTYPE_TABLE             =
      CONDITION               =
      BASE_OBJECTS            =
      MARKED_OBJECTS          =
         sel_objects             = itab_object
      SEL_HROBJECT_TAB        =
      SEL_HRSOBID_TAB         =
         EXCEPTIONS
           cancelled               = 1
           wrong_condition         = 2
           nothing_found           = 3
           internal_error          = 4
           illegal_mode            = 5
           OTHERS                  = 6
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF wa_otype = 'E' .
        REFRESH: c_course.
        CLEAR:  c_course.
        LOOP AT itab_object.
          CLEAR c_course.
          c_course-low    = itab_object-objid.
          c_course-option = 'EQ'.
          c_course-sign   = 'I'.
          APPEND c_course.
        ENDLOOP.
        CLEAR:   itab_object.
        REFRESH: itab_object.
      ENDIF.

    Add the NO-EXTENSION  to your SELECT-OPTIONS will remove the arrow.
    For more complex control off the SELECT-OPTIONS you can use FM: SELECT_OPTIONS_RESTRICT where you can almost completelly control the options.
    (Look at <a href="http://www.geocities.com/victorav15/sapr3/abapfun.html#screen">SELECT_OPTIONS_RESTRICT</a>
    Regards

  • Custom tag for selecting BW images

    I wish LR had a filter button to select the images converted to grayscale via Treatment command or 'V' button. For now I have to flag 'em either by star rating (and keep in mind not to do that with color photos) or color tagging.

    >ps Do you also have to use such a user name? I'm sure you're a perfectly nice bloke but take an instant dislike to your virtual self for parading such beliefs in this forum. It would be great if you could have a neutral user name.
    Also it might avoid OT, and in appropriate comments form other users, such as the one with 666 in his user name.
    Any long time reader here knows I like a bit of frivolity in the forum, myself, but this seems beyond that.
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core running 10.4.10 & Win XP, Pentax *ist D
    See LR Links list at my
    Blog for related sites.

Maybe you are looking for