libcurl and expat

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sylvain/11XX

    libcurl and expat

    Dear all,

    In order to retrieve and parse a XML document over internet (through http) I
    use libcurl and expat in my C program.

    For some long item I have 2 callback, that's ok for the moment.
    But I loose a caractere between first and second buffer (always a '&').

    Se the following example :

    My item :
    <UrlDir>http://www.toto.titi.com/setupapp/gn...p?param1=&ghjf
    =lver</UrlDir>

    First time in my callback (data handler) I have :


    Second time in my callback I have :
    ghji=lver

    Do you have an idea for the '&'.

    I'm a newbie in XML and expat (like in libcurl) but I need to use these
    tools in order to finish my job quickly.

    Could you help me, please ...

    Best regards,

    Sylvain


  • Joe Kesselman

    #2
    Re: libcurl and expat

    Sylvain/11XX wrote:[color=blue]
    > http://www.toto.titi.c om/setupapp/gnagnagna/nunuche.asp?par am1=&ghjf=lver</UrlDir>[/color]

    That isn't well-formed XML, and your parser shouldn't be accepting it at
    all.

    Either the & introduces an XML Entity Reference or Character Reference,
    in which case there should be a ; to end it (for example &foo; or
    &#55;), or it needs to be escaped as &amp; or &#38; or &#x26;

    Comment

    Working...