Joe, Are you trying to write an extension element or an extension function.
Extension Elements:
If you look at the source code for the Redirect extension, it is short and to the point
piece of code to see how extensions work. With Extension Functions, I don't think you
can pass in objects although that may be incorrect. You might be able to parse the value
of an attribute as an XPath statement and cast the XObject to the object. i.e. parameter="$xslvariable"
then evaluate $xslvaraible as an XPath statement. Also with extension elements, the instance handling is
different. i.e. The constructor only occurs once per stylesheet/transformer instance and you can't control
when it happens.
Extension Functions have fine control over instance creation and you can pass variables into the constructor.
I ams not sure you can get back to the stylesheet pointer and you can only get back to the "real" node pointer
of the XML document if you use a DOM source and call the getDOMBackPointer. I have not yet found a
way back to the Stylesheet since the internals of Xalan is based on the DTM.
If you want an example of an Extension Function, although it a bit more complicated, look at the SQL extension
which represents the JDBC ResultsSet as a Xalan native DTM without creating the DOM document structure.
i.e. a low memory / processor overhead example of Java object as a XML structure in your transformations.
HTH John G
Joseph Shraibman wrote:
How do I get an extention element to operate on a passed in paramater, not a newly created instance of the class I use for my extention?
Joseph Shraibman wrote:
How do I implement extention elements? The docs at
http://xml.apache.org/xalan-j/extensions.html#ext-elements are pretty weak. There are examples of functions but not extention elements.
In addition
http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/lib/Redirect.html has a link labeled "Example with Redirect extension" but that link is broken.
-- -------------------------------------- John Gentilin Eye Catching Solutions Inc. 18314 Carlwyn Drive Castro Valley CA 94546
Contact Info [EMAIL PROTECTED] Ca Office 1-510-881-4821 NJ Office 1-732-422-4917
