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:
committed by
Daniel Veillard
parent
e00778b492
commit
429d3a0aae
@@ -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
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;
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user