Lines Matching refs:cur
462 xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
464 static void xmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
465 static void xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
466 void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
467 static int xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur);
472 * @cur: a namespace
478 xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur) {
479 if ((cur == NULL) || (buf == NULL)) return;
480 if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
481 if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
485 if (cur->prefix != NULL) {
487 xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
491 xmlBufferWriteQuotedString(buf->buffer, cur->href);
498 * @cur: the first namespace
504 xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur) {
505 while (cur != NULL) {
506 xmlNsDumpOutput(buf, cur);
507 cur = cur->next;
570 * @cur: the attribute pointer
575 xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
578 if (cur == NULL) return;
582 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
583 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
586 xmlOutputBufferWriteString(buf, (const char *)cur->name);
588 xmlAttrSerializeContent(buf, cur);
596 * @cur: the first attribute pointer
602 xmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
603 if (cur == NULL) return;
604 while (cur != NULL) {
605 xmlAttrDumpOutput(ctxt, cur);
606 cur = cur->next;
614 * @cur: the first node
619 xmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
622 if (cur == NULL) return;
624 while (cur != NULL) {
626 ((cur->type == XML_ELEMENT_NODE) ||
627 (cur->type == XML_COMMENT_NODE) ||
628 (cur->type == XML_PI_NODE)))
633 xmlNodeDumpOutputInternal(ctxt, cur);
637 cur = cur->next;
643 * @cur: the current node
648 xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
654 if (cur == NULL) return;
656 if (cur->type == XML_XINCLUDE_START)
658 if (cur->type == XML_XINCLUDE_END)
660 if ((cur->type == XML_DOCUMENT_NODE) ||
661 (cur->type == XML_HTML_DOCUMENT_NODE)) {
662 xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
665 if (cur->type == XML_DTD_NODE) {
666 xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
669 if (cur->type == XML_DOCUMENT_FRAG_NODE) {
670 xmlNodeListDumpOutput(ctxt, cur->children);
673 if (cur->type == XML_ELEMENT_DECL) {
674 xmlDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
677 if (cur->type == XML_ATTRIBUTE_DECL) {
678 xmlDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
681 if (cur->type == XML_ENTITY_DECL) {
682 xmlDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
685 if (cur->type == XML_TEXT_NODE) {
686 if (cur->content != NULL) {
687 if (cur->name != xmlStringTextNoenc) {
688 xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
693 xmlOutputBufferWriteString(buf, (const char *) cur->content);
699 if (cur->type == XML_PI_NODE) {
700 if (cur->content != NULL) {
702 xmlOutputBufferWriteString(buf, (const char *)cur->name);
703 if (cur->content != NULL) {
705 xmlOutputBufferWriteString(buf, (const char *)cur->content);
710 xmlOutputBufferWriteString(buf, (const char *)cur->name);
715 if (cur->type == XML_COMMENT_NODE) {
716 if (cur->content != NULL) {
718 xmlOutputBufferWriteString(buf, (const char *)cur->content);
723 if (cur->type == XML_ENTITY_REF_NODE) {
725 xmlOutputBufferWriteString(buf, (const char *)cur->name);
729 if (cur->type == XML_CDATA_SECTION_NODE) {
730 if (cur->content == NULL) {
733 start = end = cur->content;
753 if (cur->type == XML_ATTRIBUTE_NODE) {
754 xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
757 if (cur->type == XML_NAMESPACE_DECL) {
758 xmlNsDumpOutput(buf, (xmlNsPtr) cur);
764 tmp = cur->children;
776 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
777 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
781 xmlOutputBufferWriteString(buf, (const char *)cur->name);
782 if (cur->nsDef)
783 xmlNsListDumpOutput(buf, cur->nsDef);
784 if (cur->properties != NULL)
785 xmlAttrListDumpOutput(ctxt, cur->properties);
787 if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) &&
788 (cur->children == NULL) && ((ctxt->options & XML_SAVE_NO_EMPTY) == 0)) {
794 if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
795 xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
797 if (cur->children != NULL) {
800 xmlNodeListDumpOutput(ctxt, cur->children);
809 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
810 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
814 xmlOutputBufferWriteString(buf, (const char *)cur->name);
821 * @cur: the document
826 xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) {
831 const xmlChar *oldenc = cur->encoding;
842 cur->encoding = BAD_CAST ctxt->encoding;
843 } else if (cur->encoding != NULL) {
844 encoding = cur->encoding;
845 } else if (cur->charset != XML_CHAR_ENCODING_UTF8) {
847 xmlGetCharEncodingName((xmlCharEncoding) cur->charset);
891 if (cur->version != NULL)
892 xmlBufferWriteQuotedString(buf->buffer, cur->version);
899 switch (cur->standalone) {
912 dtd = xmlGetIntSubset(cur);
919 if (cur->children != NULL) {
920 xmlNodePtr child = cur->children;
935 cur->encoding = oldenc;
1033 * @cur: the first attribute pointer
1038 xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
1046 if (cur == NULL) return;
1048 parent = cur->parent;
1049 while (cur != NULL) {
1050 if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
1051 id = cur;
1053 if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
1054 name = cur;
1056 if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
1057 lang = cur;
1059 if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
1060 (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
1061 xml_lang = cur;
1062 else if ((cur->ns == NULL) &&
1063 ((cur->children == NULL) ||
1064 (cur->children->content == NULL) ||
1065 (cur->children->content[0] == 0)) &&
1066 (htmlIsBooleanAttr(cur->name))) {
1067 if (cur->children != NULL)
1068 xmlFreeNode(cur->children);
1069 cur->children = xmlNewText(cur->name);
1070 if (cur->children != NULL)
1071 cur->children->parent = (xmlNodePtr) cur;
1073 xmlAttrDumpOutput(ctxt, cur);
1074 cur = cur->next;
1114 * @cur: the first node
1124 xhtmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
1127 if (cur == NULL) return;
1129 while (cur != NULL) {
1131 (cur->type == XML_ELEMENT_NODE))
1136 xhtmlNodeDumpOutput(ctxt, cur);
1140 cur = cur->next;
1148 * @cur: the current node
1156 xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
1162 if (cur == NULL) return;
1163 if ((cur->type == XML_DOCUMENT_NODE) ||
1164 (cur->type == XML_HTML_DOCUMENT_NODE)) {
1165 xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
1168 if (cur->type == XML_XINCLUDE_START)
1170 if (cur->type == XML_XINCLUDE_END)
1172 if (cur->type == XML_DTD_NODE) {
1173 xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
1176 if (cur->type == XML_DOCUMENT_FRAG_NODE) {
1177 xhtmlNodeListDumpOutput(ctxt, cur->children);
1181 if (cur->type == XML_ELEMENT_DECL) {
1182 xmlDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
1185 if (cur->type == XML_ATTRIBUTE_DECL) {
1186 xmlDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
1189 if (cur->type == XML_ENTITY_DECL) {
1190 xmlDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
1193 if (cur->type == XML_TEXT_NODE) {
1194 if (cur->content != NULL) {
1195 if ((cur->name == xmlStringText) ||
1196 (cur->name != xmlStringTextNoenc)) {
1197 xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
1202 xmlOutputBufferWriteString(buf, (const char *) cur->content);
1208 if (cur->type == XML_PI_NODE) {
1209 if (cur->content != NULL) {
1211 xmlOutputBufferWriteString(buf, (const char *)cur->name);
1212 if (cur->content != NULL) {
1214 xmlOutputBufferWriteString(buf, (const char *)cur->content);
1219 xmlOutputBufferWriteString(buf, (const char *)cur->name);
1224 if (cur->type == XML_COMMENT_NODE) {
1225 if (cur->content != NULL) {
1227 xmlOutputBufferWriteString(buf, (const char *)cur->content);
1232 if (cur->type == XML_ENTITY_REF_NODE) {
1234 xmlOutputBufferWriteString(buf, (const char *)cur->name);
1238 if (cur->type == XML_CDATA_SECTION_NODE) {
1239 start = end = cur->content;
1257 if (cur->type == XML_ATTRIBUTE_NODE) {
1258 xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
1264 tmp = cur->children;
1275 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
1276 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
1280 xmlOutputBufferWriteString(buf, (const char *)cur->name);
1281 if (cur->nsDef)
1282 xmlNsListDumpOutput(buf, cur->nsDef);
1283 if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
1284 (cur->ns == NULL) && (cur->nsDef == NULL))) {
1291 if (cur->properties != NULL)
1292 xhtmlAttrListDumpOutput(ctxt, cur->properties);
1294 if ((cur->type == XML_ELEMENT_NODE) &&
1295 (cur->parent != NULL) &&
1296 (cur->parent->parent == (xmlNodePtr) cur->doc) &&
1297 xmlStrEqual(cur->name, BAD_CAST"head") &&
1298 xmlStrEqual(cur->parent->name, BAD_CAST"html")) {
1300 tmp = cur->children;
1320 if ((cur->type == XML_ELEMENT_NODE) && (cur->children == NULL)) {
1321 if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
1322 ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
1354 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
1355 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
1358 xmlOutputBufferWriteString(buf, (const char *)cur->name);
1381 if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
1382 xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
1393 if ((cur->type == XML_ELEMENT_NODE) &&
1394 ((xmlStrEqual(cur->name, BAD_CAST "script")) ||
1395 (xmlStrEqual(cur->name, BAD_CAST "style"))) &&
1396 ((cur->ns == NULL) ||
1397 (xmlStrEqual(cur->ns->href, XHTML_NS_NAME)))) {
1398 xmlNodePtr child = cur->children;
1457 if (cur->children != NULL) {
1463 xhtmlNodeListDumpOutput(ctxt, cur->children);
1473 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
1474 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
1478 xmlOutputBufferWriteString(buf, (const char *)cur->name);
1747 xmlChar *base, *cur;
1751 base = cur = (xmlChar *) string;
1752 while (*cur != 0) {
1753 if (*cur == '\n') {
1754 if (base != cur)
1755 xmlBufferAdd(buf, base, cur - base);
1757 cur++;
1758 base = cur;
1759 } else if (*cur == '\r') {
1760 if (base != cur)
1761 xmlBufferAdd(buf, base, cur - base);
1763 cur++;
1764 base = cur;
1765 } else if (*cur == '\t') {
1766 if (base != cur)
1767 xmlBufferAdd(buf, base, cur - base);
1769 cur++;
1770 base = cur;
1771 } else if (*cur == '"') {
1772 if (base != cur)
1773 xmlBufferAdd(buf, base, cur - base);
1775 cur++;
1776 base = cur;
1777 } else if (*cur == '<') {
1778 if (base != cur)
1779 xmlBufferAdd(buf, base, cur - base);
1781 cur++;
1782 base = cur;
1783 } else if (*cur == '>') {
1784 if (base != cur)
1785 xmlBufferAdd(buf, base, cur - base);
1787 cur++;
1788 base = cur;
1789 } else if (*cur == '&') {
1790 if (base != cur)
1791 xmlBufferAdd(buf, base, cur - base);
1793 cur++;
1794 base = cur;
1795 } else if ((*cur >= 0x80) && ((doc == NULL) ||
1803 if (base != cur)
1804 xmlBufferAdd(buf, base, cur - base);
1805 if (*cur < 0xC0) {
1809 xmlSerializeHexCharRef(tmp, *cur);
1811 cur++;
1812 base = cur;
1814 } else if (*cur < 0xE0) {
1815 val = (cur[0]) & 0x1F;
1817 val |= (cur[1]) & 0x3F;
1819 } else if (*cur < 0xF0) {
1820 val = (cur[0]) & 0x0F;
1822 val |= (cur[1]) & 0x3F;
1824 val |= (cur[2]) & 0x3F;
1826 } else if (*cur < 0xF8) {
1827 val = (cur[0]) & 0x07;
1829 val |= (cur[1]) & 0x3F;
1831 val |= (cur[2]) & 0x3F;
1833 val |= (cur[3]) & 0x3F;
1841 xmlSerializeHexCharRef(tmp, *cur);
1843 cur++;
1844 base = cur;
1853 cur += l;
1854 base = cur;
1856 cur++;
1859 if (base != cur)
1860 xmlBufferAdd(buf, base, cur - base);
1867 * @cur: the current node
1878 xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level,
1887 if (cur == NULL) {
1915 xmlNodeDumpOutput(outbuf, doc, cur, level, format, NULL);
1925 * @cur: the current node
1930 xmlElemDump(FILE * f, xmlDocPtr doc, xmlNodePtr cur)
1936 if (cur == NULL) {
1939 "xmlElemDump : cur == NULL\n");
1955 htmlNodeDumpOutput(outbuf, doc, cur, NULL);
1957 xmlSaveErr(XML_ERR_INTERNAL_ERROR, cur, "HTML support not compiled in\n");
1960 xmlNodeDumpOutput(outbuf, doc, cur, 0, 1, NULL);
1974 * @cur: the current node
1984 xmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
1995 if ((buf == NULL) || (cur == NULL)) return;
2017 xhtmlNodeDumpOutput(&ctxt, cur);
2020 xmlNodeDumpOutputInternal(&ctxt, cur);
2113 * @cur: the document
2123 xmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
2124 xmlDocDumpFormatMemoryEnc(cur, mem, size, NULL, 0);
2129 * @cur: the document
2141 xmlDocDumpFormatMemory(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
2142 xmlDocDumpFormatMemoryEnc(cur, mem, size, NULL, format);
2167 * @cur: the document
2177 xmlDocFormatDump(FILE *f, xmlDocPtr cur, int format) {
2184 if (cur == NULL) {
2191 encoding = (const char *) cur->encoding;
2196 xmlFree((char *) cur->encoding);
2197 cur->encoding = NULL;
2204 ctxt.doc = cur;
2210 xmlDocContentDumpOutput(&ctxt, cur);
2219 * @cur: the document
2226 xmlDocDump(FILE *f, xmlDocPtr cur) {
2227 return(xmlDocFormatDump (f, cur, 0));
2233 * @cur: the document
2243 xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding) {
2248 if (cur == NULL) {
2253 ctxt.doc = cur;
2259 xmlDocContentDumpOutput(&ctxt, cur);
2267 * @cur: the document
2278 xmlSaveFormatFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur,
2285 if ((cur == NULL) ||
2286 ((cur->type != XML_DOCUMENT_NODE) &&
2287 (cur->type != XML_HTML_DOCUMENT_NODE))) {
2292 ctxt.doc = cur;
2298 xmlDocContentDumpOutput(&ctxt, cur);
2306 * @cur: the document being saved
2317 xmlSaveFormatFileEnc( const char * filename, xmlDocPtr cur,
2324 if (cur == NULL)
2328 encoding = (const char *) cur->encoding;
2338 if (cur->compression < 0) cur->compression = xmlGetCompressMode();
2343 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression);
2346 ctxt.doc = cur;
2353 xmlDocContentDumpOutput(&ctxt, cur);
2363 * @cur: the document
2371 xmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
2372 return ( xmlSaveFormatFileEnc( filename, cur, encoding, 0 ) );
2378 * @cur: the document
2390 xmlSaveFormatFile(const char *filename, xmlDocPtr cur, int format) {
2391 return ( xmlSaveFormatFileEnc( filename, cur, NULL, format ) );
2397 * @cur: the document
2405 xmlSaveFile(const char *filename, xmlDocPtr cur) {
2406 return(xmlSaveFormatFileEnc(filename, cur, NULL, 0));