Menu

Bug ??

Help
2008-05-19
2013-04-11
  • Nobody/Anonymous

    Hello I am using SAX with SaxExpat.dll and I am trying to parse a normal .xml file

    This is a part of it

    <?xml version="1.0" encoding="utf-8"?><std version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><header><date>2008-05-12</date><time>11:40:00</time> ....

    What I don't really understand is why when I get to the start element time ( <time>11:40:00</time> ) the char array passed as parameter to the method Characters is this one:

    "11:40:0012\0\0\0\0\0\0"

    1. What's with the extra \0 added ?
    2. And most important, whats with the extra 12 added at the end of the time ?

    It is very weird.

    Thank you,
    Andrei

     
    • Nobody/Anonymous

      I can't believe it ...

      I think I have an idea ... but stil .. why ???

      So as I said in the previous post ... I am getting "11:40:0012\0\0\0\0\0\0" when I try to read the previous posted .xml file.

      This is because the first time the method characters gets called I get "2008-05-12\0\0\0\0\0\0".

      The next time I get "11:40:0012" which is the char array "11:40:00" overlaid on "2008-05-12" so that "11:40:00" covers the "2008-05-" part of the first char array.

      I tested the behaviour on the next time the Character method is called and it is the same behaviour ... I haven't had the time to look in the source code .. but ... is this happening only to me ??

      Andrei

       
      • Karl Waclawek

        Karl Waclawek - 2008-05-19

        What are the values for the start and length parameters in the Characters() method?

         
    • Nobody/Anonymous

      Yes,

      I am sorry, I haven't had the time to look in the source code before posting. It is obvious that the behaviour is logical.

      All I had to do is try to understand how it works.

      Thank you,
      Andrei

       

Log in to post a comment.