Lines Matching refs:cur
49 htmlNodePtr cur;
55 cur = doc->children;
60 while (cur != NULL) {
61 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
62 if (xmlStrEqual(cur->name, BAD_CAST"html"))
64 if (xmlStrEqual(cur->name, BAD_CAST"head"))
66 if (xmlStrEqual(cur->name, BAD_CAST"meta"))
69 cur = cur->next;
71 if (cur == NULL)
73 cur = cur->children;
78 while (cur != NULL) {
79 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
80 if (xmlStrEqual(cur->name, BAD_CAST"head"))
82 if (xmlStrEqual(cur->name, BAD_CAST"meta"))
85 cur = cur->next;
87 if (cur == NULL)
90 cur = cur->children;
96 while (cur != NULL) {
97 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
98 if (xmlStrEqual(cur->name, BAD_CAST"meta")) {
99 xmlAttrPtr attr = cur->properties;
123 cur = cur->next;
163 htmlNodePtr cur, meta;
177 cur = doc->children;
182 while (cur != NULL) {
183 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
184 if (xmlStrcasecmp(cur->name, BAD_CAST"html") == 0)
186 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
188 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0)
191 cur = cur->next;
193 if (cur == NULL)
195 cur = cur->children;
200 while (cur != NULL) {
201 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
202 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
204 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0)
207 cur = cur->next;
209 if (cur == NULL)
212 if (cur->children == NULL) {
216 xmlAddChild(cur, meta);
221 cur = cur->children;
230 xmlAddPrevSibling(cur, meta);
239 while (cur != NULL) {
240 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
241 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) {
242 xmlAttrPtr attr = cur->properties;
268 meta = cur;
269 cur = cur->next;
277 cur = cur->next;
380 htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
387 * @cur: the current node
395 htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
401 if (cur == NULL) {
421 htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format);
431 * @cur: the current node
439 htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
442 return(htmlNodeDumpFormat(buf, doc, cur, 1));
449 * @cur: the current node
461 xmlNodePtr cur, const char *encoding, int format) {
493 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
503 * @cur: the current node
509 htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) {
510 htmlNodeDumpFileFormat(out, doc, cur, NULL, 1);
515 * @cur: the document
524 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
533 if (cur == NULL) {
539 encoding = (const char *) htmlGetMetaEncoding(cur);
545 if (enc != cur->charset) {
546 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
581 htmlDocContentDumpFormatOutput(buf, cur, NULL, format);
596 * @cur: the document
604 htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
605 htmlDocDumpMemoryFormat(cur, mem, size, 1);
615 void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
630 xmlDtdPtr cur = doc->intSubset;
632 if (cur == NULL) {
637 xmlOutputBufferWriteString(buf, (const char *)cur->name);
638 if (cur->ExternalID != NULL) {
640 xmlBufferWriteQuotedString(buf->buffer, cur->ExternalID);
641 if (cur->SystemID != NULL) {
643 xmlBufferWriteQuotedString(buf->buffer, cur->SystemID);
645 } else if (cur->SystemID != NULL) {
647 xmlBufferWriteQuotedString(buf->buffer, cur->SystemID);
656 * @cur: the attribute pointer
662 htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
672 if (cur == NULL) {
676 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
677 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
680 xmlOutputBufferWriteString(buf, (const char *)cur->name);
681 if ((cur->children != NULL) && (!htmlIsBooleanAttr(cur->name))) {
682 value = xmlNodeListGetString(doc, cur->children, 0);
685 if ((cur->ns == NULL) && (cur->parent != NULL) &&
686 (cur->parent->ns == NULL) &&
687 ((!xmlStrcasecmp(cur->name, BAD_CAST "href")) ||
688 (!xmlStrcasecmp(cur->name, BAD_CAST "action")) ||
689 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
690 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
691 (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
718 * @cur: the first attribute pointer
724 htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding) {
725 if (cur == NULL) {
728 while (cur != NULL) {
729 htmlAttrDumpOutput(buf, doc, cur, encoding);
730 cur = cur->next;
740 * @cur: the first node
748 xmlNodePtr cur, const char *encoding, int format) {
749 if (cur == NULL) {
752 while (cur != NULL) {
753 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
754 cur = cur->next;
762 * @cur: the current node
770 xmlNodePtr cur, const char *encoding, int format) {
775 if ((cur == NULL) || (buf == NULL)) {
781 if (cur->type == XML_DTD_NODE)
783 if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
784 (cur->type == XML_DOCUMENT_NODE)){
785 htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
788 if (cur->type == XML_ATTRIBUTE_NODE) {
789 htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding);
792 if (cur->type == HTML_TEXT_NODE) {
793 if (cur->content != NULL) {
794 if (((cur->name == (const xmlChar *)xmlStringText) ||
795 (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
796 ((cur->parent == NULL) ||
797 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
798 (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
801 buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
807 xmlOutputBufferWriteString(buf, (const char *)cur->content);
812 if (cur->type == HTML_COMMENT_NODE) {
813 if (cur->content != NULL) {
815 xmlOutputBufferWriteString(buf, (const char *)cur->content);
820 if (cur->type == HTML_PI_NODE) {
821 if (cur->name == NULL)
824 xmlOutputBufferWriteString(buf, (const char *)cur->name);
825 if (cur->content != NULL) {
827 xmlOutputBufferWriteString(buf, (const char *)cur->content);
832 if (cur->type == HTML_ENTITY_REF_NODE) {
834 xmlOutputBufferWriteString(buf, (const char *)cur->name);
838 if (cur->type == HTML_PRESERVE_NODE) {
839 if (cur->content != NULL) {
840 xmlOutputBufferWriteString(buf, (const char *)cur->content);
848 if (cur->ns == NULL)
849 info = htmlTagLookup(cur->name);
854 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
855 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
858 xmlOutputBufferWriteString(buf, (const char *)cur->name);
859 if (cur->nsDef)
860 xmlNsListDumpOutput(buf, cur->nsDef);
861 if (cur->properties != NULL)
862 htmlAttrListDumpOutput(buf, doc, cur->properties, encoding);
866 if ((format) && (!info->isinline) && (cur->next != NULL)) {
867 if ((cur->next->type != HTML_TEXT_NODE) &&
868 (cur->next->type != HTML_ENTITY_REF_NODE) &&
869 (cur->parent != NULL) &&
870 (cur->parent->name != NULL) &&
871 (cur->parent->name[0] != 'p')) /* p, pre, param */
876 if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) &&
877 (cur->children == NULL)) {
884 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
885 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
888 xmlOutputBufferWriteString(buf, (const char *)cur->name);
891 if ((format) && (cur->next != NULL) &&
893 if ((cur->next->type != HTML_TEXT_NODE) &&
894 (cur->next->type != HTML_ENTITY_REF_NODE) &&
895 (cur->parent != NULL) &&
896 (cur->parent->name != NULL) &&
897 (cur->parent->name[0] != 'p')) /* p, pre, param */
903 if ((cur->type != XML_ELEMENT_NODE) &&
904 (cur->content != NULL)) {
910 xmlOutputBufferWriteString(buf, (const char *) cur->content);
912 if (cur->children != NULL) {
914 (cur->children->type != HTML_TEXT_NODE) &&
915 (cur->children->type != HTML_ENTITY_REF_NODE) &&
916 (cur->children != cur->last) &&
917 (cur->name != NULL) &&
918 (cur->name[0] != 'p')) /* p, pre, param */
920 htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format);
922 (cur->last->type != HTML_TEXT_NODE) &&
923 (cur->last->type != HTML_ENTITY_REF_NODE) &&
924 (cur->children != cur->last) &&
925 (cur->name != NULL) &&
926 (cur->name[0] != 'p')) /* p, pre, param */
930 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
931 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
934 xmlOutputBufferWriteString(buf, (const char *)cur->name);
937 (cur->next != NULL)) {
938 if ((cur->next->type != HTML_TEXT_NODE) &&
939 (cur->next->type != HTML_ENTITY_REF_NODE) &&
940 (cur->parent != NULL) &&
941 (cur->parent->name != NULL) &&
942 (cur->parent->name[0] != 'p')) /* p, pre, param */
951 * @cur: the current node
959 xmlNodePtr cur, const char *encoding) {
960 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, 1);
966 * @cur: the document
973 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
979 if ((buf == NULL) || (cur == NULL))
985 type = cur->type;
986 cur->type = XML_HTML_DOCUMENT_NODE;
987 if (cur->intSubset != NULL) {
988 htmlDtdDumpOutput(buf, cur, NULL);
990 if (cur->children != NULL) {
991 htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format);
994 cur->type = (xmlElementType) type;
1000 * @cur: the document
1006 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
1008 htmlDocContentDumpFormatOutput(buf, cur, encoding, 1);
1020 * @cur: the document
1027 htmlDocDump(FILE *f, xmlDocPtr cur) {
1035 if ((cur == NULL) || (f == NULL)) {
1039 encoding = (const char *) htmlGetMetaEncoding(cur);
1045 if (enc != cur->charset) {
1046 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1071 htmlDocContentDumpOutput(buf, cur, NULL);
1080 * @cur: the document
1087 htmlSaveFile(const char *filename, xmlDocPtr cur) {
1093 if ((cur == NULL) || (filename == NULL))
1098 encoding = (const char *) htmlGetMetaEncoding(cur);
1104 if (enc != cur->charset) {
1105 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1129 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression);
1132 htmlDocContentDumpOutput(buf, cur, NULL);
1141 * @cur: the document
1150 htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
1156 if ((cur == NULL) || (filename == NULL))
1165 if (enc != cur->charset) {
1166 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1176 htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
1179 htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8");
1196 htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
1205 * @cur: the document
1214 htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
1215 return(htmlSaveFileFormat(filename, cur, encoding, 1));