Community
    • Login

    Add XML Tools item to Context Menu

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 2 Posters 5.2k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Manuel ColladoM Offline
      Manuel Collado
      last edited by

      Hello
      I am trying to add a XML Tools plugin Item in the Context Menu. The name of the item is “Convert selection text to XML (&& lt; && gt; => <>)”. I have added this line to the contextMenu.xml file:
      <Item FolderName = “XML Tools” PluginEntryName = “XML Tools” PluginCommandItemName = “Convert selection text to XML (&& lt; && gt; => <>)” ItemNameAs = “Replace lt and gt” />

      I have tried to replace the escape characters with their corresponding string, but it does not work.

      Can you help me?

      Thank you.

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Manuel Collado
        last edited by

        @Manuel-Collado

        my first thought was does it not have to be escaped instead - like

        &amp;&amp;lt;&amp;&amp;gt; ...
        

        because when xml parser parses this line

        “Convert selection text to XML (&& lt; && gt; => <>)”
        

        I would expect an error complaining that & & isn’t correct.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Manuel ColladoM Offline
          Manuel Collado
          last edited by

          Hi Claudia
          I have tried with:

          <Item FolderName=“XML Tools” PluginEntryName=“XML Tools” PluginCommandItemName=“Convert selection text to XML (& amp;& amp;lt; & amp;& amp;gt; =& gt; & lt;& gt;)” />

          (Note that I put a space between & and following char for the correct display in the forum. In the file code this space does not exist)

          but it still does not work. :(

          Claudia FrankC 2 Replies Last reply Reply Quote 0
          • Claudia FrankC Offline
            Claudia Frank
            last edited by

            Hi Manuel,

            there are a couple of spaces in your post which, if used, are incorrect.
            What I tried, using python script, is this string

            Convert selection text to XML (&amp;&amp;lt;&amp;&amp;gt; =&gt; &lt;&gt;)
            

            Btw. do you use a different localization?

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • Claudia FrankC Offline
              Claudia Frank @Manuel Collado
              last edited by

              @Manuel-Collado

              but this string isn’t working when adding to contextmenu - strange.
              Is additional c escaping needed? Need to check.

              Cheers
              Claudia

              1 Reply Last reply Reply Quote 0
              • Claudia FrankC Offline
                Claudia Frank @Manuel Collado
                last edited by

                @Manuel-Collado

                Hi Manuel,

                you need to do exactly the opposite from what we thought needs to be done.
                Omit the first two && to get

                    <Item PluginEntryName="XML Tools" PluginCommandItemName="Convert selection text to XML (lt;gt; =&gt; &lt;&gt;)" />
                

                If you are interested in why this is the case checkout the
                purgeMenuItemString function with having in mind that it will be called with keepAmpersand=false in this case.

                Cheers
                Claudia

                1 Reply Last reply Reply Quote 2
                • Manuel ColladoM Offline
                  Manuel Collado
                  last edited by

                  It works now!!
                  Thank you Claudia

                  1 Reply Last reply Reply Quote 1

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors