[ 
http://jira.codehaus.org/browse/DOXIASITETOOLS-39?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=231568#action_231568
 ] 

Stefan Bodewig commented on DOXIASITETOOLS-39:
----------------------------------------------

Lukas, I fully understand your sentiment and in fact this is what I'd ask if 
anybody reported a bug that I cannot reproduce in my projects as well.  The 
problem here is, I am not a Doxia user, nor a Maven user - I wouldn't even know 
where to start if I tried to provide a test.

Let's take this a few steps backwards.

First, this is what the template reads:

{noformat}
        #set ( $documentHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" )
        #set ( $documentHeader = $documentHeader.replaceAll( "\\", "" ) )
{noformat} 

The first line tries to create an XML declaration with double-quotes and tries 
to escape the double-quotes with a backslash.  The Velocity developers say 
backslashes have never worked as escape character for double-quotes in string 
literals and I trust them.  At least they don't work in Velocity 1.7.

The second line strips backslashes.  If the backslash escaping of the first 
line worked, there wouldn't be any backslash in $documentHeader and the line 
was unneeded.  I take this as a hint that the first line really doesn't work as 
expected and the second line is a workaround to get what you really wanted.

The first approach suggested to me (in the initial description) using $Q is 
supposed to work with any version of Velocity, doubling the double-quotes may 
require a newer version of Velocity.  Either approach should make the second 
line unnessary,

The current template doesn't work with Velocity 1.7 since they now use an 
explicit grammer and ANTLR and the template violates the grammar - see 
http://vmgump.apache.org/gump/public/doxia/doxia-site-renderer-test/gump_work/build_doxia_doxia-site-renderer-test.html
 for a more isolated test.

I don't know how else I could help, in particular since I'm not affected by the 
problem myself at all.


> Velocity > 1.5 can't parse default-site.vm
> ------------------------------------------
>
>                 Key: DOXIASITETOOLS-39
>                 URL: http://jira.codehaus.org/browse/DOXIASITETOOLS-39
>             Project: Maven Doxia Sitetools
>          Issue Type: Improvement
>          Components: Doc renderer, Site renderer
>    Affects Versions: 1.0, 1.1
>            Reporter: Stefan Bodewig
>            Priority: Minor
>
> This is an issue detected by Gump which runs Maven builds but replaces 
> dependencies with the trunk versions of things built by Gump rather than the 
> version a project asks for.
> The Cargo build - see 
> http://gump.zones.apache.org/gump/test/cargo/cargo/gump_work/build_cargo_cargo.html
>  - fails because Velocity doesn't like the line 
> #set ( $documentHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" )
> because \" is not an escape sequence for Velocity (anymore?).
> I've taken this to the velocity list - 
> http://mail-archives.apache.org/mod_mbox/velocity-dev/201008.mbox/%[email protected]%3e
>  - and received the feedback that backslash
> escaping was not supported - and likely never has been - and you should 
> either use single
> quotes inside the double quotes or use something like
> #set( $Q = '"' )
> #set ( $documentHeader = "<?xml version=" + $Q + "1.0" + $Q + ...
> I realize that it probably works for you right now using Velocity 1.5, that's 
> why I used Improvement rather than bug as category.  Still it may be worth to 
> find a solution that works for the version of Velocity you want to use as 
> well as future versions.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to