mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
- HTMLparser.c HTMLtree.[ch] SAX.c testHTML.c tree.c: fixed HTML
support for SCRIPT and STYLE with help from Bjorn Reese - test/HTML/* result/HTML/*: added simple testcase and updated the existing ones. Daniel
This commit is contained in:
23
testHTML.c
23
testHTML.c
@ -420,6 +420,27 @@ charactersDebug(void *ctx, const xmlChar *ch, int len)
|
||||
fprintf(stdout, "SAX.characters(%s, %d)\n", output, len);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdataDebug:
|
||||
* @ctxt: An XML parser context
|
||||
* @ch: a xmlChar string
|
||||
* @len: the number of xmlChar
|
||||
*
|
||||
* receiving some cdata chars from the parser.
|
||||
* Question: how much at a time ???
|
||||
*/
|
||||
void
|
||||
cdataDebug(void *ctx, const xmlChar *ch, int len)
|
||||
{
|
||||
unsigned char output[40];
|
||||
int inlen = len, outlen = 30;
|
||||
|
||||
htmlEncodeEntities(output, &outlen, ch, &inlen, 0);
|
||||
output[outlen] = 0;
|
||||
|
||||
fprintf(stdout, "SAX.cdata(%s, %d)\n", output, len);
|
||||
}
|
||||
|
||||
/**
|
||||
* referenceDebug:
|
||||
* @ctxt: An XML parser context
|
||||
@ -572,6 +593,8 @@ xmlSAXHandler debugSAXHandlerStruct = {
|
||||
errorDebug,
|
||||
fatalErrorDebug,
|
||||
getParameterEntityDebug,
|
||||
cdataDebug,
|
||||
NULL
|
||||
};
|
||||
|
||||
xmlSAXHandlerPtr debugSAXHandler = &debugSAXHandlerStruct;
|
||||
|
Reference in New Issue
Block a user