assign - literal error

nzblue_fish
nzblue_fish's picture
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 09/30/2009
Points: 1165

Hi everyone,

Can someone please confirm  if this is supposed to be an error or is this a bug in the assign statement.

  <assign literal="" outputvariable="someStringVariable" />

generates the following error:

com.jackbe.jbp.jems.moe.commons.MolValidationException: Error in assign statement ( line # 292 ) : 
Missing or illegal  fromVariable / fromExpr / fromLiteral 

I expected to be able to do this,  create an empty string variable,  but perhaps there is a reason why not.

Cheers, Innes

0
Your rating: None
raj
raj's picture
User offline. Last seen 1 week 4 days ago. Offline
Joined: 09/22/2008
Points: 4

Yes Innes, that indeed is a bug.

For now, a not-so-elegant workaround could be...

<assign fromexpr="normalize-space()" outputvariable="someStringVariable" />

raj.  chief masher @ jackbe

nzblue_fish
nzblue_fish's picture
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 09/30/2009
Points: 1165

Thanks Raj,

I used fromexpr="()" initially, which did work, but since that represents an empty sequence I think I'll use normalize-space(()) as you've suggested since it guarantees the return an empty string.

Cheers, Innes