34 #include "gwenhywfar/debug.h"
35 #include "gwenhywfar/misc.h"
36 #include "gwenhywfar/text.h"
37 #include "gwenhywfar/path.h"
68 assert(ctx->_refCount);
69 if (ctx->_refCount==1) {
83 assert(ctx->_refCount);
136 return ctx->finishedElements;
143 ctx->finishedElements++;
150 ctx->finishedElements=0;
164 return ctx->currentNode;
171 ctx->currentHeader=n;
178 return ctx->currentHeader;
237 of=ctx->addCommentFn;
249 return ctx->startTagFn(ctx, tagName);
262 return ctx->endTagFn(ctx, closing);
275 return ctx->addDataFn(ctx, data);
287 if (ctx->addCommentFn)
288 return ctx->addCommentFn(ctx, data);
298 const char *attrName,
299 const char *attrData) {
303 return ctx->addAttrFn(ctx, attrName, attrData);
354 else if (strcasecmp(tagName,
"!DOCTYPE")==0) {
363 else if (*tagName==
'/') {
374 if (strcasecmp(s, tagName)!=0) {
377 "Endtag does not match curent tag (%s != %s)", s, tagName);
386 if (strcasecmp(s, tagName)==0)
442 closing?
"closing":
"not closing");
490 uint8_t *lastBlankPos;
495 if (!(flags & GWEN_XML_FLAGS_KEEP_BLANKS)) {
496 if (flags & GWEN_XML_FLAGS_KEEP_CNTRL) {
497 while(*src && (*src==32 || *src==9))
501 while(*src && *src<33)
512 for (i=0; i<size; i++) {
516 if (!(flags & GWEN_XML_FLAGS_KEEP_CNTRL) && c<32)
520 if (!(flags & GWEN_XML_FLAGS_NO_CONDENSE) && c==32) {
566 const char *attrName,
567 const char *attrData) {
577 int isNormalProperty=1;
586 if (strcasecmp(attrName,
"xmlns")==0) {
596 else if (strncasecmp(attrName,
"xmlns:", 6)==0) {
599 name=strchr(attrName,
':');
616 if (isNormalProperty) {