I'm using the C# version of the StringTemplate library (http://www.stringtemplate.org/) to generate C++ code. My templates work fine, until I started using the
<attribute:template(argument-list)>
syntax to apply templates to multiple values in a 'list' ('multi-valued-argument' if I'm correct in the StringTemplate lingo). From that mo...
I am exploring ASP.NET MVC and I wanted to add jQuery to make the site interactive. I used StringTemplate, ported to .Net, as my template engine to generate html and to send JSON. However, when I view the page, I could not see it. After debugging, I've realized that the $ is used by the StringTemplate to access property, etc and jQuery u...
I would like to use a template engine in my struts web application. Therefore I would like to use StringTemplate, but have no idea how to implement in Struts.
...
I'm using MessageFormat to format some addresses with a template like this:
"{0}\n{1}\n{2}\n{3}, {4} {5}"
where
0 = street 1
1 = street 2
2 = street 3
3 = city
4 = state
5 = zip
Most of these fields are optional when captured. How do I avoid having an empty line when for instance, there is not street 3? I could use a template lik...
I love the StringTemplate engine, and I love the CherryPy web server, and I know that they can be integrated.
Who has done it? How?
EDIT: The TurboGears framework takes the CherryPy web server and bundles other related components such as a template engine, data access tools, JavaScript kit, etc. I am interested in MochiKit, demand C...
Hmm, sounds easy enough but after looking at the ones that come with StringTemplate, there is no way this is easy for me the average developer.
Where does one start?
From doing some more digging it seems to accomplish this one would also have to learn the ANTLR tool to create the language file? Is that correct?
Or can I just copy one t...
It's hard to see how StringTemplate integrates easily (or not) with popular Java web MVC frameworks.
Which Java MVC frameworks integrate easily with StringTemplate?
A good answer:
mentions one solution to integrate with a framework,
includes a link to something useful and applicable, like:
a tutorial,
or documentation,
or a referenc...
In this example I am striping with code before passing in to the template, I just wanted to make sure I wasn't missing some already built-in stringtemplate functionality.
using System;
using System.Linq;
using Antlr.StringTemplate;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Tests
{
[TestClass]
public class R...
I'm trying to iterate over a ListDictionary (C# StringTemplate) in a template and have each list item invoke another template:
DataDefAssign(cols) ::=
<<
<cols.keys: { k | <PropDef(name=<k>, type=<cols.(k)>) }>
>>
The above template does not generate anything.
If I inline an anonymous template instead of trying to invoke the PropDef t...
Among the Java templating solutions such as Apache Velocity, Freemarker, Hamlets, Tapestry, StringTemplate, JSP, JSP Weaver (others?) which would most closely approximate the conciseness and simplicity of similar HTML templating solutions in Ruby - haml/erb. I'm concerned both with the syntax of the templating engine as well as how simpl...
Hello,
I've just started using StringTemplate in my C# project. I went through the documentation, but I can't seem to find a way to implement this simple scenario:
I have a list of simple business objects (let's say Orders) and I want them displayed inside a UL tag inside my html template.
So, my .st template looks like this (pseudo-c...
I have the following code:
StringTemplate st = new StringTemplate("$msg$");
st.SetAttribute("msg", "Hello $usr$");
st.SetAttribute("usr", "Jakub");
Console.WriteLine(st);
// current output: "Hello $usr$"
// expected output: "Hello Jakub"
Do anybody know how to force StringTemplate to evaluate $usr$ attribute?
...
Hi
my problem is with string template and operating under medium trust that godaddy enforces. Has anyone had the same problem and what did you do?
Moving to another host is a solution so feel free to name one.
Modifying the code will be the last thing I want to do since it is mostly done and it will set me back some time.
I have read ...
I haven't been able to find a good example of subclassing string.Template in Python, even though I've seen multiple references to doing so in documentation.
Are there any examples of this on the web?
I want to change the $ to be a different character and maybe change the regex for identifiers.
...
I'm trying to use ILMerge to internalize some transitively referenced assemblies into an assembly I'm referencing to eliminate conflicts with those transitive dependencies elsehwere in my project.
In particular, I'm referencing Antlr3.StringTemplate (hereafter referred to as AS, available here: http://www.stringtemplate.org/download.htm...
I want to build my HTML template like $GetCurrencyType(Customer.currencyType)$. Here Customer is the object and currencyType is the integer property and GetCurrencyType is the method which return currency symbol as string. GetCurrencyType was in another class and i called the method using local instance.
in C# code just I'll call st.Set...
Run into a bit of a snag using StringTemplate today. Were using StringTemplate 3.1 with .Net 3.5.
If I have a template that renders a collection of items, it renders fine if I call it directly.
However, if I call that template from another template and passing the collection through as a parameter, it fails to render at all.
The follo...
We are using Antlr StringTemplates to give control over how a Entity's Name is output.
The basic Stringtemplate is
$FirstName$ $Initial$ $LastName$,
$Suffix$, $Degree$
I want to add some smarts to that template so that the commas are only output when necessary i.e. The first comma is only output when there is a Suffix or Deg...
This displays nothing:
$Articles:{
$if(i!=1)$
display in between articles
$endif$
$it.Text
}
This displays as expected
$Articles:{
display in between articles
$it.Text
}
Any ideas on how to get this working?
...
I'm looking for a struts2 StringTemplate result type.
Given an action result I'd like to render the html using StringTemplate.
There are struts2 result types for Velocity, FreeMarker etc but I haven't been able to find one for StringTemplate, Google doesn't help.
Has anyone seen such result type?
Or perhaps this is something that mysteri...