You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jan_bar <he...@yahoo.com> on 2005/10/12 17:04:27 UTC

Does maven work with characters like <> and &?

Hi,

my variable needs to contain the characters like '>', '<' and '&'. But maven
always converts them to entities (&lt;, &gt;, &amp;). How can I disable this
conversion?
(maven 1.1 beta2)

Jan




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does maven work with characters like <> and &?

Posted by jan_bar <he...@yahoo.com>.
Thanks Stephen, but it doesn't help, I want to see the characters, not their
entity character counterparts.

Jan

"Stephen Duncan" <st...@gmail.com> wrote in message
news:b20ce4ed0510121302q220d99d9vc48f2e72dc6086fc@mail.gmail.com...
I don't think any of this is Maven specific; seems like general XML
problems.

For what you want the correct format is most likely:

<j:set var="test" value="&lt;&gt;"/>

-Stephen


On 10/12/05, jan_bar <he...@yahoo.com> wrote:
> Some samples:
>
> <!-- error, value cannot contain '<' -->
> <j:set var="test" value="<>"/>
>
> however:
>
> <j:set var="test"><![CDATA[<>]]></j:set>
> <!-- outputs funny "test: &lt;&gt;>" -->
> <ant:echo>test: ${test}</ant:echo>
>
> <j:set var="test" value=">"/>
> <!-- outputs "test: >" -->
> <ant:echo>test: ${test}</ant:echo>
>
> When I set the variable in plugin.properties:
> test=<>
> <!-- outputs: "<>" -->
> <ant:echo>test: ${test}</ant:echo>
>
> However when I feed the test variable that was read from plugin.properties
> and not modified to Ant filter, it works as exptected:
> <!-- @mytoken@ will be replaced with "<>"
> <ant:filter token="mytoken" value="${test}" />
>
> The behaviour is inconsistent and I see no reason why <, > and & is
> converted to character entity.
>
> Jan
>
>
> > Can you be a bit more specific? What are you trying to do? Where do you
> > have variables with entities and which part of Maven converts them?
> >
> > -Lukas
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Stephen Duncan Jr
www.stephenduncanjr.com




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does maven work with characters like <> and &?

Posted by Stephen Duncan <st...@gmail.com>.
I don't think any of this is Maven specific; seems like general XML problems.

For what you want the correct format is most likely:

<j:set var="test" value="&lt;&gt;"/>

-Stephen


On 10/12/05, jan_bar <he...@yahoo.com> wrote:
> Some samples:
>
> <!-- error, value cannot contain '<' -->
> <j:set var="test" value="<>"/>
>
> however:
>
> <j:set var="test"><![CDATA[<>]]></j:set>
> <!-- outputs funny "test: &lt;&gt;>" -->
> <ant:echo>test: ${test}</ant:echo>
>
> <j:set var="test" value=">"/>
> <!-- outputs "test: >" -->
> <ant:echo>test: ${test}</ant:echo>
>
> When I set the variable in plugin.properties:
> test=<>
> <!-- outputs: "<>" -->
> <ant:echo>test: ${test}</ant:echo>
>
> However when I feed the test variable that was read from plugin.properties
> and not modified to Ant filter, it works as exptected:
> <!-- @mytoken@ will be replaced with "<>"
> <ant:filter token="mytoken" value="${test}" />
>
> The behaviour is inconsistent and I see no reason why <, > and & is
> converted to character entity.
>
> Jan
>
>
> > Can you be a bit more specific? What are you trying to do? Where do you
> > have variables with entities and which part of Maven converts them?
> >
> > -Lukas
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Stephen Duncan Jr
www.stephenduncanjr.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does maven work with characters like <> and &?

Posted by jan_bar <he...@yahoo.com>.
There is a lot of small troubles:

<ant:echo> seems to convert the < to the character entity, I cannot output
it as single character:
<ant:echo><![CDATA[<>]></ant:echo>

jelly handles the variable text differently:
<!-- jelly error ... -->
<j:set var="test" value="<>" escapeText="no"/>

... in plugin.properties:
test=<
<!-- seems to work fine -->
<j:set var="test" value="${test}${test} escapeText="no"/>

test=<
<!-- converted to character entities -->
<j:set var="test" escapeText="no"><![CDATA[${test}${test}]></j:set>

Why there is difference between <j:set /> and <j:set></j:set> form?
Why I see the jelly error when value="<>"?

Jan

"Lukas Theussl" <lt...@apache.org> wrote in message
news:434D7176.2010604@apache.org...
> It seems like the escapeText="false" attribute  for the <j:set> tag
> should be doing what you want, see
> http://jakarta.apache.org/commons/jelly/tags.html#core:set .
>
> However, from some quick test I did this doesn't seem to work...
>
> Another jelly quirk?




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does maven work with characters like <> and &?

Posted by Lukas Theussl <lt...@apache.org>.
It seems like the escapeText="false" attribute  for the <j:set> tag 
should be doing what you want, see 
http://jakarta.apache.org/commons/jelly/tags.html#core:set .

However, from some quick test I did this doesn't seem to work...

Another jelly quirk?


-Lukas


jan_bar wrote:
> Some samples:
> 
> <!-- error, value cannot contain '<' -->
> <j:set var="test" value="<>"/>
> 
> however:
> 
> <j:set var="test"><![CDATA[<>]]></j:set>
> <!-- outputs funny "test: &amp;lt;&amp;gt;&gt;" -->
> <ant:echo>test: ${test}</ant:echo>
> 
> <j:set var="test" value="&gt;"/>
> <!-- outputs "test: &gt;" -->
> <ant:echo>test: ${test}</ant:echo>
> 
> When I set the variable in plugin.properties:
> test=<>
> <!-- outputs: "&lt;&gt;" -->
> <ant:echo>test: ${test}</ant:echo>
> 
> However when I feed the test variable that was read from plugin.properties
> and not modified to Ant filter, it works as exptected:
> <!-- @mytoken@ will be replaced with "<>"
> <ant:filter token="mytoken" value="${test}" />
> 
> The behaviour is inconsistent and I see no reason why <, > and & is
> converted to character entity.
> 
> Jan
> 
> 
> 
>>Can you be a bit more specific? What are you trying to do? Where do you
>>have variables with entities and which part of Maven converts them?
>>
>>-Lukas
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does maven work with characters like <> and &?

Posted by jan_bar <he...@yahoo.com>.
Some samples:

<!-- error, value cannot contain '<' -->
<j:set var="test" value="<>"/>

however:

<j:set var="test"><![CDATA[<>]]></j:set>
<!-- outputs funny "test: &amp;lt;&amp;gt;&gt;" -->
<ant:echo>test: ${test}</ant:echo>

<j:set var="test" value="&gt;"/>
<!-- outputs "test: &gt;" -->
<ant:echo>test: ${test}</ant:echo>

When I set the variable in plugin.properties:
test=<>
<!-- outputs: "&lt;&gt;" -->
<ant:echo>test: ${test}</ant:echo>

However when I feed the test variable that was read from plugin.properties
and not modified to Ant filter, it works as exptected:
<!-- @mytoken@ will be replaced with "<>"
<ant:filter token="mytoken" value="${test}" />

The behaviour is inconsistent and I see no reason why <, > and & is
converted to character entity.

Jan


> Can you be a bit more specific? What are you trying to do? Where do you
> have variables with entities and which part of Maven converts them?
>
> -Lukas




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does maven work with characters like <> and &?

Posted by Lukas Theussl <lt...@apache.org>.
Can you be a bit more specific? What are you trying to do? Where do you 
have variables with entities and which part of Maven converts them?

-Lukas


jan_bar wrote:
> Hi,
> 
> my variable needs to contain the characters like '>', '<' and '&'. But maven
> always converts them to entities (&lt;, &gt;, &amp;). How can I disable this
> conversion?
> (maven 1.1 beta2)
> 
> Jan
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org