Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xml parsing with "&", "®", but still getting errors

Everywhere I look, posts are telling me to escape xml special characters with their html entity, but I'm still getting XML parsing errors. The error message I'm receiving is "unidentified entity", and it occurs at the &amp ; and &reg ; marks (without the spaces). How can I fix this and why would this still be throwing errors?

<?xml version="1.0" encoding="UTF-8"?>
<maps>
    <location id="tx">
        <item label="Lobby &amp; Entrance" xpos="125" ypos="112" />
        <item label="Restaurant &amp; Bar" xpos="186" ypos="59" />
        <item label="Swimming Pool" xpos="183" ypos="189" />
        <item label="Nautilus Gym&reg;" xpos="154" ypos="120" />
    </location>
</maps>
like image 717
Stanley Avatar asked Nov 29 '22 16:11

Stanley


1 Answers

Replace: &reg; by: &#174; and &amp; by: &#38;

and your XML will be valid

like image 120
fmsf Avatar answered Dec 05 '22 05:12

fmsf