Lines Matching refs:cur
79 htmlNodePtr cur; in htmlGetMetaEncoding() local
85 cur = doc->children; in htmlGetMetaEncoding()
90 while (cur != NULL) { in htmlGetMetaEncoding()
91 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlGetMetaEncoding()
92 if (xmlStrEqual(cur->name, BAD_CAST"html")) in htmlGetMetaEncoding()
94 if (xmlStrEqual(cur->name, BAD_CAST"head")) in htmlGetMetaEncoding()
96 if (xmlStrEqual(cur->name, BAD_CAST"meta")) in htmlGetMetaEncoding()
99 cur = cur->next; in htmlGetMetaEncoding()
101 if (cur == NULL) in htmlGetMetaEncoding()
103 cur = cur->children; in htmlGetMetaEncoding()
108 while (cur != NULL) { in htmlGetMetaEncoding()
109 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlGetMetaEncoding()
110 if (xmlStrEqual(cur->name, BAD_CAST"head")) in htmlGetMetaEncoding()
112 if (xmlStrEqual(cur->name, BAD_CAST"meta")) in htmlGetMetaEncoding()
115 cur = cur->next; in htmlGetMetaEncoding()
117 if (cur == NULL) in htmlGetMetaEncoding()
120 cur = cur->children; in htmlGetMetaEncoding()
126 while (cur != NULL) { in htmlGetMetaEncoding()
127 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlGetMetaEncoding()
128 if (xmlStrEqual(cur->name, BAD_CAST"meta")) { in htmlGetMetaEncoding()
129 xmlAttrPtr attr = cur->properties; in htmlGetMetaEncoding()
153 cur = cur->next; in htmlGetMetaEncoding()
193 htmlNodePtr cur, meta = NULL, head = NULL; in htmlSetMetaEncoding() local
212 cur = doc->children; in htmlSetMetaEncoding()
217 while (cur != NULL) { in htmlSetMetaEncoding()
218 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlSetMetaEncoding()
219 if (xmlStrcasecmp(cur->name, BAD_CAST"html") == 0) in htmlSetMetaEncoding()
221 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0) in htmlSetMetaEncoding()
223 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) in htmlSetMetaEncoding()
226 cur = cur->next; in htmlSetMetaEncoding()
228 if (cur == NULL) in htmlSetMetaEncoding()
230 cur = cur->children; in htmlSetMetaEncoding()
235 while (cur != NULL) { in htmlSetMetaEncoding()
236 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlSetMetaEncoding()
237 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0) in htmlSetMetaEncoding()
239 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) { in htmlSetMetaEncoding()
240 head = cur->parent; in htmlSetMetaEncoding()
244 cur = cur->next; in htmlSetMetaEncoding()
246 if (cur == NULL) in htmlSetMetaEncoding()
249 head = cur; in htmlSetMetaEncoding()
250 if (cur->children == NULL) in htmlSetMetaEncoding()
252 cur = cur->children; in htmlSetMetaEncoding()
259 while (cur != NULL) { in htmlSetMetaEncoding()
260 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlSetMetaEncoding()
261 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) { in htmlSetMetaEncoding()
262 xmlAttrPtr attr = cur->properties; in htmlSetMetaEncoding()
288 meta = cur; in htmlSetMetaEncoding()
294 cur = cur->next; in htmlSetMetaEncoding()
436 htmlBufNodeDumpFormat(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur, in htmlBufNodeDumpFormat() argument
442 if (cur == NULL) { in htmlBufNodeDumpFormat()
462 htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format); in htmlBufNodeDumpFormat()
480 htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) { in htmlNodeDump() argument
484 if ((buf == NULL) || (cur == NULL)) in htmlNodeDump()
492 ret = htmlBufNodeDumpFormat(buffer, doc, cur, 1); in htmlNodeDump()
517 xmlNodePtr cur, const char *encoding, int format) { in htmlNodeDumpFileFormat() argument
549 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format); in htmlNodeDumpFileFormat()
565 htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) { in htmlNodeDumpFile() argument
566 htmlNodeDumpFileFormat(out, doc, cur, NULL, 1); in htmlNodeDumpFile()
580 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) { in htmlDocDumpMemoryFormat() argument
589 if (cur == NULL) { in htmlDocDumpMemoryFormat()
595 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlDocDumpMemoryFormat()
624 htmlDocContentDumpFormatOutput(buf, cur, NULL, format); in htmlDocDumpMemoryFormat()
647 htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { in htmlDocDumpMemory() argument
648 htmlDocDumpMemoryFormat(cur, mem, size, 1); in htmlDocDumpMemory()
658 void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
673 xmlDtdPtr cur = doc->intSubset; in htmlDtdDumpOutput() local
675 if (cur == NULL) { in htmlDtdDumpOutput()
680 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlDtdDumpOutput()
681 if (cur->ExternalID != NULL) { in htmlDtdDumpOutput()
683 xmlBufWriteQuotedString(buf->buffer, cur->ExternalID); in htmlDtdDumpOutput()
684 if (cur->SystemID != NULL) { in htmlDtdDumpOutput()
686 xmlBufWriteQuotedString(buf->buffer, cur->SystemID); in htmlDtdDumpOutput()
688 } else if (cur->SystemID != NULL && in htmlDtdDumpOutput()
689 xmlStrcmp(cur->SystemID, BAD_CAST "about:legacy-compat")) { in htmlDtdDumpOutput()
691 xmlBufWriteQuotedString(buf->buffer, cur->SystemID); in htmlDtdDumpOutput()
706 htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, in htmlAttrDumpOutput() argument
717 if (cur == NULL) { in htmlAttrDumpOutput()
721 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlAttrDumpOutput()
722 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlAttrDumpOutput()
725 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlAttrDumpOutput()
726 if ((cur->children != NULL) && (!htmlIsBooleanAttr(cur->name))) { in htmlAttrDumpOutput()
727 value = xmlNodeListGetString(doc, cur->children, 0); in htmlAttrDumpOutput()
730 if ((cur->ns == NULL) && (cur->parent != NULL) && in htmlAttrDumpOutput()
731 (cur->parent->ns == NULL) && in htmlAttrDumpOutput()
732 ((!xmlStrcasecmp(cur->name, BAD_CAST "href")) || in htmlAttrDumpOutput()
733 (!xmlStrcasecmp(cur->name, BAD_CAST "action")) || in htmlAttrDumpOutput()
734 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) || in htmlAttrDumpOutput()
735 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) && in htmlAttrDumpOutput()
736 (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) { in htmlAttrDumpOutput()
800 htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding)… in htmlAttrListDumpOutput() argument
801 if (cur == NULL) { in htmlAttrListDumpOutput()
804 while (cur != NULL) { in htmlAttrListDumpOutput()
805 htmlAttrDumpOutput(buf, doc, cur, encoding); in htmlAttrListDumpOutput()
806 cur = cur->next; in htmlAttrListDumpOutput()
824 xmlNodePtr cur, const char *encoding, int format) { in htmlNodeListDumpOutput() argument
825 if (cur == NULL) { in htmlNodeListDumpOutput()
828 while (cur != NULL) { in htmlNodeListDumpOutput()
829 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format); in htmlNodeListDumpOutput()
830 cur = cur->next; in htmlNodeListDumpOutput()
846 xmlNodePtr cur, const char *encoding, int format) { in htmlNodeDumpFormatOutput() argument
851 if ((cur == NULL) || (buf == NULL)) { in htmlNodeDumpFormatOutput()
857 if (cur->type == XML_DTD_NODE) in htmlNodeDumpFormatOutput()
859 if ((cur->type == XML_HTML_DOCUMENT_NODE) || in htmlNodeDumpFormatOutput()
860 (cur->type == XML_DOCUMENT_NODE)){ in htmlNodeDumpFormatOutput()
861 htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding); in htmlNodeDumpFormatOutput()
864 if (cur->type == XML_ATTRIBUTE_NODE) { in htmlNodeDumpFormatOutput()
865 htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding); in htmlNodeDumpFormatOutput()
868 if (cur->type == HTML_TEXT_NODE) { in htmlNodeDumpFormatOutput()
869 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
870 if (((cur->name == (const xmlChar *)xmlStringText) || in htmlNodeDumpFormatOutput()
871 (cur->name != (const xmlChar *)xmlStringTextNoenc)) && in htmlNodeDumpFormatOutput()
872 ((cur->parent == NULL) || in htmlNodeDumpFormatOutput()
873 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) && in htmlNodeDumpFormatOutput()
874 (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) { in htmlNodeDumpFormatOutput()
877 buffer = xmlEncodeEntitiesReentrant(doc, cur->content); in htmlNodeDumpFormatOutput()
883 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
888 if (cur->type == HTML_COMMENT_NODE) { in htmlNodeDumpFormatOutput()
889 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
891 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
896 if (cur->type == HTML_PI_NODE) { in htmlNodeDumpFormatOutput()
897 if (cur->name == NULL) in htmlNodeDumpFormatOutput()
900 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
901 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
903 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
908 if (cur->type == HTML_ENTITY_REF_NODE) { in htmlNodeDumpFormatOutput()
910 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
914 if (cur->type == HTML_PRESERVE_NODE) { in htmlNodeDumpFormatOutput()
915 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
916 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
924 if (cur->ns == NULL) in htmlNodeDumpFormatOutput()
925 info = htmlTagLookup(cur->name); in htmlNodeDumpFormatOutput()
930 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
931 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
934 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
935 if (cur->nsDef) in htmlNodeDumpFormatOutput()
936 xmlNsListDumpOutput(buf, cur->nsDef); in htmlNodeDumpFormatOutput()
937 if (cur->properties != NULL) in htmlNodeDumpFormatOutput()
938 htmlAttrListDumpOutput(buf, doc, cur->properties, encoding); in htmlNodeDumpFormatOutput()
942 if ((format) && (!info->isinline) && (cur->next != NULL)) { in htmlNodeDumpFormatOutput()
943 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
944 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
945 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
946 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
947 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
952 if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) && in htmlNodeDumpFormatOutput()
953 (cur->children == NULL)) { in htmlNodeDumpFormatOutput()
960 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
961 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
964 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
967 if ((format) && (cur->next != NULL) && in htmlNodeDumpFormatOutput()
969 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
970 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
971 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
972 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
973 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
979 if ((cur->type != XML_ELEMENT_NODE) && in htmlNodeDumpFormatOutput()
980 (cur->content != NULL)) { in htmlNodeDumpFormatOutput()
986 xmlOutputBufferWriteString(buf, (const char *) cur->content); in htmlNodeDumpFormatOutput()
988 if (cur->children != NULL) { in htmlNodeDumpFormatOutput()
990 (cur->children->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
991 (cur->children->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
992 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
993 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
994 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
996 htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format); in htmlNodeDumpFormatOutput()
998 (cur->last->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
999 (cur->last->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
1000 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
1001 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
1002 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
1006 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
1007 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
1010 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
1013 (cur->next != NULL)) { in htmlNodeDumpFormatOutput()
1014 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
1015 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
1016 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
1017 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
1018 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
1035 xmlNodePtr cur, const char *encoding) { in htmlNodeDumpOutput() argument
1036 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, 1); in htmlNodeDumpOutput()
1049 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, in htmlDocContentDumpFormatOutput() argument
1055 if ((buf == NULL) || (cur == NULL)) in htmlDocContentDumpFormatOutput()
1061 type = cur->type; in htmlDocContentDumpFormatOutput()
1062 cur->type = XML_HTML_DOCUMENT_NODE; in htmlDocContentDumpFormatOutput()
1063 if (cur->intSubset != NULL) { in htmlDocContentDumpFormatOutput()
1064 htmlDtdDumpOutput(buf, cur, NULL); in htmlDocContentDumpFormatOutput()
1066 if (cur->children != NULL) { in htmlDocContentDumpFormatOutput()
1067 htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format); in htmlDocContentDumpFormatOutput()
1070 cur->type = (xmlElementType) type; in htmlDocContentDumpFormatOutput()
1082 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, in htmlDocContentDumpOutput() argument
1084 htmlDocContentDumpFormatOutput(buf, cur, encoding, 1); in htmlDocContentDumpOutput()
1103 htmlDocDump(FILE *f, xmlDocPtr cur) { in htmlDocDump() argument
1111 if ((cur == NULL) || (f == NULL)) { in htmlDocDump()
1115 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlDocDump()
1138 htmlDocContentDumpOutput(buf, cur, NULL); in htmlDocDump()
1154 htmlSaveFile(const char *filename, xmlDocPtr cur) { in htmlSaveFile() argument
1160 if ((cur == NULL) || (filename == NULL)) in htmlSaveFile()
1165 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlSaveFile()
1189 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); in htmlSaveFile()
1192 htmlDocContentDumpOutput(buf, cur, NULL); in htmlSaveFile()
1210 htmlSaveFileFormat(const char *filename, xmlDocPtr cur, in htmlSaveFileFormat() argument
1216 if ((cur == NULL) || (filename == NULL)) in htmlSaveFileFormat()
1230 htmlSetMetaEncoding(cur, (const xmlChar *) encoding); in htmlSaveFileFormat()
1232 htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8"); in htmlSaveFileFormat()
1249 htmlDocContentDumpFormatOutput(buf, cur, encoding, format); in htmlSaveFileFormat()
1267 htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) { in htmlSaveFileEnc() argument
1268 return(htmlSaveFileFormat(filename, cur, encoding, 1)); in htmlSaveFileEnc()