SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2001
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    invalid characters in XML

    I try to write a PHP function to output XML.

    However, in the file I created, there are =, &, <, > which IE5 tells me that they are invalid characters.

    My question: is there a list that I can follow to replace these characters with XML-compatible codes?

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try declaring these elements as CDATA in your XML-output:

    <?xml version="1.0" encoding="UTF-8"?>
    <Test><![CDATA[Blah = this & 'foo' = jack:@ whatever < > blah....]]></Test>

  3. #3
    Rehab is for quiters! spartan's Avatar
    Join Date
    Apr 2002
    Location
    Cape Town, South Africa
    Posts
    343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    would this work??

    never tried it, but can't you just replace with "&lt;", "&gt;" equivalent... like ....

    [VBS] replace(string,">","&gt;") [/VBS]
    ???
    Last edited by spartan; Apr 29, 2002 at 01:13.
    Spartan
    ---------------------
    It's like our sergeant told us before one trip into the jungle. Men! Fifty of you are leaving on a mission. Twenty-five of you ain't coming back.
    -Mr.Payne


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •