Re: [xml] Weird parser problem (more info)



That is because I was being vague (like an end-user). It was just failure to test the type combined with the fact that the parser creates nodes with "text" in the name field and the tag I was looking for was "text" and I was getting the wrong node (type 3 instead of type 1).

At 03:46 PM 8/23/2004, William M. Brack wrote:
I'd really like to help, but I don't see how I can....

Eric S. Eberhard said:
> More information ... it is in the tree (prints when I dump it).
>
> The function xmlNodeListGetString fails because the type is zero rather
> than 1-20 (XML_ELEMENT_NODE thru XML_XINCLUDE_END).
>
> If I traverse manually it finds it ...
>
> Weirdness

What "type is zero"?  In what manner does "xmlNodeListGetString fails"?

bill bbrack work $ cat test.xml
<root><text>hello</text></root>

bill bbrack work $ xmllint --version
xmllint: using libxml version 20612-CVS2138
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude
Iconv MemDebug Unicode Regexps Automata Schemas

bill bbrack work $ gdb xmllint
GNU gdb 6.1.1
  <snip>
(gdb) b 1075
Breakpoint 1 at 0x804ae32: file xmllint.c, line 1075.
(gdb) r
  <snip>
Breakpoint 1, parseAndPrintFile (filename=0xbffff577 "test.xml", rectxt=0x0)
    at xmllint.c:1075
1075                    doc = xmlReadFile(filename, NULL, options);
(gdb) u
1082        if (doc == NULL) {
(gdb) p *doc->children
$2 = {_private = 0x0, type = XML_ELEMENT_NODE, name = 0x812609b "root",
children = 0x8126640, last = 0x8126640, parent = 0x81264b8, next = 0x0, prev
= 0x0, doc = 0x81264b8, ns = 0x0, content = 0x0, properties = 0x0, nsDef =
0x0, psvi = 0x0, line = 1, extra = 0}
(gdb) p *doc->children->children
$3 = {_private = 0x0, type = XML_ELEMENT_NODE, name = 0x81260a0 "text",
children = 0x81266a0, last = 0x81266a0, parent = 0x81265e0, next = 0x0, prev
= 0x0, doc = 0x81264b8, ns = 0x0, content = 0x0, properties = 0x0, nsDef =
0x0, psvi = 0x0, line = 1, extra = 0}
(gdb) p *doc->children->children->children
$4 = {_private = 0x0, type = XML_TEXT_NODE, name = 0x80eaee4 "text",
  children = 0x0, last = 0x0, parent = 0x8126640, next = 0x0, prev = 0x0,
  doc = 0x81264b8, ns = 0x0, content = 0x8126560 "hello", properties = 0x0,
  nsDef = 0x0, psvi = 0x0, line = 0, extra = 0}

> At 01:22 PM 8/23/2004, Daniel Veillard wrote:
  <snip>
>>   Specify what doesn't work and provide a reproductible test case
>> please,
>>c.f. http://xmlsoft.org/bugs.html
>>Daniel

Can you "provide a reproducible test case" please?  What you have provided so
far is obviously not enough for people to attempt to solve your problem.

Bill

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml

Eric S. Eberhard
(928) 567-3727          Voice
(928) 567-6122          Fax
(800) 569-1122 Denver Office (I am never there, you can leave a message)

928-301-7537 -- you may call any time day or night, I turn it off when I sleep :-) Please try to use a land line first (reception often poor).



http://www.vicspdi.com

Completely updated web site of personal pictures with many new pictures! Includes horses, dogs, Corvairs, and more.

http://www.vicspdi.com/ourpics/index.html




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