Results 1 to 4 of 4

Thread: error caused from xml content

  1. #1
    Join Date
    Apr 2010
    Location
    University of Illinois
    Posts
    86
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default error caused from xml content

    If for some reason a " " gets into my xml document (from me accidently hitting the space bar twice or something), when I load the xml onto my web page I get an error that the parser does not know what “&nbsp” is (notice it does not add the “;” even though it is in the xml document with the rest of the space tag)

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It may be somehow messy in the document so that the parser is reading it in the wrong way, or the parser may not handle entities. XML is not XHTML: it's just like a text-file database format, that in some cases happens to be XHTML. But perhaps the parser isn't designed to handle the HTML aspects.
    Also, it might just be displaying &nbsp and really be referring to  , but we can't really know that.
    I don't see a clear reason for this to happen, but I'd suggest not using entities like that and instead escaping them after you load the XML.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2010
    Location
    University of Illinois
    Posts
    86
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default

    Quote Originally Posted by djr33 View Post
    I don't see a clear reason for this to happen, but I'd suggest not using entities like that and instead escaping them after you load the XML.
    how would you excape them after loading the xml?

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Loop through the data.
    As has been said before, this would all be easier using a database. It's possible in XML, but little problems like this are going to be a lot more difficult to handle.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •