I guess the MarkupWriter comes in handy for generating XML documents as well

does tapestry allow the output of say,

<xml version=1.0 utf>

</xml>


That would come in handy for submitting xml documents to other services without 
HTTP.


On 03/04/2012, at 7:54 PM, Lance Java wrote:

> I always favour .tml for generating markup.
> 
> The MarkupWriter gives you complete control but in this case, I think that
> .tml would suit your use case better
> 
> On Tuesday, 3 April 2012, Lance Java <lance.j...@googlemail.com> wrote:
>> This should work:
>> 
>> private static final String NEWLINE =
> System.getProperty("line.separator");
>> ...
>> 
>> writer.element("div", "class", "userbackground");
>> writer.writeRaw(NEWLINE);
>> writer.element("div","id",currentPhone.getNumber(), "class","user");
>> ...
>> 
>> On Tuesday, 3 April 2012, Chris Mylonas <ch...@opencsta.org> wrote:
>>> Hi Tap List,
>>> 
>>> 
>>> I've got production mode set to false and the parts of the html document
> that I haven't created come out quite nicely.
>>> The parts I have rendered in my component (below) are coming out on one
> line.  It's the eye-sore of the document!!
>>> 
>>> How do I fix this?
>>> 
>>> 
>>> I'm also wondering what the advantages are of using code to generate the
> html if I've already built the template in html?
>>> This
>>> 
>>>               writer.element("div", "class", "userbackground");
>>>               writer.element("div","id",currentPhone.getNumber(),
> "class","user");
>>>               writer.element("div","class","infoline1");
>>>               writer.element("div","class","name");
>>>               writer.write(currentPhone.getName() + " " +
> currentPhone.getNumber());
>>>               writer.end();
>>>               writer.end();
>>>               writer.element("div","class","infoline2");
>>>               writer.element("div","class","voicemail");
>>>               writer.element("img","src","email.png");
>>>               writer.end();
>>>               writer.end();
>>>               writer.end();
>>>               writer.element("div", "class","currentcall
> currentcallplaceholder");
>>>               writer.writeRaw("&nbsp;");
>>>               writer.end();
>>>               writer.end();
>>>               writer.end();
>>>               writer.element("div","class","spacer");
>>>               writer.end();
>>> 
>>> VS
>>> this
>>> 
>>>               writer.writeRaw("" +
>>>               "<div class=\"userbackground\">" +
>>> "<div id=\"" + currentPhone.getNumber() + "\" class=\"user\">" +
>>>   "<div class=\"infoline1\">" +
>>>       "<div class=\"name\">" + currentPhone.getName() + " " +
> currentPhone.getNumber() + "</div>" +
>>>       "</div>" +
>>>   "<div class=\"infoline2\">" +
>>>       "<div class=\"voicemail\"><img src=\"email.png\" /></div>" +
>>>       "</div>" +
>>>   "<div class=\"currentcall currentcallplaceholder\">&nbsp;" +
>>>   "</div>" +
>>> "</div>" +
>>> "</div>" +
>>> "<div class=\"spacer\">" +
>>> "</div>");
>>> 
>>> 
>>> 
>>> It's just a copy paste, run over it with some backslashes where I need
> to.
>>> 
>>> Cheers
>>> Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to