Hi Dean,
When you say it worked OK, but leaked memory, I'm assuming you mean your
code created a new document, but didn't delete it? Otherwise, I don't know
how you would have implemented this. If you create something in an
extension function, you would be responsible for managing/deleting it.
Regarding accepting a XalanNode as input -- I'm not sure exactly when this
was changed (I thought it was for 1.3, but your posting indicates it was
for 1.4), but I would need more details about what your code is doing to
determine what is happening. If you are using the XalanTransformer class,
you will probably need to use one of the new classes in the
XalanTransformer subsystem that wrap the appropriate implementation class.
See XalanSourceTreeWrapperParsedSource and XercesDOMWrapperParsedSource.
The reason for this restriction is that Xalan cannot determine the actual
implementation type from the base class, since we don't use RTTI and even
if we did, that would make impossible for users to extend the system with
their own source tree implementations. The plan is actually to deprecate
the constructor of XSLTInputSource that accepts a XalanNode.
Hope that helps...
Dave
"Dean O'Connor"
<[EMAIL PROTECTED] To:
<[email protected]>
e.com.au> cc: (bcc: David N
Bertoni/Cambridge/IBM)
Subject: Q: Xalan Exention
function transforming document fragment
04/10/2003 01:34
AM
Our application implemented a Xalan 2-argument extension function.
The input arguments to our function were a string, and a document fragment
of the processed XSL.
Our function needed to get the document fragment (plus descendants) into
string format for further processing.
The function returned a new DOM Document (as XObject nodeset).
When we used Xalan 1.3, this essentially worked ok, but leaked memory.
Later I found recent corroborating evidence of this problem in the xalanc
mail archive.
See following thread:
http://marc.theaimsgroup.com/?t=103431902900005&r=1&w=2
There seems to be a patch recommended on Xalan 1.4 (written for Xalan 1.6
dev) to make this work.
However, when we try and use 1.4 (which we now prefer) we now get other
another problem. It seems as though it is now not possible to use a
XSLTInputSource based on a XalanNode as input to a transform. The transform
throws an exception (when in Xalan 1.3 it happily accepted this and
performed the transform).
I have attached the XSL and the source code of the extension function.
Any information or suggestions to accomplish the same outcome.
Cheers,
Dean.