mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-28 23:14:57 +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:
committed by
Daniel Veillard
parent
e00778b492
commit
429d3a0aae
@@ -471,6 +471,10 @@ extern "C" {
|
||||
xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
|
||||
const xmlChar * str);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar);
|
||||
|
||||
|
||||
/*
|
||||
* misc
|
||||
*/
|
||||
|
||||
0
python/setup.py
Executable file → Normal file
0
python/setup.py
Executable file → Normal file
20
xmlwriter.c
20
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
|
||||
|
||||
Reference in New Issue
Block a user