facing problem with xslt transformation in xpl

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

facing problem with xslt transformation in xpl

sushik billa
Hi,

i am a newbie to orbeon, i was trying to get an instance of xform and convert to some xml and according to output xml, i was trying to get to a different page-id

my xform
--------------------------------------------------------------------
<xhtml:head>
        <xhtml:title>Number of occurencesr</xhtml:title>
        <xforms:model>
            <xforms:instance>
                <occurences>               
                    <occurence/>
                    <action/>
                </occurences>
            </xforms:instance>
         
            <xforms:submission id="main-submission" method="post" replace="all"  action="/myfirstxpl/"/> 
        </xforms:model>
    </xhtml:head>
    <xhtml:body>
        <xhtml:p>
            <xforms:group>
                <xforms:input ref="occurence">
                    <xforms:alert>Number of occurences</xforms:alert>
                </xforms:input>
                <xforms:trigger>
                    <xforms:label>Number of occurences</xforms:label>
                </xforms:trigger>
                <xforms:action ev:event="DOMActivate">
                    <xforms:setvalue ref="action">submit</xforms:setvalue>
                    <xforms:send submission="main-submission"/>
                </xforms:action>
            </xforms:group>
        </xhtml:p>
    </xhtml:body>

----------------------------------------------------------------------------

my pageflow
---------------------------------------------------------------------------

config xmlns="http://www.orbeon.com/oxf/controller">

    <page path-info="/myfirstxpl/"   view="view.xhtml">
       <action when="/occurences/action != ''"  action="myfirstxpl.xpl">
         <result  when ="number!=''" page="myviewChange"/>
         <result  when ="number=''" page="not-here"/>
       </action>
     </page>
     
      <page id="myviewChange" path-info="/myfirstxpl/myviewChange" view="viewChange.xhtml">       
      </page>
     
      <page id="not-here" path-info="/myfirstxpl/not-here" view="nothere.xhtml">       
      </page>

    <epilogue url="oxf:/config/epilogue.xpl"/>

</config>

---------------------------------------------------------------------

myfirstxpl.xpl
---------------------------------------------------------------------
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:oxf="http://www.orbeon.com/oxf/processors"
          xmlns:xs="http://www.w3.org/2001/XMLSchema">
         
   <p:param name="instance" type="input"/>
   <p:param name="data" type="output"/>
   
    <p:processor name="oxf:xslt">           
            <p:input name="data" href="#instance"/>
            <p:input name="config">
            <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <number><xsl:value-of select="/occurences/occurence"/></number>
            </config>
            </p:input>
            <p:output name="data" ref="data"/>
   </p:processor>
           
</p:config>
----------------------------------------------------------------------------------------



i am unable to figure out why it is not working and control always goes to view.xhtml.

please do help me in finding out what is wrong with the above and since being a newbie i am also not able to figure out how to debug input instance and output of xpl

Thanks in advance for pain taken to help me solve this issue



Reply | Threaded
Open this post in threaded view
|

Re: facing problem with xslt transformation in xpl

Sathish K Mittapelli
Hi Sushik,

     <page path-info="/myfirstxpl/"   view="view.xhtml">
         <action when="/occurences/action != ''"  action="myfirstxpl.xpl">
         <result  when ="number!=''" page="myviewChange"/>
         <result  when ="number=''" page="not-here"/>
       </action>
     </page>

Run your code after deleting when condition from action...i hope that may be the problem.

THANKS & REGARDS
SATHISH K MITTAPELLI  


--- On Thu, 19/6/08, sushik billa <[hidden email]> wrote:
From: sushik billa <[hidden email]>
Subject: [ops-users] facing problem with xslt transformation in xpl
To: [hidden email]
Date: Thursday, 19 June, 2008, 3:57 AM

Hi,

i am a newbie to orbeon, i was trying to get an instance of xform and
convert to some xml and according to output xml, i was trying to get to a
different page-id

my xform
--------------------------------------------------------------------
<xhtml:head>
<xhtml:title>Number of occurencesr</xhtml:title>
<xforms:model>
<xforms:instance>
<occurences>
<occurence/>
<action/>
</occurences>
</xforms:instance>
<!-- <xforms:bind nodeset="pin"
constraint="number(.) = 42"/>
-->
<xforms:submission id="main-submission"
method="post"
replace="all" action="/myfirstxpl/"/>
</xforms:model>
</xhtml:head>
<xhtml:body>
<xhtml:p>
<xforms:group>
<xforms:input ref="occurence">
<xforms:alert>Number of
occurences</xforms:alert>
</xforms:input>
<xforms:trigger>
<xforms:label>Number of
occurences</xforms:label>
</xforms:trigger>
<xforms:action ev:event="DOMActivate">
<xforms:setvalue
ref="action">submit</xforms:setvalue>
<xforms:send submission="main-submission"/>
</xforms:action>
</xforms:group>
</xhtml:p>
</xhtml:body>

----------------------------------------------------------------------------

my pageflow
---------------------------------------------------------------------------

config xmlns="http://www.orbeon.com/oxf/controller">

<page path-info="/myfirstxpl/"
view="view.xhtml">
<action when="/occurences/action != ''"
action="myfirstxpl.xpl">
<result when ="number!=''"
page="myviewChange"/>
<result when ="number=''"
page="not-here"/>
</action>
</page>

<page id="myviewChange"
path-info="/myfirstxpl/myviewChange"
view="viewChange.xhtml">
</page>

<page id="not-here"
path-info="/myfirstxpl/not-here"
view="nothere.xhtml">
</page>

<epilogue url="oxf:/config/epilogue.xpl"/>

</config>

---------------------------------------------------------------------

myfirstxpl.xpl
---------------------------------------------------------------------
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

<p:param name="instance" type="input"/>
<p:param name="data" type="output"/>
<!-- First XSLT transformation -->
<p:processor name="oxf:xslt">
<p:input name="data" href="#instance"/>
<p:input name="config">
<config xsl:version="2..0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<number><xsl:value-of
select="/occurences/occurence"/></number>
</config>
</p:input>
<p:output name="data" ref="data"/>
</p:processor>

</p:config>
----------------------------------------------------------------------------------------



i am unable to figure out why it is not working and control always goes to
view.xhtml.

please do help me in finding out what is wrong with the above and since
being a newbie i am also not able to figure out how to debug input instance
and output of xpl

Thanks in advance for pain taken to help me solve this issue




--
View this message in context:
http://www.nabble.com/facing-problem-with-xslt-transformation-in-xpl-tp17993412p17993412.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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


Unlimited freedom, unlimited storage. Get it now

--
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: facing problem with xslt transformation in xpl

sushik billa
In reply to this post by sushik billa
Hi,

Thanks for the reply..

i removed when condition from action tag..but still it didn't work out..

earlier i was running into version problems with exist, so  i changed "oxf.xforms.state-handling" to client in properties.xml. I don't know whether this would contribute to the problem that i am facing..

please do let me know if there are any other solutions to get around this problem.




sushik billa wrote
Hi,

i am a newbie to orbeon, i was trying to get an instance of xform and convert to some xml and according to output xml, i was trying to get to a different page-id

my xform
--------------------------------------------------------------------
<xhtml:head>
        <xhtml:title>Number of occurencesr</xhtml:title>
        <xforms:model>
            <xforms:instance>
                <occurences>               
                    <occurence/>
                    <action/>
                </occurences>
            </xforms:instance>
         
            <xforms:submission id="main-submission" method="post" replace="all"  action="/myfirstxpl/"/> 
        </xforms:model>
    </xhtml:head>
    <xhtml:body>
        <xhtml:p>
            <xforms:group>
                <xforms:input ref="occurence">
                    <xforms:alert>Number of occurences</xforms:alert>
                </xforms:input>
                <xforms:trigger>
                    <xforms:label>Number of occurences</xforms:label>
                </xforms:trigger>
                <xforms:action ev:event="DOMActivate">
                    <xforms:setvalue ref="action">submit</xforms:setvalue>
                    <xforms:send submission="main-submission"/>
                </xforms:action>
            </xforms:group>
        </xhtml:p>
    </xhtml:body>

----------------------------------------------------------------------------

my pageflow
---------------------------------------------------------------------------

config xmlns="http://www.orbeon.com/oxf/controller">

    <page path-info="/myfirstxpl/"   view="view.xhtml">
       <action when="/occurences/action != ''"  action="myfirstxpl.xpl">
         <result  when ="number!=''" page="myviewChange"/>
         <result  when ="number=''" page="not-here"/>
       </action>
     </page>
     
      <page id="myviewChange" path-info="/myfirstxpl/myviewChange" view="viewChange.xhtml">       
      </page>
     
      <page id="not-here" path-info="/myfirstxpl/not-here" view="nothere.xhtml">       
      </page>

    <epilogue url="oxf:/config/epilogue.xpl"/>

</config>

---------------------------------------------------------------------

myfirstxpl.xpl
---------------------------------------------------------------------
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:oxf="http://www.orbeon.com/oxf/processors"
          xmlns:xs="http://www.w3.org/2001/XMLSchema">
         
   <p:param name="instance" type="input"/>
   <p:param name="data" type="output"/>
   
    <p:processor name="oxf:xslt">           
            <p:input name="data" href="#instance"/>
            <p:input name="config">
            <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <number><xsl:value-of select="/occurences/occurence"/></number>
            </config>
            </p:input>
            <p:output name="data" ref="data"/>
   </p:processor>
           
</p:config>
----------------------------------------------------------------------------------------



i am unable to figure out why it is not working and control always goes to view.xhtml.

please do help me in finding out what is wrong with the above and since being a newbie i am also not able to figure out how to debug input instance and output of xpl

Thanks in advance for pain taken to help me solve this issue


Reply | Threaded
Open this post in threaded view
|

Re: facing problem with xslt transformation in xpl

fl.schmitt(ops-users)
In reply to this post by sushik billa
hi sushik,

> please do help me in finding out what is wrong with the above and since
> being a newbie i am also not able to figure out how to debug input instance
> and output of xpl

i think the best is to start with debugging the in- and output. To see
what's going on, just add a debug attribute to the in- or output
elements that you want to monitor. For example, in myfirstxpl.xpl:

<p:param name="instance" type="input" debug="MYFIRSTXPL_IN" />
<p:param name="data" type="output" debug="MYFIRSTXPL_OUT" />

If there's more than one processor in the XPL, you could add the debug
attributes to the processor in- and outputs, too. With the debug
attributes set, the data content of the specific in- or output will be
written to the logs:

http://www.orbeon.com/ops/doc/processors-other#debug-processor


HTH
florian




--
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: facing problem with xslt transformation in xpl

Steve Bayliss
In reply to this post by sushik billa
Looking at your view xform, you have:-

>                 <xforms:trigger>
>                     <xforms:label>Number of occurences</xforms:label>
>                 </xforms:trigger>
>                 <xforms:action ev:event="DOMActivate">
>                     <xforms:setvalue ref="action">submit</xforms:setvalue>
>                     <xforms:send submission="main-submission"/>
>                 </xforms:action>

I think your xforms:action should be *within* the xforms:trigger - so that
the action is performed when the button is clicked, ie

>                 <xforms:trigger>
>                     <xforms:label>Number of occurences</xforms:label>
>                     <xforms:action ev:event="DOMActivate">
>                         <xforms:setvalue
ref="action">submit</xforms:setvalue>
>                         <xforms:send submission="main-submission"/>
>                     </xforms:action>
>                 </xforms:trigger>


I suspect your xforms submission is not including a value for the action
element because of this - and this means that the page flow won't be calling
your action pipeline (the test on your action element will be failing)



-----Original Message-----
From: sushik billa [mailto:[hidden email]]
Sent: 19 June 2008 15:03
To: [hidden email]
Subject: [ops-users] Re: facing problem with xslt transformation in xpl



Hi,

Thanks for the reply..

i removed when condition from action tag..but still it didn't work out..

earlier i was running into version problems with exist, so  i changed
"oxf.xforms.state-handling" to client in properties.xml. I don't know
whether this would contribute to the problem that i am facing..

please do let me know if there are any other solutions to get around this
problem.





sushik billa wrote:

>
> Hi,
>
> i am a newbie to orbeon, i was trying to get an instance of xform and
> convert to some xml and according to output xml, i was trying to get
> to a different page-id
>
> my xform
> --------------------------------------------------------------------
> <xhtml:head>
>         <xhtml:title>Number of occurencesr</xhtml:title>
>         <xforms:model>
>             <xforms:instance>
>                 <occurences>                
>                     <occurence/>
>                     <action/>
>                 </occurences>
>             </xforms:instance>
>           <!--   <xforms:bind nodeset="pin" constraint="number(.) = 42"/>
> -->
>             <xforms:submission id="main-submission" method="post"
> replace="all"  action="/myfirstxpl/"/>
>         </xforms:model>
>     </xhtml:head>
>     <xhtml:body>
>         <xhtml:p>
>             <xforms:group>
>                 <xforms:input ref="occurence">
>                     <xforms:alert>Number of occurences</xforms:alert>
>                 </xforms:input>
>                 <xforms:trigger>
>                     <xforms:label>Number of occurences</xforms:label>
>                 </xforms:trigger>
>                 <xforms:action ev:event="DOMActivate">
>                     <xforms:setvalue ref="action">submit</xforms:setvalue>
>                     <xforms:send submission="main-submission"/>
>                 </xforms:action>
>             </xforms:group>
>         </xhtml:p>
>     </xhtml:body>
>
> ----------------------------------------------------------------------
> ------
>
> my pageflow
> ----------------------------------------------------------------------
> -----
>
> config xmlns="http://www.orbeon.com/oxf/controller">
>
>     <page path-info="/myfirstxpl/"   view="view.xhtml">
>        <action when="/occurences/action != ''"  action="myfirstxpl.xpl">
>          <result  when ="number!=''" page="myviewChange"/>
>          <result  when ="number=''" page="not-here"/>
>        </action>
>      </page>
>      
>       <page id="myviewChange" path-info="/myfirstxpl/myviewChange"
> view="viewChange.xhtml">      
>       </page>
>      
>       <page id="not-here" path-info="/myfirstxpl/not-here"
> view="nothere.xhtml">      
>       </page>
>
>     <epilogue url="oxf:/config/epilogue.xpl"/>
>
> </config>
>
> ---------------------------------------------------------------------
>
> myfirstxpl.xpl
> ---------------------------------------------------------------------
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>           xmlns:oxf="http://www.orbeon.com/oxf/processors"
>           xmlns:xs="http://www.w3.org/2001/XMLSchema">
>          
>    <p:param name="instance" type="input"/>
>    <p:param name="data" type="output"/>
>     <!-- First XSLT transformation -->
>     <p:processor name="oxf:xslt">  
>   <p:input name="data" href="#instance"/>
>   <p:input name="config">
>             <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>     <number><xsl:value-of
select="/occurences/occurence"/></number>

>             </config>
>   </p:input>
>   <p:output name="data" ref="data"/>
>    </p:processor>
>            
> </p:config>
> ----------------------------------------------------------------------
> ------------------
>
>
>
> i am unable to figure out why it is not working and control always
> goes to view.xhtml.
>
> please do help me in finding out what is wrong with the above and
> since being a newbie i am also not able to figure out how to debug
> input instance and output of xpl
>
> Thanks in advance for pain taken to help me solve this issue
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/facing-problem-with-xslt-transformation-in-xpl-tp17993
412p18009716.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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: facing problem with xslt transformation in xpl

sushik billa
In reply to this post by fl.schmitt(ops-users)
Thanks for all the support..

'dubug' to output was the key in figuring out solution to the problem, the 'when'  conditions in result tag against the output was not right..i had to change those to get it working..

fs(ops-users) wrote
hi sushik,

> please do help me in finding out what is wrong with the above and since
> being a newbie i am also not able to figure out how to debug input instance
> and output of xpl

i think the best is to start with debugging the in- and output. To see
what's going on, just add a debug attribute to the in- or output
elements that you want to monitor. For example, in myfirstxpl.xpl:

<p:param name="instance" type="input" debug="MYFIRSTXPL_IN" />
<p:param name="data" type="output" debug="MYFIRSTXPL_OUT" />

If there's more than one processor in the XPL, you could add the debug
attributes to the processor in- and outputs, too. With the debug
attributes set, the data content of the specific in- or output will be
written to the logs:

http://www.orbeon.com/ops/doc/processors-other#debug-processor


HTH
florian




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