xsl-list
[Top] [All Lists]

Re: [xsl] Marshalling data (function parameters) into XSLT

2008-09-25 12:23:44
There is a standard way to do this in .NET:

    http://msdn.microsoft.com/en-us/library/943242d1.aspx


-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play



On 9/25/08, Justin Johansson <procode(_at_)adam(_dot_)com(_dot_)au> wrote:
Hello XSLT List,

Given a scenario of using XSLT as a generic functional computation engine,
(and thereby invoking an XSLT transform to implement the internals of a
function,
say, in the same way as one might use the Java Native Interface (JNI) to
implement a function in C++) ...

What is the most efficient was to marshall external data into the transform
engine as "parameters to the XSLT-implemented function"?

Me thinks there are only two ways and please correct me if I am wrong :-

1) Serialize the function parameters into an XML formatted character stream
and feed this into the transform as the source document
2) Pass the parameters into the transform via Transform.setParameter
(perhaps using an empty source document to satisfy the XSLT Transformer
need for a source document)

There is an obvious overhead in serializing using (1) if the parameters
already exist as native Java types.

Using (2) requires that the external (Java) driver can supply data types
directly to Transform.setParameter, and this sounds like a more efficient
way (to save the serializing overhead of 1).

To reduce the assumptions that this question might pose, let's assume a use
case in the first instance,

Use case A:
       Use XSLT to implement a simple arithmetic addition of two integers
predisposed as Java int's.

Use case B:
       Use XSLT to implement a reduce (or fold), in functional parlance, a
sequence of values predisposed as, say, a Java Vector<double>.

Thanks for the list's consideration of my question,

Justin Johansson


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>