[xslt] Handling <redirect:write append="yes">
- From: Phil Shafer <phil juniper net>
- To: The Gnome XSLT library mailing-list <xslt gnome org>
- Subject: [xslt] Handling <redirect:write append="yes">
- Date: Fri, 16 Dec 2011 14:28:17 -0500
I'd like to add support for <redirect:write append="yes"> to libxslt,
mirroring functionality that's available in other XSLT engines.
The problem is that this requires adding an "append" flag to
xmlFileOpenW(), which ends up percolating up through the public
API, which isn't acceptable. For example, while xmlFileOpenW() is
static, the function signature is used xmlRegisterOutputCallbacks(),
which is part of the public API and can't be changed.
The alternative is to create a parallel set of functions that mirror
the existing ones but add a "flags" parameter that can include an
append flag. This will retain current behaviours and APIs, but
will allow new code to call new functions which accept this flags
parameter.
So where xsltDocumentElem() currently calls xsltSaveResultToFilename(),
it will call xsltSaveResultToFilenameFlags() with the flags parameter
indicating if the 'append="yes"' attribute was given. Callers can
continue to call xmlRegisterOutputCallbacks() with their existing
IO functions, or can call xmlRegisterOutputCallbacksFlags() and
pass in functions that accept the new flags parameter.
This solution, while repetative, seems like the only workable answer.
Are there any other suggestions or alternatives? Is the "Flags"
suffix acceptable? If so, I'll work up a patch.
Thanks,
Phil
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]