Add XML Tools item to Context Menu
-
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.
-
my first thought was does it not have to be escaped instead - like
&&lt;&&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 -
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. :(
-
Hi Manuel,

there are a couple of spaces in your post which, if used, are incorrect.
What I tried, using python script, is this stringConvert selection text to XML (&&lt;&&gt; => <>)Btw. do you use a different localization?
Cheers
Claudia -
but this string isn’t working when adding to contextmenu - strange.
Is additional c escaping needed? Need to check.Cheers
Claudia -
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; => <>)" />
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 -
It works now!!
Thank you Claudia
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