[xslt] Handling <redirect:write append="yes">

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

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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]