www.webdeveloper.com
Results 1 to 8 of 8

Thread: Parse XML Error

  1. #1
    Join Date
    Jun 2008
    Posts
    4

    Parse XML Error

    Hi,

    I am trying to send data that a user enters into the system via XML. The problem is that some special characters are causing an error, in particular the '' character which is different to the normal minus sign (the only way I know how to get it is using outlook, entering a minus sign then return and it makes the sign larger).

    How can I detect these either on entry or when returning from the database?

    In Firefox it displays � which I don't mind but Internet Explorer returns an error so the page doesn't load.

    Any help would be much appreciated.

    Thanks

    Ben

  2. #2
    Join Date
    Dec 2005
    Location
    India
    Posts
    490
    try setting the content-type header of the XML as UTF-8

  3. #3
    Join Date
    Jun 2008
    Posts
    4
    My header is:
    <?xml version="1.0" encoding="UTF-8"?>

    Is that correct?

  4. #4
    Join Date
    Jun 2008
    Posts
    4
    I changed the encoding to iso-8859-1 and it works, what does this mean, compared to UTF-8?

  5. #5
    Join Date
    Dec 2005
    Location
    India
    Posts
    490
    as far as I understand, that header(XML declaration part) doesn't matter. Only the encoding which you use while the saving the file matters.
    e.g. when u save an XML file to your disk, you need to choose the encoding type (which I see as an equivalent to setting a HTTP header when the XML is returned from a server to client)
    I'm not sure how to set the encoding header in a php script while sending out the XML.. I'll post here if I find any useful information for setting the encoding header.

  6. #6
    Join Date
    Dec 2005
    Location
    India
    Posts
    490
    really.. thts gr8.. my understanding might be wrong in that case
    Are you able to see the symbol properly?

  7. #7
    Join Date
    Jun 2008
    Posts
    4
    In Firefox I can see the character and in IE it doesn't return any error but the character is replaced by a square box.

    It suits my needs for now.

    Thanks

    Ben

  8. #8
    Join Date
    Dec 2005
    Location
    India
    Posts
    490
    This thread not only resolved your issue(atleast as of now), but also unturned some of my wrong concepts..on which I need to do some reading
    thanks to your question

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles