1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-01 10:06:59 +03:00

change verbosity depending on API get back to previous outputs Daniel

* debugXML.c: change verbosity depending on API
* result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: get back
  to previous outputs
Daniel
This commit is contained in:
Daniel Veillard
2005-08-25 14:03:56 +00:00
parent 8874b94cd2
commit cfa303ac70
15 changed files with 67 additions and 52 deletions

View File

@ -1,3 +1,9 @@
Thu Aug 25 16:03:05 CEST 2005 Daniel Veillard <daniel@veillard.com>
* debugXML.c: change verbosity depending on API
* result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: get back
to previous outputs
Thu Aug 25 15:14:56 CEST 2005 Daniel Veillard <daniel@veillard.com> Thu Aug 25 15:14:56 CEST 2005 Daniel Veillard <daniel@veillard.com>
* HTMLparser.c parser.c SAX2.c debugXML.c tree.c valid.c xmlreader.c * HTMLparser.c parser.c SAX2.c debugXML.c tree.c valid.c xmlreader.c

View File

@ -34,6 +34,8 @@
#include <libxml/relaxng.h> #include <libxml/relaxng.h>
#endif #endif
#define DUMP_TEXT_TYPE 1
typedef struct _xmlDebugCtxt xmlDebugCtxt; typedef struct _xmlDebugCtxt xmlDebugCtxt;
typedef xmlDebugCtxt *xmlDebugCtxtPtr; typedef xmlDebugCtxt *xmlDebugCtxtPtr;
struct _xmlDebugCtxt { struct _xmlDebugCtxt {
@ -46,6 +48,7 @@ struct _xmlDebugCtxt {
int check; /* do just checkings */ int check; /* do just checkings */
int errors; /* number of errors found */ int errors; /* number of errors found */
int nodict; /* if the document has no dictionnary */ int nodict; /* if the document has no dictionnary */
int options; /* options */
}; };
static void xmlCtxtDumpNodeList(xmlDebugCtxtPtr ctxt, xmlNodePtr node); static void xmlCtxtDumpNodeList(xmlDebugCtxtPtr ctxt, xmlNodePtr node);
@ -905,11 +908,14 @@ xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
fprintf(ctxt->output, "TEXT no enc"); fprintf(ctxt->output, "TEXT no enc");
else else
fprintf(ctxt->output, "TEXT"); fprintf(ctxt->output, "TEXT");
if (node->content == (xmlChar *) &(node->properties)) if (ctxt->options & DUMP_TEXT_TYPE) {
fprintf(ctxt->output, " compact\n"); if (node->content == (xmlChar *) &(node->properties))
else if (xmlDictOwns(ctxt->dict, node->content) == 1) fprintf(ctxt->output, " compact\n");
fprintf(ctxt->output, " interned\n"); else if (xmlDictOwns(ctxt->dict, node->content) == 1)
else fprintf(ctxt->output, " interned\n");
else
fprintf(ctxt->output, "\n");
} else
fprintf(ctxt->output, "\n"); fprintf(ctxt->output, "\n");
} }
break; break;
@ -1495,6 +1501,7 @@ xmlDebugDumpDocumentHead(FILE * output, xmlDocPtr doc)
if (output == NULL) if (output == NULL)
output = stdout; output = stdout;
xmlCtxtDumpInitCtxt(&ctxt); xmlCtxtDumpInitCtxt(&ctxt);
ctxt.options |= DUMP_TEXT_TYPE;
ctxt.output = output; ctxt.output = output;
xmlCtxtDumpDocumentHead(&ctxt, doc); xmlCtxtDumpDocumentHead(&ctxt, doc);
xmlCtxtDumpCleanCtxt(&ctxt); xmlCtxtDumpCleanCtxt(&ctxt);
@ -1515,6 +1522,7 @@ xmlDebugDumpDocument(FILE * output, xmlDocPtr doc)
if (output == NULL) if (output == NULL)
output = stdout; output = stdout;
xmlCtxtDumpInitCtxt(&ctxt); xmlCtxtDumpInitCtxt(&ctxt);
ctxt.options |= DUMP_TEXT_TYPE;
ctxt.output = output; ctxt.output = output;
xmlCtxtDumpDocument(&ctxt, doc); xmlCtxtDumpDocument(&ctxt, doc);
xmlCtxtDumpCleanCtxt(&ctxt); xmlCtxtDumpCleanCtxt(&ctxt);
@ -1535,6 +1543,7 @@ xmlDebugDumpDTD(FILE * output, xmlDtdPtr dtd)
if (output == NULL) if (output == NULL)
output = stdout; output = stdout;
xmlCtxtDumpInitCtxt(&ctxt); xmlCtxtDumpInitCtxt(&ctxt);
ctxt.options |= DUMP_TEXT_TYPE;
ctxt.output = output; ctxt.output = output;
xmlCtxtDumpDTD(&ctxt, dtd); xmlCtxtDumpDTD(&ctxt, dtd);
xmlCtxtDumpCleanCtxt(&ctxt); xmlCtxtDumpCleanCtxt(&ctxt);

View File

@ -72,10 +72,10 @@ Set contains 1 nodes:
Expression: /child::EXAMPLE/child::head/node() Expression: /child::EXAMPLE/child::head/node()
Object is a Node Set : Object is a Node Set :
Set contains 3 nodes: Set contains 3 nodes:
1 TEXT compact 1 TEXT
content= content=
2 ELEMENT title 2 ELEMENT title
3 TEXT compact 3 TEXT
content= content=
======================== ========================

View File

@ -5,7 +5,7 @@ Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 ELEMENT EXAMPLE 1 ELEMENT EXAMPLE
ATTRIBUTE id ATTRIBUTE id
TEXT compact TEXT
content=root content=root
ATTRIBUTE prop1 ATTRIBUTE prop1
TEXT TEXT

View File

@ -5,30 +5,30 @@ Object is a Node Set :
Set contains 9 nodes: Set contains 9 nodes:
1 ELEMENT b 1 ELEMENT b
ATTRIBUTE lang ATTRIBUTE lang
TEXT compact TEXT
content=en content=en
2 ELEMENT x 2 ELEMENT x
3 ELEMENT x 3 ELEMENT x
4 ELEMENT para 4 ELEMENT para
ATTRIBUTE lang ATTRIBUTE lang
TEXT compact TEXT
content=en content=en
5 ELEMENT div 5 ELEMENT div
ATTRIBUTE lang ATTRIBUTE lang
TEXT compact TEXT
content=en content=en
6 ELEMENT para 6 ELEMENT para
7 ELEMENT para 7 ELEMENT para
ATTRIBUTE lang ATTRIBUTE lang
TEXT compact TEXT
content=EN content=EN
8 ELEMENT para 8 ELEMENT para
ATTRIBUTE lang ATTRIBUTE lang
TEXT compact TEXT
content=en-us content=en-us
9 ELEMENT para 9 ELEMENT para
ATTRIBUTE lang ATTRIBUTE lang
TEXT compact TEXT
content=EN-US content=EN-US
======================== ========================
@ -37,11 +37,11 @@ Object is a Node Set :
Set contains 2 nodes: Set contains 2 nodes:
1 ELEMENT para 1 ELEMENT para
ATTRIBUTE lang ATTRIBUTE lang
TEXT compact TEXT
content=en-us content=en-us
2 ELEMENT para 2 ELEMENT para
ATTRIBUTE lang ATTRIBUTE lang
TEXT compact TEXT
content=EN-US content=EN-US
======================== ========================

View File

@ -5,7 +5,7 @@ Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 ELEMENT s 1 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=root content=root
======================== ========================
@ -14,11 +14,11 @@ Object is a Node Set :
Set contains 2 nodes: Set contains 2 nodes:
1 ELEMENT s 1 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=root content=root
2 ELEMENT s 2 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p1 content=p1
======================== ========================
@ -27,11 +27,11 @@ Object is a Node Set :
Set contains 2 nodes: Set contains 2 nodes:
1 ELEMENT s 1 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=root content=root
2 ELEMENT s 2 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p1 content=p1
======================== ========================
@ -40,11 +40,11 @@ Object is a Node Set :
Set contains 2 nodes: Set contains 2 nodes:
1 ELEMENT s 1 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=root content=root
2 ELEMENT s 2 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p1 content=p1
======================== ========================
@ -53,15 +53,15 @@ Object is a Node Set :
Set contains 3 nodes: Set contains 3 nodes:
1 ELEMENT s 1 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=root content=root
2 ELEMENT s 2 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p1 content=p1
3 ELEMENT s 3 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p2 content=p2
======================== ========================
@ -70,16 +70,16 @@ Object is a Node Set :
Set contains 4 nodes: Set contains 4 nodes:
1 ELEMENT s 1 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=root content=root
2 ELEMENT p1 2 ELEMENT p1
3 ELEMENT s 3 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p1 content=p1
4 ELEMENT s 4 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p2 content=p2
======================== ========================
@ -88,14 +88,14 @@ Object is a Node Set :
Set contains 4 nodes: Set contains 4 nodes:
1 ELEMENT s 1 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=root content=root
2 ELEMENT p1 2 ELEMENT p1
3 ELEMENT s 3 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p1 content=p1
4 ELEMENT s 4 ELEMENT s
ATTRIBUTE p ATTRIBUTE p
TEXT compact TEXT
content=p2 content=p2

View File

@ -45,7 +45,7 @@ Object is a Node Set :
Set contains 2 nodes: Set contains 2 nodes:
1 TEXT 1 TEXT
content=bla bla bla ... content=bla bla bla ...
2 TEXT compact 2 TEXT
content=... content=...
======================== ========================
@ -54,7 +54,7 @@ Object is a Node Set :
Set contains 2 nodes: Set contains 2 nodes:
1 TEXT 1 TEXT
content=bla bla bla ... content=bla bla bla ...
2 TEXT compact 2 TEXT
content=... content=...
======================== ========================
@ -63,7 +63,7 @@ Object is a Node Set :
Set contains 2 nodes: Set contains 2 nodes:
1 TEXT 1 TEXT
content=bla bla bla ... content=bla bla bla ...
2 TEXT compact 2 TEXT
content=... content=...
======================== ========================
@ -77,5 +77,5 @@ Set contains 1 nodes:
Expression: (//p/text())[position()=last()] Expression: (//p/text())[position()=last()]
Object is a Node Set : Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 TEXT compact 1 TEXT
content=... content=...

View File

@ -53,10 +53,10 @@ Set contains 1 nodes:
Expression: /child::EXAMPLE/child::head/node() Expression: /child::EXAMPLE/child::head/node()
Object is a Node Set : Object is a Node Set :
Set contains 3 nodes: Set contains 3 nodes:
1 TEXT compact 1 TEXT
content= content=
2 ELEMENT title 2 ELEMENT title
3 TEXT compact 3 TEXT
content= content=
======================== ========================

View File

@ -5,8 +5,8 @@ Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 ELEMENT ITEM 1 ELEMENT ITEM
ATTRIBUTE monto ATTRIBUTE monto
TEXT compact TEXT
content=50.12 content=50.12
ATTRIBUTE divisa ATTRIBUTE divisa
TEXT compact TEXT
content=DOL content=DOL

View File

@ -44,7 +44,7 @@ Expression: xpointer(string-range(//p, 'difficult'))
Object is a Location Set: Object is a Location Set:
1 : Object is a range : 1 : Object is a range :
From index 3 in node From index 3 in node
TEXT compact TEXT
content=a diff content=a diff
To index 4 in node To index 4 in node
TEXT TEXT
@ -56,10 +56,10 @@ Expression: xpointer(string-range(//p, 'spanning'))
Object is a Location Set: Object is a Location Set:
1 : Object is a range : 1 : Object is a range :
From index 3 in node From index 3 in node
TEXT compact TEXT
content=a span content=a span
To index 3 in node To index 3 in node
TEXT compact TEXT
content=ing one content=ing one
@ -80,17 +80,17 @@ Expression: xpointer(string-range(//seq, ''))
Object is a Location Set: Object is a Location Set:
1 : Object is a collapsed range : 1 : Object is a collapsed range :
index 1 in node index 1 in node
TEXT compact TEXT
content=123 content=123
2 : Object is a collapsed range : 2 : Object is a collapsed range :
index 2 in node index 2 in node
TEXT compact TEXT
content=123 content=123
3 : Object is a collapsed range : 3 : Object is a collapsed range :
index 3 in node index 3 in node
TEXT compact TEXT
content=123 content=123
4 : Object is a collapsed range : 4 : Object is a collapsed range :
index 4 in node index 4 in node
TEXT compact TEXT
content=123 content=123

View File

@ -2,5 +2,5 @@ Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 ELEMENT foo 1 ELEMENT foo
ATTRIBUTE id ATTRIBUTE id
TEXT compact TEXT
content=bar content=bar

View File

@ -2,5 +2,5 @@ Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 ELEMENT foo 1 ELEMENT foo
ATTRIBUTE id ATTRIBUTE id
TEXT compact TEXT
content=bar content=bar

View File

@ -2,5 +2,5 @@ Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 ELEMENT foo 1 ELEMENT foo
ATTRIBUTE id ATTRIBUTE id
TEXT compact TEXT
content=bar content=bar

View File

@ -2,5 +2,5 @@ Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 ELEMENT o:o 1 ELEMENT o:o
ATTRIBUTE id ATTRIBUTE id
TEXT compact TEXT
content=bar content=bar

View File

@ -2,5 +2,5 @@ Object is a Node Set :
Set contains 1 nodes: Set contains 1 nodes:
1 ELEMENT foo 1 ELEMENT foo
ATTRIBUTE id ATTRIBUTE id
TEXT compact TEXT
content=bar content=bar