Add XML Tools item to Context Menu
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?
my first thought was does it not have to be escaped instead - like
because when xml parser parses this line
“Convert selection text to XML (&& lt; && gt; => <>)”
I would expect an error complaining that & & isn’t correct.
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. :(
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 (&&lt;&&gt; => <>)
Btw. do you use a different localization?
but this string isn’t working when adding to contextmenu - strange.
Is additional c escaping needed? Need to check.
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.
It works now!!
Thank you Claudia