|
-
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, 10: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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks