No error message provided

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

No error message provided

srikanth.prodigy

I have used Following code to print description

<xforms:variable name="des" select="instance('events-instance')/Event[(Tag/TagId=$tagval)]/Description"/>

         <xforms:variable name="partofdes" select="substring($des, 1, 200)"/>

         <xforms:variable name="deslength" select="string-length(Description)"/>

         <xforms:output value="if($deslength >= 100) then concat($partofdes,'    ...........') else instance('events-instance')/Event[(Tag/TagId=$tagval)]/Description">

         </xforms:output>

I got the following error displayed

A sequence of more than one item is not allowed as the first argument of substring() ("Unforgettable Tour in LosAngle...", "Unforgettable Tour in LosAngle...", ...)

 

When I tried to put the code in repeat  it displayed No Error message displayed

<xforms:repeat  nodeset=” instance('events-instance')/Event[(Tag/TagId=$tagval)]”>

 

<xforms:variable name="des" select="Description"/>

         <xforms:variable name="partofdes" select="substring($des, 1, 200)"/>

         <xforms:variable name="deslength" select="string-length(Description)"/>

         <xforms:output value="if($deslength >= 100) then concat($partofdes,'    ...........') else instance('events-instance')/Event[(Tag/TagId=$tagval)]/Description">

         </xforms:output>

</xforms:repeat>

 

Thanks,

Srikanth A

 

 

 

 

 



--
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: No error message provided

fl.schmitt(ops-users)
Srikanth,

> <xforms:variable name="des"
> select="instance('events-instance')/Event[(Tag/TagId=$tagval)]/Description"/>
>
>          <xforms:variable name="partofdes" select="substring($des, 1,
> 200)"/>

> I got the following error displayed
>
> A sequence of more than one item is not allowed as the first argument of
> substring() ("Unforgettable Tour in LosAngle...", "Unforgettable Tour in
> LosAngle...", ...)

should the variable $des contain a nodeset or a single node value? If it
should contain only one single value, you will have to check your xpath
to restrict the result to one node. As a quick an dirty fix, you could
let $partofdes select only the first node of $des: $des[1] (not tested).

> When I tried to put the code in repeat  it displayed No Error message
> displayed

> <xforms:repeat  nodeset=”
> instance('events-instance')/Event[(Tag/TagId=$tagval)]”>

> <xforms:variable name="des" select="Description"/>

again not tested, but i think this wouldn't work. You're defining the
variables more than once, and i think this isn't "legal".

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