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, NULL, 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()
596 htmlDocContentDumpFormatOutput(buf, cur, NULL, format); in htmlDocDumpMemoryFormat()
619 htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { in htmlDocDumpMemory() argument
620 htmlDocDumpMemoryFormat(cur, mem, size, 1); in htmlDocDumpMemory()
630 void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
645 xmlDtdPtr cur = doc->intSubset; in htmlDtdDumpOutput() local
647 if (cur == NULL) { in htmlDtdDumpOutput()
652 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlDtdDumpOutput()
653 if (cur->ExternalID != NULL) { in htmlDtdDumpOutput()
655 xmlBufWriteQuotedString(buf->buffer, cur->ExternalID); in htmlDtdDumpOutput()
656 if (cur->SystemID != NULL) { in htmlDtdDumpOutput()
658 xmlBufWriteQuotedString(buf->buffer, cur->SystemID); in htmlDtdDumpOutput()
660 } else if (cur->SystemID != NULL && in htmlDtdDumpOutput()
661 xmlStrcmp(cur->SystemID, BAD_CAST "about:legacy-compat")) { in htmlDtdDumpOutput()
663 xmlBufWriteQuotedString(buf->buffer, cur->SystemID); in htmlDtdDumpOutput()
677 htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur) { in htmlAttrDumpOutput() argument
687 if (cur == NULL) { in htmlAttrDumpOutput()
691 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlAttrDumpOutput()
692 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlAttrDumpOutput()
695 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlAttrDumpOutput()
696 if ((cur->children != NULL) && (!htmlIsBooleanAttr(cur->name))) { in htmlAttrDumpOutput()
697 value = xmlNodeListGetString(doc, cur->children, 0); in htmlAttrDumpOutput()
700 if ((cur->ns == NULL) && (cur->parent != NULL) && in htmlAttrDumpOutput()
701 (cur->parent->ns == NULL) && in htmlAttrDumpOutput()
702 ((!xmlStrcasecmp(cur->name, BAD_CAST "href")) || in htmlAttrDumpOutput()
703 (!xmlStrcasecmp(cur->name, BAD_CAST "action")) || in htmlAttrDumpOutput()
704 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) || in htmlAttrDumpOutput()
705 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) && in htmlAttrDumpOutput()
706 (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) { in htmlAttrDumpOutput()
745 xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED, in htmlNodeDumpFormatOutput() argument
753 if ((cur == NULL) || (buf == NULL)) { in htmlNodeDumpFormatOutput()
757 root = cur; in htmlNodeDumpFormatOutput()
758 parent = cur->parent; in htmlNodeDumpFormatOutput()
760 switch (cur->type) { in htmlNodeDumpFormatOutput()
763 if (((xmlDocPtr) cur)->intSubset != NULL) { in htmlNodeDumpFormatOutput()
764 htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL); in htmlNodeDumpFormatOutput()
766 if (cur->children != NULL) { in htmlNodeDumpFormatOutput()
768 if (cur->parent == parent) { in htmlNodeDumpFormatOutput()
769 parent = cur; in htmlNodeDumpFormatOutput()
770 cur = cur->children; in htmlNodeDumpFormatOutput()
784 if ((cur->parent != parent) && (cur->children != NULL)) { in htmlNodeDumpFormatOutput()
785 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format); in htmlNodeDumpFormatOutput()
792 if (cur->ns == NULL) in htmlNodeDumpFormatOutput()
793 info = htmlTagLookup(cur->name); in htmlNodeDumpFormatOutput()
798 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
799 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
802 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
803 if (cur->nsDef) in htmlNodeDumpFormatOutput()
804 xmlNsListDumpOutput(buf, cur->nsDef); in htmlNodeDumpFormatOutput()
805 attr = cur->properties; in htmlNodeDumpFormatOutput()
813 } else if (cur->children == NULL) { in htmlNodeDumpFormatOutput()
820 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
822 (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
825 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
831 (cur->children->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
832 (cur->children->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
833 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
834 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
835 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
837 parent = cur; in htmlNodeDumpFormatOutput()
838 cur = cur->children; in htmlNodeDumpFormatOutput()
842 if ((format) && (cur->next != NULL) && in htmlNodeDumpFormatOutput()
844 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
845 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
855 htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur); in htmlNodeDumpFormatOutput()
859 if (cur->content == NULL) in htmlNodeDumpFormatOutput()
861 if (((cur->name == (const xmlChar *)xmlStringText) || in htmlNodeDumpFormatOutput()
862 (cur->name != (const xmlChar *)xmlStringTextNoenc)) && in htmlNodeDumpFormatOutput()
868 buffer = xmlEncodeEntitiesReentrant(doc, cur->content); in htmlNodeDumpFormatOutput()
874 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
879 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
881 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
887 if (cur->name != NULL) { in htmlNodeDumpFormatOutput()
889 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
890 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
893 (const char *)cur->content); in htmlNodeDumpFormatOutput()
901 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
906 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
907 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
916 if (cur == root) in htmlNodeDumpFormatOutput()
918 if (cur->next != NULL) { in htmlNodeDumpFormatOutput()
919 cur = cur->next; in htmlNodeDumpFormatOutput()
923 cur = parent; in htmlNodeDumpFormatOutput()
925 parent = cur->parent; in htmlNodeDumpFormatOutput()
927 if ((cur->type == XML_HTML_DOCUMENT_NODE) || in htmlNodeDumpFormatOutput()
928 (cur->type == XML_DOCUMENT_NODE)) { in htmlNodeDumpFormatOutput()
931 if ((format) && (cur->ns == NULL)) in htmlNodeDumpFormatOutput()
932 info = htmlTagLookup(cur->name); in htmlNodeDumpFormatOutput()
937 (cur->last->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
938 (cur->last->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
939 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
940 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
941 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
945 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
946 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
949 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
953 (cur->next != NULL)) { in htmlNodeDumpFormatOutput()
954 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
955 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
978 xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED) { in htmlNodeDumpOutput() argument
979 htmlNodeDumpFormatOutput(buf, doc, cur, NULL, 1); in htmlNodeDumpOutput()
992 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, in htmlDocContentDumpFormatOutput() argument
995 htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, format); in htmlDocContentDumpFormatOutput()
1007 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, in htmlDocContentDumpOutput() argument
1009 htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, 1); in htmlDocContentDumpOutput()
1028 htmlDocDump(FILE *f, xmlDocPtr cur) { in htmlDocDump() argument
1036 if ((cur == NULL) || (f == NULL)) { in htmlDocDump()
1040 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlDocDump()
1063 htmlDocContentDumpOutput(buf, cur, NULL); in htmlDocDump()
1079 htmlSaveFile(const char *filename, xmlDocPtr cur) { in htmlSaveFile() argument
1085 if ((cur == NULL) || (filename == NULL)) in htmlSaveFile()
1090 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlSaveFile()
1114 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); in htmlSaveFile()
1117 htmlDocContentDumpOutput(buf, cur, NULL); in htmlSaveFile()
1135 htmlSaveFileFormat(const char *filename, xmlDocPtr cur, in htmlSaveFileFormat() argument
1141 if ((cur == NULL) || (filename == NULL)) in htmlSaveFileFormat()
1155 htmlSetMetaEncoding(cur, (const xmlChar *) encoding); in htmlSaveFileFormat()
1157 htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8"); in htmlSaveFileFormat()
1174 htmlDocContentDumpFormatOutput(buf, cur, encoding, format); in htmlSaveFileFormat()
1192 htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) { in htmlSaveFileEnc() argument
1193 return(htmlSaveFileFormat(filename, cur, encoding, 1)); in htmlSaveFileEnc()