• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:output +full:- +full:document

43  * @doc:  the document
57 cur = doc->children; 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()
75 cur = cur->children; 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()
92 cur = cur->children; 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()
108 if ((attr->children != NULL) && in htmlGetMetaEncoding()
109 (attr->children->type == XML_TEXT_NODE) && in htmlGetMetaEncoding()
110 (attr->children->next == NULL)) { in htmlGetMetaEncoding()
111 value = attr->children->content; in htmlGetMetaEncoding()
112 if ((!xmlStrcasecmp(attr->name, BAD_CAST"http-equiv")) in htmlGetMetaEncoding()
113 && (!xmlStrcasecmp(value, BAD_CAST"Content-Type"))) in htmlGetMetaEncoding()
116 && (!xmlStrcasecmp(attr->name, BAD_CAST"content"))) in htmlGetMetaEncoding()
121 attr = attr->next; in htmlGetMetaEncoding()
125 cur = cur->next; in htmlGetMetaEncoding()
154 * @doc: the document
158 * NOTE: this will not change the document content encoding, just
161 * Returns 0 in case of success and -1 in case of error
172 return(-1); in htmlSetMetaEncoding()
176 return(-1); in htmlSetMetaEncoding()
181 newcontent[sizeof(newcontent) - 1] = 0; in htmlSetMetaEncoding()
184 cur = doc->children; 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()
201 return(-1); in htmlSetMetaEncoding()
202 cur = cur->children; 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()
219 return(-1); in htmlSetMetaEncoding()
222 if (cur->children == NULL) in htmlSetMetaEncoding()
224 cur = cur->children; 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()
241 if ((attr->children != NULL) && in htmlSetMetaEncoding()
242 (attr->children->type == XML_TEXT_NODE) && in htmlSetMetaEncoding()
243 (attr->children->next == NULL)) { in htmlSetMetaEncoding()
244 value = attr->children->content; in htmlSetMetaEncoding()
245 if ((!xmlStrcasecmp(attr->name, BAD_CAST"http-equiv")) in htmlSetMetaEncoding()
246 && (!xmlStrcasecmp(value, BAD_CAST"Content-Type"))) in htmlSetMetaEncoding()
251 (!xmlStrcasecmp(attr->name, BAD_CAST"content"))) in htmlSetMetaEncoding()
257 attr = attr->next; in htmlSetMetaEncoding()
266 cur = cur->next; in htmlSetMetaEncoding()
276 if (head->children == NULL) in htmlSetMetaEncoding()
279 xmlAddPrevSibling(head->children, meta); in htmlSetMetaEncoding()
280 xmlNewProp(meta, BAD_CAST"http-equiv", BAD_CAST"Content-Type"); in htmlSetMetaEncoding()
289 /* change the document only if there is a real encoding change */ in htmlSetMetaEncoding()
302 * These are the HTML attributes which will be output
304 * output as <option selected>, as per XSLT 1.0 16.2 "HTML Output Method"
343 * Output error handlers *
373 msg = "string is not in UTF-8\n"; in htmlSaveErr()
398 * @buf: the xmlBufPtr output
399 * @doc: the document
405 * Returns the number of byte written or -1 in case of error
415 return (-1); in htmlBufNodeDumpFormat()
418 return (-1); in htmlBufNodeDumpFormat()
422 htmlSaveErrMemory("allocating HTML output buffer"); in htmlBufNodeDumpFormat()
423 return (-1); in htmlBufNodeDumpFormat()
426 outbuf->buffer = buf; in htmlBufNodeDumpFormat()
427 outbuf->encoder = NULL; in htmlBufNodeDumpFormat()
428 outbuf->writecallback = NULL; in htmlBufNodeDumpFormat()
429 outbuf->closecallback = NULL; in htmlBufNodeDumpFormat()
430 outbuf->context = NULL; in htmlBufNodeDumpFormat()
431 outbuf->written = 0; in htmlBufNodeDumpFormat()
436 ret = xmlBufUse(buf) - use; in htmlBufNodeDumpFormat()
442 * @buf: the HTML buffer output
443 * @doc: the document
449 * Returns the number of byte written or -1 in case of error
457 return(-1); in htmlNodeDump()
462 return(-1); in htmlNodeDump()
469 return(-1); in htmlNodeDump()
476 * @doc: the document
478 * @encoding: the document encoding
485 * returns: the number of byte written or -1 in case of failure.
530 * @doc: the document
543 * @cur: the document
548 * Dump an HTML document in memory and return the xmlChar * and it's size.
599 if (buf->conv != NULL) { in htmlDocDumpMemoryFormat()
600 *size = xmlBufUse(buf->conv); in htmlDocDumpMemoryFormat()
601 *mem = xmlStrndup(xmlBufContent(buf->conv), *size); in htmlDocDumpMemoryFormat()
603 *size = xmlBufUse(buf->buffer); in htmlDocDumpMemoryFormat()
604 *mem = xmlStrndup(xmlBufContent(buf->buffer), *size); in htmlDocDumpMemoryFormat()
611 * @cur: the document
615 * Dump an HTML document in memory and return the xmlChar * and it's size.
626 * Dumping HTML tree content to an I/O output buffer *
634 * @buf: the HTML buffer output
635 * @doc: the document
640 * Dump the HTML document DTD, if any.
645 xmlDtdPtr cur = doc->intSubset; 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()
670 * @buf: the HTML buffer output
671 * @doc: the document
683 * The html output method should not escape a & character in htmlAttrDumpOutput()
693 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlAttrDumpOutput()
694 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlAttrDumpOutput()
697 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlAttrDumpOutput()
698 if ((cur->children != NULL) && (!htmlIsBooleanAttr(cur->name))) { in htmlAttrDumpOutput()
699 value = xmlNodeListGetString(doc, cur->children, 0); in htmlAttrDumpOutput()
702 if ((cur->ns == NULL) && (cur->parent != NULL) && in htmlAttrDumpOutput()
703 (cur->parent->ns == NULL) && in htmlAttrDumpOutput()
704 ((!xmlStrcasecmp(cur->name, BAD_CAST "href")) || in htmlAttrDumpOutput()
705 (!xmlStrcasecmp(cur->name, BAD_CAST "action")) || in htmlAttrDumpOutput()
706 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) || in htmlAttrDumpOutput()
707 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) && in htmlAttrDumpOutput()
708 (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) { in htmlAttrDumpOutput()
711 xmlBufCCat(buf->buffer, "\""); in htmlAttrDumpOutput()
720 xmlChar *start = (xmlChar *)xmlStrstr(tmp, BAD_CAST "<!--"); in htmlAttrDumpOutput()
722 end = (xmlChar *)xmlStrstr(tmp, BAD_CAST "-->"); in htmlAttrDumpOutput()
731 xmlBufCat(buf->buffer, escaped); in htmlAttrDumpOutput()
734 xmlBufCat(buf->buffer, tmp); in htmlAttrDumpOutput()
742 *start = '<'; /* Restore the first character of "<!--". */ in htmlAttrDumpOutput()
743 end += 3; /* strlen("-->") */ in htmlAttrDumpOutput()
746 xmlBufCat(buf->buffer, start); in htmlAttrDumpOutput()
751 xmlBufCCat(buf->buffer, "\""); in htmlAttrDumpOutput()
753 xmlBufWriteQuotedString(buf->buffer, value); in htmlAttrDumpOutput()
764 * @buf: the HTML buffer output
765 * @doc: the document
778 cur = cur->next; in htmlAttrListDumpOutput()
786 * @buf: the HTML buffer output
787 * @doc: the document
802 cur = cur->next; in htmlNodeListDumpOutput()
808 * @buf: the HTML buffer output
809 * @doc: the document
829 if (cur->type == XML_DTD_NODE) in htmlNodeDumpFormatOutput()
831 if ((cur->type == XML_HTML_DOCUMENT_NODE) || in htmlNodeDumpFormatOutput()
832 (cur->type == XML_DOCUMENT_NODE)){ in htmlNodeDumpFormatOutput()
836 if (cur->type == XML_ATTRIBUTE_NODE) { in htmlNodeDumpFormatOutput()
840 if (cur->type == HTML_TEXT_NODE) { in htmlNodeDumpFormatOutput()
841 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
842 if (((cur->name == (const xmlChar *)xmlStringText) || in htmlNodeDumpFormatOutput()
843 (cur->name != (const xmlChar *)xmlStringTextNoenc)) && in htmlNodeDumpFormatOutput()
844 ((cur->parent == NULL) || in htmlNodeDumpFormatOutput()
845 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) && in htmlNodeDumpFormatOutput()
846 (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) { in htmlNodeDumpFormatOutput()
849 buffer = xmlEncodeEntitiesReentrant(doc, cur->content); in htmlNodeDumpFormatOutput()
855 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
860 if (cur->type == HTML_COMMENT_NODE) { in htmlNodeDumpFormatOutput()
861 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
862 xmlOutputBufferWriteString(buf, "<!--"); in htmlNodeDumpFormatOutput()
863 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
864 xmlOutputBufferWriteString(buf, "-->"); in htmlNodeDumpFormatOutput()
868 if (cur->type == HTML_PI_NODE) { in htmlNodeDumpFormatOutput()
869 if (cur->name == NULL) in htmlNodeDumpFormatOutput()
872 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
873 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
875 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
880 if (cur->type == HTML_ENTITY_REF_NODE) { in htmlNodeDumpFormatOutput()
882 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
886 if (cur->type == HTML_PRESERVE_NODE) { in htmlNodeDumpFormatOutput()
887 if (cur->content != NULL) { in htmlNodeDumpFormatOutput()
888 xmlOutputBufferWriteString(buf, (const char *)cur->content); in htmlNodeDumpFormatOutput()
896 if (cur->ns == NULL) in htmlNodeDumpFormatOutput()
897 info = htmlTagLookup(cur->name); in htmlNodeDumpFormatOutput()
902 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
903 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
906 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
907 if (cur->nsDef) in htmlNodeDumpFormatOutput()
908 xmlNsListDumpOutput(buf, cur->nsDef); in htmlNodeDumpFormatOutput()
909 if (cur->properties != NULL) in htmlNodeDumpFormatOutput()
910 htmlAttrListDumpOutput(buf, doc, cur->properties, encoding); in htmlNodeDumpFormatOutput()
912 if ((info != NULL) && (info->empty)) { in htmlNodeDumpFormatOutput()
914 if ((format) && (!info->isinline) && (cur->next != NULL)) { in htmlNodeDumpFormatOutput()
915 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
916 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
917 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
918 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
919 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
924 if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) && in htmlNodeDumpFormatOutput()
925 (cur->children == NULL)) { in htmlNodeDumpFormatOutput()
926 if ((info != NULL) && (info->saveEndTag != 0) && in htmlNodeDumpFormatOutput()
927 (xmlStrcmp(BAD_CAST info->name, BAD_CAST "html")) && in htmlNodeDumpFormatOutput()
928 (xmlStrcmp(BAD_CAST info->name, BAD_CAST "body"))) { in htmlNodeDumpFormatOutput()
932 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
933 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
936 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
939 if ((format) && (cur->next != NULL) && in htmlNodeDumpFormatOutput()
940 (info != NULL) && (!info->isinline)) { in htmlNodeDumpFormatOutput()
941 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
942 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
943 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
944 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
945 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
951 if ((cur->type != XML_ELEMENT_NODE) && in htmlNodeDumpFormatOutput()
952 (cur->content != NULL)) { in htmlNodeDumpFormatOutput()
958 xmlOutputBufferWriteString(buf, (const char *) cur->content); in htmlNodeDumpFormatOutput()
960 if (cur->children != NULL) { in htmlNodeDumpFormatOutput()
961 if ((format) && (info != NULL) && (!info->isinline) && in htmlNodeDumpFormatOutput()
962 (cur->children->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
963 (cur->children->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
964 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
965 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
966 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
968 htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format); in htmlNodeDumpFormatOutput()
969 if ((format) && (info != NULL) && (!info->isinline) && in htmlNodeDumpFormatOutput()
970 (cur->last->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
971 (cur->last->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
972 (cur->children != cur->last) && in htmlNodeDumpFormatOutput()
973 (cur->name != NULL) && in htmlNodeDumpFormatOutput()
974 (cur->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
978 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { in htmlNodeDumpFormatOutput()
979 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); in htmlNodeDumpFormatOutput()
982 xmlOutputBufferWriteString(buf, (const char *)cur->name); in htmlNodeDumpFormatOutput()
984 if ((format) && (info != NULL) && (!info->isinline) && in htmlNodeDumpFormatOutput()
985 (cur->next != NULL)) { in htmlNodeDumpFormatOutput()
986 if ((cur->next->type != HTML_TEXT_NODE) && in htmlNodeDumpFormatOutput()
987 (cur->next->type != HTML_ENTITY_REF_NODE) && in htmlNodeDumpFormatOutput()
988 (cur->parent != NULL) && in htmlNodeDumpFormatOutput()
989 (cur->parent->name != NULL) && in htmlNodeDumpFormatOutput()
990 (cur->parent->name[0] != 'p')) /* p, pre, param */ in htmlNodeDumpFormatOutput()
997 * @buf: the HTML buffer output
998 * @doc: the document
1013 * @buf: the HTML buffer output
1014 * @cur: the document
1018 * Dump an HTML document.
1031 * force to output the stuff as HTML, especially for entities in htmlDocContentDumpFormatOutput()
1033 type = cur->type; in htmlDocContentDumpFormatOutput()
1034 cur->type = XML_HTML_DOCUMENT_NODE; in htmlDocContentDumpFormatOutput()
1035 if (cur->intSubset != NULL) { in htmlDocContentDumpFormatOutput()
1038 if (cur->children != NULL) { in htmlDocContentDumpFormatOutput()
1039 htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format); in htmlDocContentDumpFormatOutput()
1042 cur->type = (xmlElementType) type; in htmlDocContentDumpFormatOutput()
1047 * @buf: the HTML buffer output
1048 * @cur: the document
1051 * Dump an HTML document. Formating return/spaces are added.
1061 * Saving functions front-ends *
1068 * @cur: the document
1070 * Dump an HTML document to an open FILE.
1072 * returns: the number of byte written or -1 in case of failure.
1084 return(-1); in htmlDocDump()
1109 if (buf == NULL) return(-1); in htmlDocDump()
1119 * @cur: the document
1121 * Dump an HTML document to a file. If @filename is "-" the stdout file is
1123 * returns: the number of byte written or -1 in case of failure.
1133 return(-1); in htmlSaveFile()
1161 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); in htmlSaveFile()
1173 * @cur: the document
1175 * @encoding: the document encoding
1177 * Dump an HTML document to a file using a given encoding.
1179 * returns: the number of byte written or -1 in case of failure.
1189 return(-1); in htmlSaveFileFormat()
1204 htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8"); in htmlSaveFileFormat()
1230 * @cur: the document
1231 * @encoding: the document encoding
1233 * Dump an HTML document to a file using a given encoding
1236 * returns: the number of byte written or -1 in case of failure.