You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephan Coboos <cr...@gmx.net> on 2004/03/17 22:29:16 UTC
JXForms and XPath, what's wrong?
Hello,
in my Flowscript I set a bean under the name "picture". Within a
JXTemplate I want to read the filename of the picture. This version
works fine:
${picture.fileName}
But this doesn't work:
#{picture/fileName} or #{$picture/fileName}
Why?
If I use the XPath version I got the following error: "No pointer for
xpath: "...
Where I'am wrong? Can you help me, please?
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXForms and XPath, what's wrong?
Posted by Ugo Cei <u....@cbim.it>.
Stephan Coboos wrote:
> in my Flowscript I set a bean under the name "picture". Within a
> JXTemplate I want to read the filename of the picture. This version
> works fine:
>
> ${picture.fileName}
>
> But this doesn't work:
>
> #{picture/fileName} or #{$picture/fileName}
Do you have a public getter defined for "fileName"?
Ugo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXForms and XPath, what's wrong?
Posted by Jan Hoskens <jh...@schaubroeck.be>.
It may help if you gave a bit more info about your setup, ie how do you
pass your variable from flow, how does your jx-page look like,
are there any other paths used? I've used a templategenerator as follows,
which does work:
flow: bean "listContainer" contains collection with other beans, collection
name is "beanList", the beans in the collection have a beanName variable.
-> listContainer (also a bean)
var: Collection beanList
->bean
var: String beanName
<snip>
cocoon.sendPage("internal/jx-pipeline", {"listContainer" :
listContainer});
</snip>
jx-pipeline contains jx generator with a html page:
<snip>
<jx:forEach items="#{listContainer/beanList}">
#{beanName}
</jx:forEach>
</snip>
If you'r just using the bean with beanName, you should get it with only
#{bean/beanName}, passing {"bean":bean} in your flow. So your first try with
xpath should be ok, if nothing else is going wrong. The $ within an xpath
is indeed a variable, but your bean isn't stored in a variable. The biz data
is passed as one xpath-tree (as far as I know) on which you can use your
xpath as you do when using an XSLT.
Kind Regards,
Jan
> Whoops, sorry I didn't read your post carefully. You already tried that.
> Are you sure the ${} version actually works? If no such property is
> found it simply returns an empty result without failing. What output do
> you see for:
>
> ${picture}
> ${picture/fileName}
> #{picture}
> #{$picture}
>
> Chris
>
>
> Christopher Oliver wrote:
>
> > Try
> >
> > #{$picture/fileName}
> >
> > XPath variables start with a $.
> >
> > Chris
> >
> > Stephan Coboos wrote:
> >
> >> Hello,
> >>
> >> in my Flowscript I set a bean under the name "picture". Within a
> >> JXTemplate I want to read the filename of the picture. This version
> >> works fine:
> >>
> >> ${picture.fileName}
> >>
> >> But this doesn't work:
> >>
> >> #{picture/fileName} or #{$picture/fileName}
> >>
> >> Why?
> >>
> >> If I use the XPath version I got the following error: "No pointer for
> >> xpath: "...
> >>
> >> Where I'am wrong? Can you help me, please?
> >>
> >> Regards
> >> Stephan
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXForms and XPath, what's wrong?
Posted by Christopher Oliver <re...@verizon.net>.
Whoops, sorry I didn't read your post carefully. You already tried that.
Are you sure the ${} version actually works? If no such property is
found it simply returns an empty result without failing. What output do
you see for:
${picture}
${picture/fileName}
#{picture}
#{$picture}
Chris
Christopher Oliver wrote:
> Try
>
> #{$picture/fileName}
>
> XPath variables start with a $.
>
> Chris
>
> Stephan Coboos wrote:
>
>> Hello,
>>
>> in my Flowscript I set a bean under the name "picture". Within a
>> JXTemplate I want to read the filename of the picture. This version
>> works fine:
>>
>> ${picture.fileName}
>>
>> But this doesn't work:
>>
>> #{picture/fileName} or #{$picture/fileName}
>>
>> Why?
>>
>> If I use the XPath version I got the following error: "No pointer for
>> xpath: "...
>>
>> Where I'am wrong? Can you help me, please?
>>
>> Regards
>> Stephan
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXForms and XPath, what's wrong?
Posted by Christopher Oliver <re...@verizon.net>.
Try
#{$picture/fileName}
XPath variables start with a $.
Chris
Stephan Coboos wrote:
> Hello,
>
> in my Flowscript I set a bean under the name "picture". Within a
> JXTemplate I want to read the filename of the picture. This version
> works fine:
>
> ${picture.fileName}
>
> But this doesn't work:
>
> #{picture/fileName} or #{$picture/fileName}
>
> Why?
>
> If I use the XPath version I got the following error: "No pointer for
> xpath: "...
>
> Where I'am wrong? Can you help me, please?
>
> Regards
> Stephan
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org