Hi Jerome,
Jerome Velociter wrote:
Marius Dumitru Florea wrote:
Hi Vincent,
Vincent Massol wrote:
Hi,
Here's what a user was expecting to work (see
http://jira.xwiki.org/jira/browse/XWIKI-3258)
:
{{html}}
<table>
{{velocity}}
#set ($serverDocuments = [$xwiki.getDocument("Main.WebHome"),
$xwiki.getDocument("Sandbox.WebHome")])
#set ($serverClass = "XWiki.MyClass")
#foreach ($serverDocument in $serverDocuments)
<tr>
<td>$serverDocument.space</td>
<td>$serverDocument.name</td>
<td>
#foreach($serverObject in
$serverDocument.getObjects($serverClass))
* whatever
#end
</td>
<td>[[$serverDocument]]</td>
</tr>
#end
{{/velocity}}
</table>
{{/html}}
This is not correct since the HTML macro must contain valid HTML and
this is clearly not the case (the content is parsed by an XML parser
and element content are then parsed using the wiki syntax parser).
So I'm +1 to close this issue as won't fix.
I see lots of users making the mistake but I don't see a solution
right now.
WDYT?
I haven't understood why the HTML is invalid and why velocity macro
should be put first.
I think because
"
{{velocity}}
#set ($serverDocuments = [$xwiki.getDocument("Main.WebHome"),
[...]
"
Is not valid as <table> content.
I'm surprised. Without knowing too much about how macros are executed, I
fill it's natural that if we support nested macros then the inner macros
should be executed first so that the outer macros can use the output for
their own purpose. Are you telling me that the html macro ignores inner
macros but velocity doesn't?
Thanks,
Marius
As long as we can write that kind of script the other way round (with
{{velocity}} before {{html}}), I'm ok to close as won't fix.
Jerome
Thanks,
Marius
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs