Re: Yet Another V2 Request: Extension Functions via XSLT 2

that sounds like an interesting approach, though a little confused.

I could see usefulness in being able to invoke steps themselves;

    my:newstep($inputs as map:map, $outputs as map:map, $options as map:map)

but that doesn't make it entirely clear how functions in xquery/xslt
libs would be loaded into the in scope environment.

so I will make a strawman;

<p:xquery>
<p:input port="library">
   <p:document href="myxquerylib.xqy"/>
   <p:document href="myotherxquerylib.xqy"/>
</p:input>
</p:xquery>

this could have the advantage of also loading in libs for the step
itself (instead of import in xquery)

and in the above form (w/ no query port binding), it could load into
in scope environment.

thoughts ?

J

On 8 August 2013 09:33, Toman, Vojtech <vojtech.toman@emc.com> wrote:
>> -----Original Message-----
>> From: James Fuller [mailto:jim@webcomposite.com]
>> Sent: Thursday, August 08, 2013 9:30 AM
>> To: Toman, Vojtech
>> Cc: XProc WG
>> Subject: Re: Yet Another V2 Request: Extension Functions via XSLT 2
>>
>> On 8 August 2013 09:24, Toman, Vojtech <vojtech.toman@emc.com> wrote:
>> > See also a similar request in an older thread on xproc-dev:
>> >
>> > http://lists.w3.org/Archives/Public/xproc-dev/2012Jan/0023.html
>> >
>> > There is, I believe, also a similar entry in the XProcVNext wiki.
>> >
>> > But what about simply allowing to use XProc steps as XPath extension
>> functions? That seems like a more robust and idiomatic solution than
>> introducing "magic" mechanisms for native importing of
>> XSLT/XQuery/whatnot modules.
>> >
>>
>> I agree that we should consider allowing folks to do this as well.
>>
>> but I still opt for overloading of p:import as it would aid adoption ...
>> a developer does not want to have to rewrite all their func libs into
>> XProc steps ... if they have an existing investment in xquery/xslt they
>> can be up and running with their libs immediately. Not to mention its
>> boring to have to maintain a single function lib across both
>> xquery/xslt and now xproc.
>
> I was not thinking about rewriting their libraries in XProc. In many cases, simply wrapping the XSLT/XQuery library/function with a simple p:xslt/p:xquery step could be enough.
>
> Regards,
> Vojtech
>
> --
> Vojtech Toman
> Consultant Software Engineer
> EMC | Information Intelligence Group
> vojtech.toman@emc.com
> http://developer.emc.com/xmltech
>
>
>

Received on Thursday, 8 August 2013 10:12:23 UTC