amp;
is missing from your output because:
The ampersand character (&) and the left angle bracket (<) may appear in their literal form only when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings "&amp;" and "&lt;".
Therefore, when the parser encounters &
, it parses it to be just a single &
.
If you're truly interested in the original string, I suggest you escape the relevant section via a CDATA
section (a CDATA
section starts with <![CDATA[
and ends with ]]>
), as follows:
<root>
<kiddy> shghsgdh ; sdjhgsjhsjdh ; sjhsjhdsjdh </kiddy>
<kiddy name="All Shows" thumb="special://home/addons/plugin.video.plexbmc/resources/plex.png"><![CDATA[ActivateWindow(10025,"plugin://plugin.video.plexbmc/?mode=0&url=http%3a%2f%2f192.168.0.1%3a32400%2flibrary%2fsections%2f2%2fall",return)]]></kiddy>
</root>
This is a link to a concise read on the subject.
To illustrate this better, I'll show you how this should look with your updated example (for completeness' sake I've added another line that includes the string "
):
<root>
<kiddy><![CDATA[ shghsgdh & sdjhgsjhsjdh & sjhsjhdsjdh ]]></kiddy>
<kiddy><![CDATA[ xxxx & xxxxx & xxxxx ]]></kiddy>
<kiddy><![CDATA[ xxxx " xxxxx " xxxxx ]]></kiddy>
</root>
Alternatively, you can also escape just those particular &
character you want to, by adding the string amp;
after each &
character, thus creating the escaped string &
which is parsed to &
. This can be safely followed by your original string (amp;
or quot;
), without fear of it being escaped, as it is not prefixed by the character &
. I hope that an example would clarify this (imagine how each &
is parsed to the character &
):
<root>
<kiddy> shghsgdh &amp; sdjhgsjhsjdh &amp; sjhsjhdsjdh </kiddy>
<kiddy> xxxx &amp; xxxxx &amp; xxxxx </kiddy>
<kiddy> xxxx &quot; xxxxx &quot; xxxxx </kiddy>
</root>