You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ulrich Stärk <ul...@spielviel.de> on 2009/11/16 15:43:23 UTC

Component rendering question

Hey Folks,

I hope someone is able to explain to me the following behaviour I'm observing:

While playing around with a mixin [1] to trace components in the generated markup (basically it just 
wraps the component markup inside a BEGIN and END XML comment and is added to every component using 
a ComponentClassTransformWorker), I noticed the following output for the index page of the 
quickstart archetype:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><!-- BEGIN: Index --><!-- BEGIN: Index:layout 
--><!-- Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Title      : Concrete
Version    : 1.0
Released   : 20080825
Description: A Web 2.0 design with fluid width suitable for blogs and small websites. --><!-- END: 
Index:layout --><!-- END: Index --><html xmlns="http://www.w3.org/1999/xhtml">
...

So, instead of wrapping the markup for the whole page inside a <!-- BEGIN: Index --><!-- BEGIN: 
Index:layout -->...<!-- END: Index:layout --><!-- END: Index -->, it just wraps the comment from the 
layout component inside the trace comments.

Any ideas why?

Cheers,

Uli

[1]
public class Trace
{
     @Inject
     private ComponentResources resources;

     void setupRender(MarkupWriter writer)
     {
         writer.comment("BEGIN: " + resources.getContainerResources().getCompleteId());
     }

     void cleanupRender(MarkupWriter writer)
     {
         writer.comment("END: " + resources.getContainerResources().getCompleteId());
     }
}

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


Re: Component rendering question

Posted by Ulrich Stärk <ul...@spielviel.de>.
That's a different story. If it's not allowed, Tapestry is violating 
that rule by rendering out the freecsstemplates template comment which 
it does independently from whether I activate the trace comments or not.

Uli

Thiago H. de Paula Figueiredo schrieb:
> Em Mon, 16 Nov 2009 12:43:23 -0200, Ulrich Stärk <ul...@spielviel.de> 
> escreveu:
> 
>> Hey Folks,
> 
> Hi!
> 
>> So, instead of wrapping the markup for the whole page inside a <!-- 
>> BEGIN: Index --><!-- BEGIN: Index:layout -->...<!-- END: Index:layout 
>> --><!-- END: Index -->, it just wraps the comment from the layout 
>> component inside the trace comments.
> 
> Does the XML standard allow comments before the root element? I guess it 
> doesn't.
> 


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


Re: Component rendering question

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 16 Nov 2009 12:43:23 -0200, Ulrich Stärk <ul...@spielviel.de>  
escreveu:

> Hey Folks,

Hi!

> So, instead of wrapping the markup for the whole page inside a <!--  
> BEGIN: Index --><!-- BEGIN: Index:layout -->...<!-- END: Index:layout  
> --><!-- END: Index -->, it just wraps the comment from the layout  
> component inside the trace comments.

Does the XML standard allow comments before the root element? I guess it  
doesn't.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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