RE: [xml] FW: SAXHandler is not reset



Daniel,

Sorry for the mess in sources. Of course I had to provide clean sources. I'm sorry.

But your advice helped anyway.
I found the reason of my problem.
The reason was that I named handler functions for SAX with the EXACT SAME NAME as they are in libxml2.

Once I used your compilation options for gcc I've got the following:
/usr/lib/libxml2.a(SAX.o)(.text+0x1760): In function `startElement':
: multiple definition of `startElement'
/tmp/ccIwDgGo.o(.text+0x0):/home/alex/code_testing/test_c/tst.c:10: first defined here
/usr/bin/ld: Warning: size of symbol `startElement' changed from 101 to 1035 in /usr/lib/libxml2.a(SAX.o)
collect2: ld returned 1 exit status

Thank you very much.

Regards.
Alexei Snisarenko.

-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com]
Sent: Friday, May 06, 2005 2:05 PM
To: Alexei Snisarenko
Cc: xml gnome org
Subject: Re: [xml] FW: SAXHandler is not reset

On Fri, May 06, 2005 at 01:24:10PM +0400, Alexei Snisarenko wrote:
Here is complete cutnpaste of my example. It can be compiled and run.

  So it's my job to remove all the XPath stuff which is obviously
unrelated to the problem based on your description ?

  Anyway I compiled it, lots of warnings the code doesn't look clean at all:

paphio:~/XML -> g++ -g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment 
-Wtrigraphs -Wformat
-Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings 
-Waggregate-return
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall -Iinclude -o tst 
tst.c .libs/libxml2.a
-lpthread -lm -lz
tst.c:14: warning: unused parameter 'Ctx'
tst.c:14: warning: unused parameter 'Name'
tst.c:14: warning: unused parameter 'Atts'
tst.c:45: warning: missing initializer for member `_xmlSAXHandler::externalSubset'
tst.c:45: warning: missing initializer for member `_xmlSAXHandler::initialized'
tst.c:45: warning: missing initializer for member `_xmlSAXHandler::_private'
tst.c:45: warning: missing initializer for member `_xmlSAXHandler::startElementNs'
tst.c:45: warning: missing initializer for member `_xmlSAXHandler::endElementNs'tst.c:45: warning: missing 
initializer for member
`_xmlSAXHandler::serror'
paphio:~/XML ->

  Then ran it on a local test:

paphio:~/XML -> ./tst tst.xml /
DEBUG OUTPUT SHOULD NOT OCCUR AFTER THIS LINE!!! 118
Text to parse:
<?xml version="1.0"?>
<!DOCTYPE script SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<script type="text/javascript"><![CDATA[
document.write("hullo");
]]></script>

Result (1 nodes):
= node "(null)": type 9
paphio:~/XML ->

  I don't see any "XXX DEBUG is called" output !

 I don't know what is broken on your side, but maybe you miscompiled it
or something... I can't reproduce your problem.
 Please trim down your example to just the problem seen, make sure you compiled
correctly and against the right headers and libraries, and only if you can
reproduce the problem after making sure all is correct then repost clean code,
how you compiled it, the library version used, and then I will try to reproduce
the problem again.

Daniel

--
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]