You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Ben Blakely <br...@isilver-inc.com> on 2000/07/12 23:01:22 UTC

Using Jacl for extension elements

Hi,

I'm trying to incorporate TCL code (using Jacl) into my XSL sheets, and
I've had a good amount of success defining extension functions. However,
extension elements seems to elude me. From what I can gather from the
documentation, a TCL (Jacl) procedure designated as an extension element
takes two arguments, with the second argument being a java object that
if I was using straight Java or Javascript, i'd be able to use the class
methods to pluck out my attributes and element value. However, when this
argument gets passed to a Jacl function, it seems to be useless, i.e.,
jacl does not recognize it as an existing java class or object. Here's a
sample of the code:

<lxslt:script lang="jacl">
  package require java

  proc cvs_write {xslProcessorContext elem} {
    return "whatever"
  }

</lxslt:script>


The "package require java" line provides an interface for creating and
manipulating Java objects directly within the jacl script, and I've
tried a number of techniques to try and get at the "elem" object that's
getting passed, but it's just not recognizing elem as anything useful. 

Has anyone actually made this work (using jacl to define extension
elements)? If so, is there some sample code out there that shows how
this might be accomplished? Any advice is appreciated,

Ben Blakely
Systems Admin
I-Silver, Inc.