You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (JIRA)" <ji...@apache.org> on 2016/08/26 13:54:20 UTC

[jira] [Commented] (SLING-5945) Using opening angle brackets twice in expression language leads to token recognition error

    [ https://issues.apache.org/jira/browse/SLING-5945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15438941#comment-15438941 ] 

Radu Cotescu commented on SLING-5945:
-------------------------------------

[~kwin], can you please provide me with the full info here? You say that you're trying to use that expression inside a block element's content. Do you refer to something like:
{code:html}
<div data-sly-text="${'<{0}> </{0}>' @ format=['myelement'], context='unsafe'}"></div>
{code}

This works. However, if you want this expression to be parsed from a Text Node that will not work - a script is first parsed by the HTML parser and only then by the Sightly parser.

> Using opening angle brackets twice in expression language leads to token recognition error
> ------------------------------------------------------------------------------------------
>
>                 Key: SLING-5945
>                 URL: https://issues.apache.org/jira/browse/SLING-5945
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting Sightly Engine 1.0.18
>            Reporter: Konrad Windszus
>            Assignee: Radu Cotescu
>             Fix For: Scripting Sightly Engine 1.0.20
>
>
> The following Sightly expression leads to an exception when used inside a block element's content
> {code}
>  ${'<{0}> </{0}>' @ format=['myelement'], context='unsafe'}
> {code}.
> The error is 
> {code}
> token recognition error at: ''<{0}>' for expression ${'<{0}>
> 	at org.apache.sling.scripting.sightly.impl.engine.UnitLoader.getSourceCodeForScript(UnitLoader.java:135)
> {code}
> On the other hand
> {code}
>  ${'<{0} /> ' @ format=['myelement'], context='unsafe'}
> {code}
> works without any issues.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)