-
Escaping special characters in XML
Hello all,
I'm a newbie at XML and I've been struggling to get information on escaping special characters in XML sent by third party.
Below is the complete XML and PHP script.
XML game element containt special character "&".
I was hoping if someone could explain what can be done to detect and escape the special characters in the XML.
Many thanks,
Andrew
XML:
<element1>
<day id="1">
<game id="1" name="South Africa & Mexico" date="11/06/2010" time="17:30">
This is a bit of description about the the South Africa vs Mexico Game.
</game>
</day>
</element1>
PHP:
<?PHP
$xml = simplexml_load_file("xml.xml");
$game = $xml->xpath("//game");
echo $game[0]['name'];
?>
Similar Threads
-
By jason213123 in forum .NET
Replies: 0
Last Post: 03-27-2010, 09:08 AM
-
By Sarvanprakash in forum XML
Replies: 1
Last Post: 06-08-2009, 10:51 AM
-
By Harish Kumar in forum XML
Replies: 7
Last Post: 11-14-2001, 11:19 AM
-
By marlene leach in forum XML
Replies: 1
Last Post: 08-09-2001, 04:31 PM
-
By Tim Frost in forum xml.announcements
Replies: 0
Last Post: 04-02-2001, 10:53 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|