You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Michael L. Conneen" <mc...@infointegrators.com> on 2003/12/22 17:13:21 UTC

jelly-tag util:loadText

Folks,

I'm using a snap-shot of the commons-jelly library from week of 12/15..

I have the following jelly script
...
  <util:file name="${sqlScript}" var="fp"/>
   <util:loadText file="${fp}" var="sqlText"/>

   <sql:setDataSource
     url="${databaseURL}"
     driver="${databaseDriver}"
     user="${databaseUser}"
     password="${databasePassword}"
     />
   <sql:query var="results">
<![CDATA[
${sqlText}
]]>
   </sql:query>
..

Within the sql file is..
select * from table where foo > "bar"

what is happening is that when the file is loaded.. ">" is translated 
to &lt;

This even occurs if I change the jelly script to..
   <sql:query var="results">
<![CDATA[
select * from table where foo > "bar"
]]>
   </sql:query>

And.. if I change my input file text to be..
<![CDATA[
select * from table where foo > "bar"
]]>

Then the sqlText is
&lt;![CDATA[
select *
from SCARAB_ATTRIBUTE
where created_date &lt; CURRENT_DATE
]]&gt;

I poked around the LoadTextTag.java file.. and it appears the file IS 
being read and put into the context..  Just when it comes out of the 
context.. it is being treated as HTML and translated..

Ideas?


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: jelly-tag util:loadText

Posted by Paul Libbrecht <pa...@activemath.org>.
Michael,

This looks like a bug into the sql:query tag. Have you looked around it?
(what I understand from that is that it's taking an XML-output whereas 
it should accept only the  concatenation of a bunch of text-nodes 
(CDATA and entity refs included).

Paul


On 22-Dec-03, at 17:13 Uhr, Michael L. Conneen wrote:

> Folks,
>
> I'm using a snap-shot of the commons-jelly library from week of 12/15..
>
> I have the following jelly script
> ...
>  <util:file name="${sqlScript}" var="fp"/>
>   <util:loadText file="${fp}" var="sqlText"/>
>
>   <sql:setDataSource
>     url="${databaseURL}"
>     driver="${databaseDriver}"
>     user="${databaseUser}"
>     password="${databasePassword}"
>     />
>   <sql:query var="results">
> <![CDATA[
> ${sqlText}
> ]]>
>   </sql:query>
> ..
>
> Within the sql file is..
> select * from table where foo > "bar"
>
> what is happening is that when the file is loaded.. ">" is translated 
> to &lt;
>
> This even occurs if I change the jelly script to..
>   <sql:query var="results">
> <![CDATA[
> select * from table where foo > "bar"
> ]]>
>   </sql:query>
>
> And.. if I change my input file text to be..
> <![CDATA[
> select * from table where foo > "bar"
> ]]>
>
> Then the sqlText is
> &lt;![CDATA[
> select *
> from SCARAB_ATTRIBUTE
> where created_date &lt; CURRENT_DATE
> ]]&gt;
>
> I poked around the LoadTextTag.java file.. and it appears the file IS 
> being read and put into the context..  Just when it comes out of the 
> context.. it is being treated as HTML and translated..
>
> Ideas?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org