summaryrefslogtreecommitdiff
path: root/testSAX.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2000-08-12 21:12:04 +0000
committerDaniel Veillard <veillard@src.gnome.org>2000-08-12 21:12:04 +0000
commit87b953957305fc1ece066efa60df5c7844183439 (patch)
tree716014ce7948189e557e890575a369fdfc30b9f2 /testSAX.c
parent7ebb1eebdac0740d9ad703bd8dabbcb8a79cf679 (diff)
downloadlibxml2-87b953957305fc1ece066efa60df5c7844183439.tar.gz
Large sync between my W3C base and Gnome's one:
- parser.[ch]: added xmlGetFeaturesList() xmlGetFeature() and xmlAddFeature() - tree.[ch]: added xmlAddChildList() - xmllint.c: MAP_FAILED macro test - parser.h: added xmlParseCtxtExternalEntity() - valid.c: applied bug fixes removed warning - tree.c: added CDATA block to elements content - testSAX.c: cleanup of output - testHTML.c: added SAX testing - encoding.c: better error recovery - SAX.c, parser.c: fixed one of the external entity processing of the OASis testsuite - Makefile.am: added HTML SAX regression tests - configure.in: bumped to 2.2.2 - test/HTML/ result/HTML: added a few of HTML tests, and added the SAX results Daniel
Diffstat (limited to 'testSAX.c')
-rw-r--r--testSAX.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/testSAX.c b/testSAX.c
index e5568fc4..fc1f573e 100644
--- a/testSAX.c
+++ b/testSAX.c
@@ -402,12 +402,14 @@ endElementDebug(void *ctx, const xmlChar *name)
void
charactersDebug(void *ctx, const xmlChar *ch, int len)
{
+ char output[40];
int i;
- fprintf(stdout, "SAX.characters(");
- for (i = 0;(i < len) && (i < 30);i++)
- fprintf(stdout, "%c", ch[i]);
- fprintf(stdout, ", %d)\n", len);
+ for (i = 0;(i<len) && (i < 30);i++)
+ output[i] = ch[i];
+ output[i] = 0;
+
+ fprintf(stdout, "SAX.characters(%s, %d)\n", output, len);
}
/**
@@ -436,8 +438,13 @@ referenceDebug(void *ctx, const xmlChar *name)
void
ignorableWhitespaceDebug(void *ctx, const xmlChar *ch, int len)
{
- fprintf(stdout, "SAX.ignorableWhitespace(%.30s, %d)\n",
- (char *) ch, len);
+ char output[40];
+ int i;
+
+ for (i = 0;(i<len) && (i < 30);i++)
+ output[i] = ch[i];
+ output[i] = 0;
+ fprintf(stdout, "SAX.ignorableWhitespace(%s, %d)\n", output, len);
}
/**