1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

Allow to set the quoting character of an xmlWriter

It's otherwise impossible to set the quoting character of
attribute values of an xmlWriter.
This commit is contained in:
Csaba Raduly
2012-09-11 11:50:25 +08:00
committed by Daniel Veillard
parent e00778b492
commit 429d3a0aae
3 changed files with 24 additions and 0 deletions

View File

@@ -471,6 +471,10 @@ extern "C" {
xmlTextWriterSetIndentString(xmlTextWriterPtr writer, xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
const xmlChar * str); const xmlChar * str);
XMLPUBFUN int XMLCALL
xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar);
/* /*
* misc * misc
*/ */

0
python/setup.py Executable file → Normal file
View File

View File

@@ -4609,6 +4609,26 @@ xmlTextWriterSetIndentString(xmlTextWriterPtr writer, const xmlChar * str)
return 0; 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: * xmlTextWriterWriteIndent:
* @writer: the xmlTextWriterPtr * @writer: the xmlTextWriterPtr