[xslt] get transform context from extension function ?



I am using libxslt 1.0.1

I am writing an extension function which creates an
external object (xmlXPathObjectType = XPATH_USERS).
The actual data is pointed to by the void * user data
in xmlXpathObject.  This user field is filled in by a
call to xmlXPathReturnExternal.  

It appears that when an external object is deallocated
the xmlXPathObject is simply deallocated and the user
field is ignored.  So, I thought I'd keep a list of
all the external objects which have been allocated in
the transform context.  Then, when the transform context
is deallocated I could run through this list of external
objects and deallocate them. 

I have already made a minor change to xsltApplyStyleSheetInternal
so that I can get access to the transform context for
another part of my application, but I'm trying to keep
down the number of such changes to the distribution.

My problem: when the extension function is called it 
receives a pointer to the xmlXPathParserContext, and
I'm not sure how to find the current transform context.
>From xmlXPathParserContext I can get an xmlXPathContext.
>From xmlXPathContext I can get a pointer to a node or
a document.  From there, I suppose I could find the
transform context.

Is there a better way ?

Tom Moog
Polhode, Inc.






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