Re: xprocxq extension step for easy integration with xsltforms
claud108 <claud108 <at> yahoo.com>
2010-01-02 17:33:12 GMT
GENERALIZATION of XSLTForms extension step
I generalized this extension step so that one can enter a xsl stylesheet
that will be applied in browser.
A. Modifications of ext.xqm:
1. Delete 'declare option exist:serialize "method=xhtml media-type=text/html
process-xsl-pi=no";'.
2. Replace declare variable $ext:xsltforms :=
util:function(xs:QName("ext:xsltforms"), 3);
with declare variable $ext:clientXSLT :=
util:function(xs:QName("ext:clientXSLT"), 3);
3. Replace definition of xsltforms function with this one
(:
--------------------------------------------------------------------------
:)
declare function ext:clientXSLT($primary,$secondary,$options){
(:
--------------------------------------------------------------------------
:)
let $xslURI := xs:string(data($options/p:with-option[ <at> name =
'xslURI']/ <at> select))
return
(
processing-instruction {'xml-stylesheet'} {concat('href="', $xslURI, '"
type="text/xsl"')},
document{u:get-primary($primary)}
)
};
B. Modification of pipeline-extension.xml:
1. Replace definition of xsltforms extension step with the following
definition:\
<p:declare-step type="ext:clientXSLT" xproc:support="true">
<p:input port="source" sequence="true" primary="true" select="/"/>
<p:output port="result" primary="true" select="/"/>
<p:option name="xslURI" required="true"/>
</p:declare-step>
C. Example of usage:
<ext:clientXSLT>
<p:input port="source">
<p:pipe step="preluarePaginaConectareStandard" port="result"/>
</p:input>
<p:with-option name="xslURI"
select="/exist/rest//db/xsltforms/xsltforms.xsl"/>
</ext:clientXSLT>
This is all.
Jim, thank you very much for your support and patience. By looking into
xprocxq.jar file, I understood that implementing xproc in xquery is a
brililant idea, indeed.
Claudius Teodorescu
--
--
View this message in context: http://old.nabble.com/xprocxq-extension-step-for-easy-integration-with-xsltforms-tp26973039p26994880.html
Sent from the exist-open mailing list archive at Nabble.com.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev