Lines Matching refs:cur
51 htmlNodePtr cur; in htmlGetMetaEncoding() local
57 cur = doc->children; in htmlGetMetaEncoding()
62 while (cur != NULL) { in htmlGetMetaEncoding()
63 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlGetMetaEncoding()
64 if (xmlStrEqual(cur->name, BAD_CAST"html")) in htmlGetMetaEncoding()
66 if (xmlStrEqual(cur->name, BAD_CAST"head")) in htmlGetMetaEncoding()
68 if (xmlStrEqual(cur->name, BAD_CAST"meta")) in htmlGetMetaEncoding()
71 cur = cur->next; in htmlGetMetaEncoding()
73 if (cur == NULL) in htmlGetMetaEncoding()
75 cur = cur->children; in htmlGetMetaEncoding()
80 while (cur != NULL) { in htmlGetMetaEncoding()
81 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlGetMetaEncoding()
82 if (xmlStrEqual(cur->name, BAD_CAST"head")) in htmlGetMetaEncoding()
84 if (xmlStrEqual(cur->name, BAD_CAST"meta")) in htmlGetMetaEncoding()
87 cur = cur->next; in htmlGetMetaEncoding()
89 if (cur == NULL) in htmlGetMetaEncoding()
92 cur = cur->children; in htmlGetMetaEncoding()
98 while (cur != NULL) { in htmlGetMetaEncoding()
99 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlGetMetaEncoding()
100 if (xmlStrEqual(cur->name, BAD_CAST"meta")) { in htmlGetMetaEncoding()
101 xmlAttrPtr attr = cur->properties; in htmlGetMetaEncoding()
125 cur = cur->next; in htmlGetMetaEncoding()
165 htmlNodePtr cur, meta = NULL, head = NULL; in htmlSetMetaEncoding() local
184 cur = doc->children; in htmlSetMetaEncoding()
189 while (cur != NULL) { in htmlSetMetaEncoding()
190 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlSetMetaEncoding()
191 if (xmlStrcasecmp(cur->name, BAD_CAST"html") == 0) in htmlSetMetaEncoding()
193 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0) in htmlSetMetaEncoding()
195 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) in htmlSetMetaEncoding()
198 cur = cur->next; in htmlSetMetaEncoding()
200 if (cur == NULL) in htmlSetMetaEncoding()
202 cur = cur->children; in htmlSetMetaEncoding()
207 while (cur != NULL) { in htmlSetMetaEncoding()
208 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlSetMetaEncoding()
209 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0) in htmlSetMetaEncoding()
211 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) { in htmlSetMetaEncoding()
212 head = cur->parent; in htmlSetMetaEncoding()
216 cur = cur->next; in htmlSetMetaEncoding()
218 if (cur == NULL) in htmlSetMetaEncoding()
221 head = cur; in htmlSetMetaEncoding()
222 if (cur->children == NULL) in htmlSetMetaEncoding()
224 cur = cur->children; in htmlSetMetaEncoding()
231 while (cur != NULL) { in htmlSetMetaEncoding()
232 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { in htmlSetMetaEncoding()
233 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) { in htmlSetMetaEncoding()
234 xmlAttrPtr attr = cur->properties; in htmlSetMetaEncoding()
260 meta = cur; in htmlSetMetaEncoding()
266 cur = cur->next; in htmlSetMetaEncoding()
408 htmlBufNodeDumpFormat(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur, in htmlBufNodeDumpFormat() argument
414 if (cur == NULL) { in htmlBufNodeDumpFormat()
434 htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format); in htmlBufNodeDumpFormat()
452 htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) { in htmlNodeDump() argument
456 if ((buf == NULL) || (cur == NULL)) in htmlNodeDump()
464 ret = htmlBufNodeDumpFormat(buffer, doc, cur, 1); in htmlNodeDump()
489 xmlNodePtr cur, const char *encoding, int format) { in htmlNodeDumpFileFormat() argument
521 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format); in htmlNodeDumpFileFormat()
537 htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) { in htmlNodeDumpFile() argument
538 htmlNodeDumpFileFormat(out, doc, cur, NULL, 1); in htmlNodeDumpFile()
552 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) { in htmlDocDumpMemoryFormat() argument
561 if (cur == NULL) { in htmlDocDumpMemoryFormat()
567 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlDocDumpMemoryFormat()
573 if (enc != cur->charset) { in htmlDocDumpMemoryFormat()
574 if (cur->charset != XML_CHAR_ENCODING_UTF8) { in htmlDocDumpMemoryFormat()
607 htmlDocContentDumpFormatOutput(buf, cur, NULL, format); in htmlDocDumpMemoryFormat()
630 htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { in htmlDocDumpMemory() argument
631 htmlDocDumpMemoryFormat(cur, mem, size, 1); in htmlDocDumpMemory()
641 void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
656 xmlDtdPtr cur = doc->intSubset; in htmlDtdDumpOutput() local
658 if (cur == NULL) { in htmlDtdDumpOutput()
663 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlDtdDumpOutput()
664 if (cur->ExternalID != NULL) { in htmlDtdDumpOutput()
666 xmlBufWriteQuotedString(buf->buffer, cur->ExternalID); in htmlDtdDumpOutput()
667 if (cur->SystemID != NULL) { in htmlDtdDumpOutput()
669 xmlBufWriteQuotedString(buf->buffer, cur->SystemID); in htmlDtdDumpOutput()
671 } else if (cur->SystemID != NULL) { in htmlDtdDumpOutput()
673 xmlBufWriteQuotedString(buf->buffer, cur->SystemID); in htmlDtdDumpOutput()
688 htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, in htmlAttrDumpOutput() argument
699 if (cur == NULL) { in htmlAttrDumpOutput()
703 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlAttrDumpOutput()
704 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlAttrDumpOutput()
707 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlAttrDumpOutput()
708 if ((cur->children != NULL) && (!htmlIsBooleanAttr(cur->name))) { in htmlAttrDumpOutput()
709 value = xmlNodeListGetString(doc, cur->children, 0); in htmlAttrDumpOutput()
712 if ((cur->ns == NULL) && (cur->parent != NULL) && in htmlAttrDumpOutput()
713 (cur->parent->ns == NULL) && in htmlAttrDumpOutput()
714 ((!xmlStrcasecmp(cur->name, BAD_CAST "href")) || in htmlAttrDumpOutput()
715 (!xmlStrcasecmp(cur->name, BAD_CAST "action")) || in htmlAttrDumpOutput()
716 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) || in htmlAttrDumpOutput()
717 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) && in htmlAttrDumpOutput()
718 (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) { in htmlAttrDumpOutput()
782 htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding)… in htmlAttrListDumpOutput() argument
783 if (cur == NULL) { in htmlAttrListDumpOutput()
786 while (cur != NULL) { in htmlAttrListDumpOutput()
787 htmlAttrDumpOutput(buf, doc, cur, encoding); in htmlAttrListDumpOutput()
788 cur = cur->next; in htmlAttrListDumpOutput()
806 xmlNodePtr cur, const char *encoding, int format) { in htmlNodeListDumpOutput() argument
807 if (cur == NULL) { in htmlNodeListDumpOutput()
810 while (cur != NULL) { in htmlNodeListDumpOutput()
811 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format); in htmlNodeListDumpOutput()
812 cur = cur->next; in htmlNodeListDumpOutput()
828 xmlNodePtr cur, const char *encoding, int format) { in htmlNodeDumpFormatOutput() argument
833 if ((cur == NULL) || (buf == NULL)) { in htmlNodeDumpFormatOutput()
839 if (cur->type == XML_DTD_NODE) in htmlNodeDumpFormatOutput()
841 if ((cur->type == XML_HTML_DOCUMENT_NODE) || in htmlNodeDumpFormatOutput()
842 (cur->type == XML_DOCUMENT_NODE)){ in htmlNodeDumpFormatOutput()
843 htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding); in htmlNodeDumpFormatOutput()
846 if (cur->type == XML_ATTRIBUTE_NODE) { in htmlNodeDumpFormatOutput()
847 htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding); in htmlNodeDumpFormatOutput()
850 if (cur->type == HTML_TEXT_NODE) { in htmlNodeDumpFormatOutput()
851 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
852 if (((cur->name == (const xmlChar *)xmlStringText) || in htmlNodeDumpFormatOutput()
853 (cur->name != (const xmlChar *)xmlStringTextNoenc)) && in htmlNodeDumpFormatOutput()
854 ((cur->parent == NULL) || in htmlNodeDumpFormatOutput()
855 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) && in htmlNodeDumpFormatOutput()
856 (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) { in htmlNodeDumpFormatOutput()
859 buffer = xmlEncodeEntitiesReentrant(doc, cur->content); in htmlNodeDumpFormatOutput()
865 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
870 if (cur->type == HTML_COMMENT_NODE) { in htmlNodeDumpFormatOutput()
871 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
873 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
878 if (cur->type == HTML_PI_NODE) { in htmlNodeDumpFormatOutput()
879 if (cur->name == NULL) in htmlNodeDumpFormatOutput()
882 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
883 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
885 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
890 if (cur->type == HTML_ENTITY_REF_NODE) { in htmlNodeDumpFormatOutput()
892 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
896 if (cur->type == HTML_PRESERVE_NODE) { in htmlNodeDumpFormatOutput()
897 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
898 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
906 if (cur->ns == NULL) in htmlNodeDumpFormatOutput()
907 info = htmlTagLookup(cur->name); in htmlNodeDumpFormatOutput()
912 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
913 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
916 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
917 if (cur->nsDef) in htmlNodeDumpFormatOutput()
918 xmlNsListDumpOutput(buf, cur->nsDef); in htmlNodeDumpFormatOutput()
919 if (cur->properties != NULL) in htmlNodeDumpFormatOutput()
920 htmlAttrListDumpOutput(buf, doc, cur->properties, encoding); in htmlNodeDumpFormatOutput()
924 if ((format) && (!info->isinline) && (cur->next != NULL)) { in htmlNodeDumpFormatOutput()
925 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
926 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
927 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
928 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
929 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
934 if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) && in htmlNodeDumpFormatOutput()
935 (cur->children == NULL)) { in htmlNodeDumpFormatOutput()
942 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
943 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
946 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
949 if ((format) && (cur->next != NULL) && in htmlNodeDumpFormatOutput()
951 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
952 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
953 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
954 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
955 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
961 if ((cur->type != XML_ELEMENT_NODE) && in htmlNodeDumpFormatOutput()
962 (cur->content != NULL)) { in htmlNodeDumpFormatOutput()
968 xmlOutputBufferWriteString(buf, (const char *) cur->content); in htmlNodeDumpFormatOutput()
970 if (cur->children != NULL) { in htmlNodeDumpFormatOutput()
972 (cur->children->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
973 (cur->children->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
974 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
975 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
976 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
978 htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format); in htmlNodeDumpFormatOutput()
980 (cur->last->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
981 (cur->last->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
982 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
983 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
984 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
988 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
989 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
992 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
995 (cur->next != NULL)) { in htmlNodeDumpFormatOutput()
996 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
997 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
998 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
999 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
1000 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
1017 xmlNodePtr cur, const char *encoding) { in htmlNodeDumpOutput() argument
1018 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, 1); in htmlNodeDumpOutput()
1031 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, in htmlDocContentDumpFormatOutput() argument
1037 if ((buf == NULL) || (cur == NULL)) in htmlDocContentDumpFormatOutput()
1043 type = cur->type; in htmlDocContentDumpFormatOutput()
1044 cur->type = XML_HTML_DOCUMENT_NODE; in htmlDocContentDumpFormatOutput()
1045 if (cur->intSubset != NULL) { in htmlDocContentDumpFormatOutput()
1046 htmlDtdDumpOutput(buf, cur, NULL); in htmlDocContentDumpFormatOutput()
1048 if (cur->children != NULL) { in htmlDocContentDumpFormatOutput()
1049 htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format); in htmlDocContentDumpFormatOutput()
1052 cur->type = (xmlElementType) type; in htmlDocContentDumpFormatOutput()
1064 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, in htmlDocContentDumpOutput() argument
1066 htmlDocContentDumpFormatOutput(buf, cur, encoding, 1); in htmlDocContentDumpOutput()
1085 htmlDocDump(FILE *f, xmlDocPtr cur) { in htmlDocDump() argument
1093 if ((cur == NULL) || (f == NULL)) { in htmlDocDump()
1097 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlDocDump()
1103 if (enc != cur->charset) { in htmlDocDump()
1104 if (cur->charset != XML_CHAR_ENCODING_UTF8) { in htmlDocDump()
1129 htmlDocContentDumpOutput(buf, cur, NULL); in htmlDocDump()
1145 htmlSaveFile(const char *filename, xmlDocPtr cur) { in htmlSaveFile() argument
1151 if ((cur == NULL) || (filename == NULL)) in htmlSaveFile()
1156 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlSaveFile()
1162 if (enc != cur->charset) { in htmlSaveFile()
1163 if (cur->charset != XML_CHAR_ENCODING_UTF8) { in htmlSaveFile()
1187 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); in htmlSaveFile()
1190 htmlDocContentDumpOutput(buf, cur, NULL); in htmlSaveFile()
1208 htmlSaveFileFormat(const char *filename, xmlDocPtr cur, in htmlSaveFileFormat() argument
1214 if ((cur == NULL) || (filename == NULL)) in htmlSaveFileFormat()
1223 if (enc != cur->charset) { in htmlSaveFileFormat()
1224 if (cur->charset != XML_CHAR_ENCODING_UTF8) { in htmlSaveFileFormat()
1235 htmlSetMetaEncoding(cur, (const xmlChar *) encoding); in htmlSaveFileFormat()
1237 htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8"); in htmlSaveFileFormat()
1254 htmlDocContentDumpFormatOutput(buf, cur, encoding, format); in htmlSaveFileFormat()
1272 htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) { in htmlSaveFileEnc() argument
1273 return(htmlSaveFileFormat(filename, cur, encoding, 1)); in htmlSaveFileEnc()