[ https://issues.apache.org/jira/browse/VELOCITY-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624216#action_12624216 ]
Will Glass-Husain commented on VELOCITY-391: -------------------------------------------- I'm ok with resolving this. We've addressed the issue for references. And you can escape bigger blocks of text by putting them in an included file and doing a #set($content = "#IncludeParsed('file')") using a EscapeXmlReference handler to escape $content. > Provide better syntax for converting XML entities > ------------------------------------------------- > > Key: VELOCITY-391 > URL: https://issues.apache.org/jira/browse/VELOCITY-391 > Project: Velocity > Issue Type: Improvement > Components: Engine > Affects Versions: 1.4 > Environment: Operating System: All > Platform: Other > Reporter: bob.tarling > Priority: Minor > > I'm using velocity to persist my applications data in XML format. The problem > is > with converting special XML characters to entities. > I have read the developers guide here > http://jakarta.apache.org/velocity/developer-guide.html#Velocity%20and%20XML > I'm wondering if the developers would consider some addition to the velocity > syntax to help with this instead. I can't help think that generation of XML > must > be a common requirement for velocity users and a shortcut syntax would help > keep > templates looking neater. > How about the likes of the following to display a field with automatic > conversion of XML characters to entities. > <p>The clients name is $&clientName</p> > So the client name John O'Connor becomes > <p>The clients name is John O'Connor</p> > There are alternatives, such as having a specific file type. > e.g. .xvm as opposed to .vm > A secondary advantage to this is that syntax highlighters could be devised to > recognise and highlight both the XML and the template code. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]