Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    expat Cutting off characters after > ?

    Hello, I am working on a rather elaborate XML parsing project using expat and I was looking over my output to verify it and I realized that the character after every > is cut off in the output. It doen't really matter when the next character is an end-of-line, but there are some times that I get spaces between words and even characters in words being cut out. Does anyone have any idea as to what might be doing this. I have source, but it is rather large. If you have any ideas as to what might be doing this without seeing the code, your help would be greatly appreciated. Thanks a lot.
    ~evlich

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I remember this (if it's what I think it is) - it nearly drove me insane Basically - it's a behavior (or bug; don't know which) in the API whereby it splits cdata around entities (and possibly other special characters), and calls a new instance of the parser for each chunk. If you don't allow for this, you lose all but the first or last part of the data.

    You can allow for it with string concetenation; something like

    $var .= $data;



    Check out http://www.php.net/manual/en/ref.xml.php for more (the notes at the bottom are particularly helpful; where I found this answer)
    Last edited by brothercake; 03-13-2003 at 08:17 PM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I solved it, I was doing some substinging wrong in the read loop. Sorry to havve bothered everyone.
    ~evlich


  •  

    Posting Permissions

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