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()
759 switch (cur->type) { in htmlNodeDumpFormatOutput()
762 if (((xmlDocPtr) cur)->intSubset != NULL) { in htmlNodeDumpFormatOutput()
763 htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL); in htmlNodeDumpFormatOutput()
765 if (cur->children != NULL) { in htmlNodeDumpFormatOutput()
766 cur = cur->children; in htmlNodeDumpFormatOutput()
775 if (cur->ns == NULL) in htmlNodeDumpFormatOutput()
776 info = htmlTagLookup(cur->name); in htmlNodeDumpFormatOutput()
781 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
782 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
785 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
786 if (cur->nsDef) in htmlNodeDumpFormatOutput()
787 xmlNsListDumpOutput(buf, cur->nsDef); in htmlNodeDumpFormatOutput()
788 attr = cur->properties; in htmlNodeDumpFormatOutput()
796 } else if (cur->children == NULL) { in htmlNodeDumpFormatOutput()
803 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
805 (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
808 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
814 (cur->children->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
815 (cur->children->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
816 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
817 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
818 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
820 cur = cur->children; in htmlNodeDumpFormatOutput()
824 if ((format) && (cur->next != NULL) && in htmlNodeDumpFormatOutput()
826 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
827 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
828 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
829 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
830 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
837 htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur); in htmlNodeDumpFormatOutput()
841 if (cur->content == NULL) in htmlNodeDumpFormatOutput()
843 if (((cur->name == (const xmlChar *)xmlStringText) || in htmlNodeDumpFormatOutput()
844 (cur->name != (const xmlChar *)xmlStringTextNoenc)) && in htmlNodeDumpFormatOutput()
845 ((cur->parent == NULL) || in htmlNodeDumpFormatOutput()
846 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) && in htmlNodeDumpFormatOutput()
847 (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) { in htmlNodeDumpFormatOutput()
850 buffer = xmlEncodeEntitiesReentrant(doc, cur->content); in htmlNodeDumpFormatOutput()
856 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
861 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
863 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
869 if (cur->name != NULL) { in htmlNodeDumpFormatOutput()
871 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
872 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
875 (const char *)cur->content); in htmlNodeDumpFormatOutput()
883 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
888 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
889 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
898 if (cur == root) in htmlNodeDumpFormatOutput()
900 if (cur->next != NULL) { in htmlNodeDumpFormatOutput()
901 cur = cur->next; in htmlNodeDumpFormatOutput()
909 if (cur->parent == NULL) in htmlNodeDumpFormatOutput()
911 cur = cur->parent; in htmlNodeDumpFormatOutput()
913 if ((cur->type == XML_HTML_DOCUMENT_NODE) || in htmlNodeDumpFormatOutput()
914 (cur->type == XML_DOCUMENT_NODE)) { in htmlNodeDumpFormatOutput()
917 if ((format) && (cur->ns == NULL)) in htmlNodeDumpFormatOutput()
918 info = htmlTagLookup(cur->name); in htmlNodeDumpFormatOutput()
923 (cur->last->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
924 (cur->last->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
925 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
926 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
927 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
931 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
932 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
935 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
939 (cur->next != NULL)) { in htmlNodeDumpFormatOutput()
940 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
941 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
942 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
943 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
944 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
964 xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED) { in htmlNodeDumpOutput() argument
965 htmlNodeDumpFormatOutput(buf, doc, cur, NULL, 1); in htmlNodeDumpOutput()
978 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, in htmlDocContentDumpFormatOutput() argument
981 htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, format); in htmlDocContentDumpFormatOutput()
993 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, in htmlDocContentDumpOutput() argument
995 htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, 1); in htmlDocContentDumpOutput()
1014 htmlDocDump(FILE *f, xmlDocPtr cur) { in htmlDocDump() argument
1022 if ((cur == NULL) || (f == NULL)) { in htmlDocDump()
1026 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlDocDump()
1049 htmlDocContentDumpOutput(buf, cur, NULL); in htmlDocDump()
1065 htmlSaveFile(const char *filename, xmlDocPtr cur) { in htmlSaveFile() argument
1071 if ((cur == NULL) || (filename == NULL)) in htmlSaveFile()
1076 encoding = (const char *) htmlGetMetaEncoding(cur); in htmlSaveFile()
1100 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); in htmlSaveFile()
1103 htmlDocContentDumpOutput(buf, cur, NULL); in htmlSaveFile()
1121 htmlSaveFileFormat(const char *filename, xmlDocPtr cur, in htmlSaveFileFormat() argument
1127 if ((cur == NULL) || (filename == NULL)) in htmlSaveFileFormat()
1141 htmlSetMetaEncoding(cur, (const xmlChar *) encoding); in htmlSaveFileFormat()
1143 htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8"); in htmlSaveFileFormat()
1160 htmlDocContentDumpFormatOutput(buf, cur, encoding, format); in htmlSaveFileFormat()
1178 htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) { in htmlSaveFileEnc() argument
1179 return(htmlSaveFileFormat(filename, cur, encoding, 1)); in htmlSaveFileEnc()