Home | History | Annotate | Download | only in libxml2

Lines Matching defs:cur

51     htmlNodePtr cur;
57 cur = doc->children;
62 while (cur != NULL) {
63 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
64 if (xmlStrEqual(cur->name, BAD_CAST"html"))
66 if (xmlStrEqual(cur->name, BAD_CAST"head"))
68 if (xmlStrEqual(cur->name, BAD_CAST"meta"))
71 cur = cur->next;
73 if (cur == NULL)
75 cur = cur->children;
80 while (cur != NULL) {
81 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
82 if (xmlStrEqual(cur->name, BAD_CAST"head"))
84 if (xmlStrEqual(cur->name, BAD_CAST"meta"))
87 cur = cur->next;
89 if (cur == NULL)
92 cur = cur->children;
98 while (cur != NULL) {
99 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
100 if (xmlStrEqual(cur->name, BAD_CAST"meta")) {
101 xmlAttrPtr attr = cur->properties;
125 cur = cur->next;
165 htmlNodePtr cur, meta = NULL, head = NULL;
184 cur = doc->children;
189 while (cur != NULL) {
190 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
191 if (xmlStrcasecmp(cur->name, BAD_CAST"html") == 0)
193 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
195 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0)
198 cur = cur->next;
200 if (cur == NULL)
202 cur = cur->children;
207 while (cur != NULL) {
208 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
209 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
211 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) {
212 head = cur->parent;
216 cur = cur->next;
218 if (cur == NULL)
221 head = cur;
222 if (cur->children == NULL)
224 cur = cur->children;
231 while (cur != NULL) {
232 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
233 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) {
234 xmlAttrPtr attr = cur->properties;
260 meta = cur;
266 cur = cur->next;
400 * @cur: the current node
408 htmlBufNodeDumpFormat(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur,
414 if (cur == NULL) {
434 htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format);
444 * @cur: the current node
452 htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
456 if ((buf == NULL) || (cur == NULL))
464 ret = htmlBufNodeDumpFormat(buffer, doc, cur, 1);
477 * @cur: the current node
489 xmlNodePtr cur, const char *encoding, int format) {
521 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
531 * @cur: the current node
537 htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) {
538 htmlNodeDumpFileFormat(out, doc, cur, NULL, 1);
543 * @cur: the document
552 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
561 if (cur == NULL) {
567 encoding = (const char *) htmlGetMetaEncoding(cur);
573 if (enc != cur->charset) {
574 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
607 htmlDocContentDumpFormatOutput(buf, cur, NULL, format);
622 * @cur: the document
630 htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
631 htmlDocDumpMemoryFormat(cur, mem, size, 1);
641 void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
656 xmlDtdPtr cur = doc->intSubset;
658 if (cur == NULL) {
663 xmlOutputBufferWriteString(buf, (const char *)cur->name);
664 if (cur->ExternalID != NULL) {
666 xmlBufWriteQuotedString(buf->buffer, cur->ExternalID);
667 if (cur->SystemID != NULL) {
669 xmlBufWriteQuotedString(buf->buffer, cur->SystemID);
671 } else if (cur->SystemID != NULL) {
673 xmlBufWriteQuotedString(buf->buffer, cur->SystemID);
682 * @cur: the attribute pointer
688 htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
699 if (cur == NULL) {
703 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
704 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
707 xmlOutputBufferWriteString(buf, (const char *)cur->name);
708 if ((cur->children != NULL) && (!htmlIsBooleanAttr(cur->name))) {
709 value = xmlNodeListGetString(doc, cur->children, 0);
712 if ((cur->ns == NULL) && (cur->parent != NULL) &&
713 (cur->parent->ns == NULL) &&
714 ((!xmlStrcasecmp(cur->name, BAD_CAST "href")) ||
715 (!xmlStrcasecmp(cur->name, BAD_CAST "action")) ||
716 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
717 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
718 (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
749 * @cur: the first attribute pointer
755 htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding) {
756 if (cur == NULL) {
759 while (cur != NULL) {
760 htmlAttrDumpOutput(buf, doc, cur, encoding);
761 cur = cur->next;
771 * @cur: the first node
779 xmlNodePtr cur, const char *encoding, int format) {
780 if (cur == NULL) {
783 while (cur != NULL) {
784 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
785 cur = cur->next;
793 * @cur: the current node
801 xmlNodePtr cur, const char *encoding, int format) {
806 if ((cur == NULL) || (buf == NULL)) {
812 if (cur->type == XML_DTD_NODE)
814 if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
815 (cur->type == XML_DOCUMENT_NODE)){
816 htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
819 if (cur->type == XML_ATTRIBUTE_NODE) {
820 htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding);
823 if (cur->type == HTML_TEXT_NODE) {
824 if (cur->content != NULL) {
825 if (((cur->name == (const xmlChar *)xmlStringText) ||
826 (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
827 ((cur->parent == NULL) ||
828 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
829 (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
832 buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
838 xmlOutputBufferWriteString(buf, (const char *)cur->content);
843 if (cur->type == HTML_COMMENT_NODE) {
844 if (cur->content != NULL) {
846 xmlOutputBufferWriteString(buf, (const char *)cur->content);
851 if (cur->type == HTML_PI_NODE) {
852 if (cur->name == NULL)
855 xmlOutputBufferWriteString(buf, (const char *)cur->name);
856 if (cur->content != NULL) {
858 xmlOutputBufferWriteString(buf, (const char *)cur->content);
863 if (cur->type == HTML_ENTITY_REF_NODE) {
865 xmlOutputBufferWriteString(buf, (const char *)cur->name);
869 if (cur->type == HTML_PRESERVE_NODE) {
870 if (cur->content != NULL) {
871 xmlOutputBufferWriteString(buf, (const char *)cur->content);
879 if (cur->ns == NULL)
880 info = htmlTagLookup(cur->name);
885 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
886 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
889 xmlOutputBufferWriteString(buf, (const char *)cur->name);
890 if (cur->nsDef)
891 xmlNsListDumpOutput(buf, cur->nsDef);
892 if (cur->properties != NULL)
893 htmlAttrListDumpOutput(buf, doc, cur->properties, encoding);
897 if ((format) && (!info->isinline) && (cur->next != NULL)) {
898 if ((cur->next->type != HTML_TEXT_NODE) &&
899 (cur->next->type != HTML_ENTITY_REF_NODE) &&
900 (cur->parent != NULL) &&
901 (cur->parent->name != NULL) &&
902 (cur->parent->name[0] != 'p')) /* p, pre, param */
907 if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) &&
908 (cur->children == NULL)) {
915 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
916 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
919 xmlOutputBufferWriteString(buf, (const char *)cur->name);
922 if ((format) && (cur->next != NULL) &&
924 if ((cur->next->type != HTML_TEXT_NODE) &&
925 (cur->next->type != HTML_ENTITY_REF_NODE) &&
926 (cur->parent != NULL) &&
927 (cur->parent->name != NULL) &&
928 (cur->parent->name[0] != 'p')) /* p, pre, param */
934 if ((cur->type != XML_ELEMENT_NODE) &&
935 (cur->content != NULL)) {
941 xmlOutputBufferWriteString(buf, (const char *) cur->content);
943 if (cur->children != NULL) {
945 (cur->children->type != HTML_TEXT_NODE) &&
946 (cur->children->type != HTML_ENTITY_REF_NODE) &&
947 (cur->children != cur->last) &&
948 (cur->name != NULL) &&
949 (cur->name[0] != 'p')) /* p, pre, param */
951 htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format);
953 (cur->last->type != HTML_TEXT_NODE) &&
954 (cur->last->type != HTML_ENTITY_REF_NODE) &&
955 (cur->children != cur->last) &&
956 (cur->name != NULL) &&
957 (cur->name[0] != 'p')) /* p, pre, param */
961 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
962 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
965 xmlOutputBufferWriteString(buf, (const char *)cur->name);
968 (cur->next != NULL)) {
969 if ((cur->next->type != HTML_TEXT_NODE) &&
970 (cur->next->type != HTML_ENTITY_REF_NODE) &&
971 (cur->parent != NULL) &&
972 (cur->parent->name != NULL) &&
973 (cur->parent->name[0] != 'p')) /* p, pre, param */
982 * @cur: the current node
990 xmlNodePtr cur, const char *encoding) {
991 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, 1);
997 * @cur: the document
1004 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
1010 if ((buf == NULL) || (cur == NULL))
1016 type = cur->type;
1017 cur->type = XML_HTML_DOCUMENT_NODE;
1018 if (cur->intSubset != NULL) {
1019 htmlDtdDumpOutput(buf, cur, NULL);
1021 if (cur->children != NULL) {
1022 htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format);
1025 cur->type = (xmlElementType) type;
1031 * @cur: the document
1037 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
1039 htmlDocContentDumpFormatOutput(buf, cur, encoding, 1);
1051 * @cur: the document
1058 htmlDocDump(FILE *f, xmlDocPtr cur) {
1066 if ((cur == NULL) || (f == NULL)) {
1070 encoding = (const char *) htmlGetMetaEncoding(cur);
1076 if (enc != cur->charset) {
1077 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1102 htmlDocContentDumpOutput(buf, cur, NULL);
1111 * @cur: the document
1118 htmlSaveFile(const char *filename, xmlDocPtr cur) {
1124 if ((cur == NULL) || (filename == NULL))
1129 encoding = (const char *) htmlGetMetaEncoding(cur);
1135 if (enc != cur->charset) {
1136 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1160 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression);
1163 htmlDocContentDumpOutput(buf, cur, NULL);
1172 * @cur: the document
1181 htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
1187 if ((cur == NULL) || (filename == NULL))
1196 if (enc != cur->charset) {
1197 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1208 htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
1210 htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8");
1227 htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
1236 * @cur: the document
1245 htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
1246 return(htmlSaveFileFormat(filename, cur, encoding, 1));