* Source/NSXMLNode.m (-XMLStringWithOptions:): Protect the

different format constants with version checks.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34935 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2012-03-16 07:56:15 +00:00
parent be8b523df9
commit 87a4b8d458
2 changed files with 15 additions and 2 deletions

View file

@ -1514,19 +1514,27 @@ execute_xpath(NSXMLNode *xmlNode, NSString *xpath_exp, NSString *nmspaces)
buffer = xmlBufferCreate();
// XML_SAVE_XHTML XML_SAVE_AS_HTML XML_SAVE_NO_DECL XML_SAVE_NO_XHTML
#if LIBXML_VERSION >= 20702
xmlOptions |= XML_SAVE_AS_XML;
#endif
#if LIBXML_VERSION >= 20708
if (options & NSXMLNodePreserveWhitespace)
{
xmlOptions |= XML_SAVE_WSNONSIG;
}
#endif
#if LIBXML_VERSION >= 20622
if (options & NSXMLNodeCompactEmptyElement)
{
xmlOptions |= XML_SAVE_NO_EMPTY;
}
#endif
#if LIBXML_VERSION >= 20617
if (options & NSXMLNodePrettyPrint)
{
xmlOptions |= XML_SAVE_FORMAT;
}
#endif
ctxt = xmlSaveToBuffer(buffer, "utf-8", xmlOptions);
xmlSaveTree(ctxt, internal->node);