diff --git a/include/libxml/xmlwriter.h b/include/libxml/xmlwriter.h index 91e683c8..9cb75f6b 100644 --- a/include/libxml/xmlwriter.h +++ b/include/libxml/xmlwriter.h @@ -471,6 +471,10 @@ extern "C" { xmlTextWriterSetIndentString(xmlTextWriterPtr writer, const xmlChar * str); + XMLPUBFUN int XMLCALL + xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar); + + /* * misc */ diff --git a/python/setup.py b/python/setup.py old mode 100755 new mode 100644 diff --git a/xmlwriter.c b/xmlwriter.c index b3e85fa5..4acd2fd5 100644 --- a/xmlwriter.c +++ b/xmlwriter.c @@ -4609,6 +4609,26 @@ xmlTextWriterSetIndentString(xmlTextWriterPtr writer, const xmlChar * str) return 0; } +/** + * xmlTextWriterSetQuoteChar: + * @writer: the xmlTextWriterPtr + * @quotechar: the quote character + * + * Set the character used for quoting attributes. + * + * Returns -1 on error or 0 otherwise. + */ +int +xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar) +{ + if ((writer == NULL) || ((quotechar != '\'') && (quotechar != '"'))) + return -1; + + writer->qchar = quotechar; + + return 0; +} + /** * xmlTextWriterWriteIndent: * @writer: the xmlTextWriterPtr