* xmlSaveTree: * @ctxt: a document saving context * @cur: the top node of the subtree to save * * Save a subtree starting at the node parameter to a saving context * TODO: The function is not fully implemented yet as it does not return the * byte count but 0 instead * * Returns the number of byte written or -1 in case of error */
| 2142 | * Returns the number of byte written or -1 in case of error |
| 2143 | */ |
| 2144 | long |
| 2145 | xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) |
| 2146 | { |
| 2147 | long ret = 0; |
| 2148 | |
| 2149 | if ((ctxt == NULL) || (cur == NULL)) return(-1); |
| 2150 | #ifdef LIBXML_HTML_ENABLED |
| 2151 | if (ctxt->options & XML_SAVE_XHTML) { |
| 2152 | xhtmlNodeDumpOutput(ctxt, cur); |
| 2153 | return(ret); |
| 2154 | } |
| 2155 | if (((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) && |
| 2156 | (cur->doc->type == XML_HTML_DOCUMENT_NODE) && |
| 2157 | ((ctxt->options & XML_SAVE_AS_XML) == 0)) || |
| 2158 | (ctxt->options & XML_SAVE_AS_HTML)) { |
| 2159 | htmlNodeDumpOutputInternal(ctxt, cur); |
| 2160 | return(ret); |
| 2161 | } |
| 2162 | #endif |
| 2163 | xmlNodeDumpOutputInternal(ctxt, cur); |
| 2164 | return(ret); |
| 2165 | } |
| 2166 | |
| 2167 | /** |
| 2168 | * xmlSaveNotationDecl: |
no test coverage detected