Cunning Plan Failed - Error passing document-node as parameter

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cunning Plan Failed - Error passing document-node as parameter

Ihe Onwuka-2
I am trying to run a transform within eXist that is xsl:keyed on a 4MB
document. Because this transform is to run against 100's of files I
had the following cunning (I thought) plan.

Variables the keyed document as pass it to the transform as the third
parameter of the eXist transform function, declare the corresponding
xsl:param in the transform to be of type document-node(). Then invoke
the transform from XQuery .

Now I thought this would work because the signature of eXist's
transform:transform allows for the parameter passed to be a node.
Signature below

transform:transform($node-tree as node()*, $stylesheet as item(), $parameters as
node()?) as node()?

Experience has led me to believe that this is a tantalisingly illusory
mechanism. The only reason it's a node is because eXists demands it to
be encased in a parameter element because eXist will only ever send a
string. However xsl:param takes parameters of any type so unless there
is some restriction on the types allowed for external parameter then
this would appear to be wro....wr...wr.....not as expected.

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Cunning Plan Failed - Error passing document-node as parameter

Ihe Onwuka-2
On Tue, Apr 1, 2014 at 8:49 PM, Ihe Onwuka <[hidden email]> wrote:
> I am trying to run a transform within eXist that is xsl:keyed on a 4MB
> document. Because this transform is to run against 100's of files I
> had the following cunning (I thought) plan.
>
> Variables the keyed document as pass it to the transform as the third

Variablelize the keyed document and pass it to the transform as the third

> parameter of the eXist transform function, declare the corresponding
> xsl:param in the transform to be of type document-node(). Then invoke
> the transform from XQuery .
>
> Now I thought this would work because the signature of eXist's
> transform:transform allows for the parameter passed to be a node.
> Signature below
>
> transform:transform($node-tree as node()*, $stylesheet as item(), $parameters as
> node()?) as node()?
>
> Experience has led me to believe that this is a tantalisingly illusory
> mechanism. The only reason it's a node is because eXists demands it to
> be encased in a parameter element because eXist will only ever send a
> string. However xsl:param takes parameters of any type so unless there
> is some restriction on the types allowed for external parameter then
> this would appear to be wro....wr...wr.....not as expected.

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Cunning Plan Failed - Error passing document-node as parameter

Michael Kay
My reading of the eXist documentation agrees with yours: the transform API only allows strings to be passed as stylesheet parameters (the same restriction exists in some other transformation APIs, for example in Ant).

I'm afraid I don't know anything about how eXist implements the transform function, for example whether multiple transformations take place using the same Saxon Configuration. I also don't know what mechanisms it provides for defining your own extensions. I therefore can't suggest any alternative ways of meeting your objective; you'll have to rely on the eXist community for help with this.

Michael Kay
Saxonica


On 1 Apr 2014, at 20:58, Ihe Onwuka <[hidden email]> wrote:

> On Tue, Apr 1, 2014 at 8:49 PM, Ihe Onwuka <[hidden email]> wrote:
>> I am trying to run a transform within eXist that is xsl:keyed on a 4MB
>> document. Because this transform is to run against 100's of files I
>> had the following cunning (I thought) plan.
>>
>> Variables the keyed document as pass it to the transform as the third
>
> Variablelize the keyed document and pass it to the transform as the third
>
>> parameter of the eXist transform function, declare the corresponding
>> xsl:param in the transform to be of type document-node(). Then invoke
>> the transform from XQuery .
>>
>> Now I thought this would work because the signature of eXist's
>> transform:transform allows for the parameter passed to be a node.
>> Signature below
>>
>> transform:transform($node-tree as node()*, $stylesheet as item(), $parameters as
>> node()?) as node()?
>>
>> Experience has led me to believe that this is a tantalisingly illusory
>> mechanism. The only reason it's a node is because eXists demands it to
>> be encased in a parameter element because eXist will only ever send a
>> string. However xsl:param takes parameters of any type so unless there
>> is some restriction on the types allowed for external parameter then
>> this would appear to be wro....wr...wr.....not as expected.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help