instance data to xslt processor

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

instance data to xslt processor

brian_steuhl-2

How do you get instance data from an xform to and xslt processor?

My .xpl file is this:

<p:config xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:p="http://www.orbeon.com/oxf/pipeline"

xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<p:param name="instance" type="input"/>

<p:processor name="oxf:xslt">
        <p:input name="data" href="#instance"/>
        <p:input name="config" href="view-complaint.xsl"/>
        <p:output name="data" id="fo"/>
</p:processor>

<p:processor name="oxf:xslfo-converter">
        <p:input name="config">
                <config/>
        </p:input>
        <p:input name="data" href="#fo"/>
        <p:output name="data" id="converted"/>
</p:processor>
<p:processor name="oxf:http-serializer">
                <p:input name="config">
                    <config>
                        <header>
                            <name>Cache-Control</name>
                            <value>post-check=0, pre-check=0</value>
                        </header>
                        <header>
                            <name>Content-Disposition</name>
                            <value>attachment; filename=document.pdf</value>
                        </header>
                        <!-- NOTE: XSL-FO converter specifies application/pdf
content-type -->
                    </config>
                </p:input>
                <p:input name="data" href="#converted"/>
            </p:processor>
</p:config>

My xforms:submission is:

       
        <xforms:submission id="view-pdf-submission"
ref="xxforms:instance('taskoutput')" method="post"

action="/eXistTest/my-view-complaint" xxforms:show-progress="false">
<xforms:message ev:event="xforms-submit-error" level="modal">Operation
failed.</xforms:message>
</xforms:submission>

and my page-flow.xml is:


<config xmlns="http://www.orbeon.com/oxf/controller"
xmlns:xu="http://www.xmldb.org/xupdate">
        <page path-info="/eXistTest/" view="view-complaint.xsl"/>
       
        <page id="view-complaint" path-info="/eXistTest/my-view-complaint"
model="view-complaint-pdf.xpl" view="view-complaint.xsl"/>
                <epilogue url="oxf:/config/epilogue.xpl"/>

</config>

When I set the <input> attribute href="somedocument.xml" I get the generated
pdf file.

I should actually be able to eliminate the model attrib ute from <page
id="view-complaint...> because if the xsl generates an xsl-fo document with
fo:root, converter will be called automatically.  But if this is what I am
suppose to do, how do I get instance data from xform into my xslt?

When I try and set the href="#instance" and declare a <p:param name="instance"
type="input"/> in my .xpl file, I get the rendered pdf but only the styling, no
instance data? Thanks.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: instance data to xslt processor

Alessandro Vernet
Administrator
Brian,

[hidden email] wrote:
> How do you get instance data from an xform to and xslt processor?
>
> My .xpl file is this:
> [...]

This XPL file is calling the http-serializer, so in your page-flow.xml,
you should have a model="..." pointing to this XPL, and no view. Have
you tried that?

Otherwise you can have a view="..." pointing to the XPL, and have the
XPL output the XSL-FO to the "data" output. In this case the XSL-FO will
got the epilogue which will detect that and run the XSL-FO converter for
you.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: instance data to xslt processor

Brian_Steuhl

It was the view in page-flow.xml that I had to remove - thank you.  I also added instance-passing="forward" as an attribute in the config element.  I appreciate the assistance in getting this working.  Thank you.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws