W3C home > Mailing lists > Public > www-style@w3.org > October 2003

Re: [CSS3] Generated and Replaced Content - Grouping (long, examples)

From: Robert Koberg <rob@koberg.com>
Date: Thu, 30 Oct 2003 10:03:33 -0800
Message-Id: <60174B0C-0B03-11D8-B25C-00039354A8EC@koberg.com>
Cc: www-style@w3.org
To: Stanimir Stamenkov <stanio@myrealbox.com>


On Oct 30, 2003, at 9:35 AM, Stanimir Stamenkov wrote:

>
> Robert Koberg wrote:
>
>> You would be surprised how much it simplifies things. Separation of 
>> Concerns is a good thing.
>
> O.k. We are talking about improving the CSS language. 
> Workarounds/practices defined for/of shortcomings are not eternal 
> solution, IMHO.

I believe you should not look for a Golden Hammer 
(http://c2.com/cgi/wiki?GoldenHammer). And in this case, it does not 
even seem possible, so you need a different approach. It is not a 
workaround. It is a best-practice.

>
>> In the example I provided (to address this concern) which you seem to 
>> have ignored, I used the element name as the class name. Therefore 
>> you handle the final styling with CSS.
>
> BTW, your example is not very good for my case. In the abstract XML a 
> need to have:

I don't understand why you *need* it especially if it does not exist 
yet. Create a useful content architecture and the rest is easy.

>
> <HDR1/>
> <PARA/>
> <HDR2/>
> <PARA/>
> <HDR3/>
> <PARA/>
> <HDR2/>
> <PARA/>
> <PARA/>

Why set yourself up for a difficult task when you can set yourself up 
for an easy one?

Anyway, you can use XSL to transform the above nodeset (XML has a root 
tag) into the structure you present below. It is a VFAQ on the XSL 
list. There are several resources that show you how to solve it with 
the best probably at:
http://www.jenitennison.com/xslt/grouping/index.html


>
> and in the HTML output:
>
> <BODY>
>   <H1/>
>   <P/>
>   <DIV class="generated-section">
>     <H2/>
>     <P/>
>     <DIV class="generated-section">
>       <H3/>
>       <P/>
>     </DIV>
>   </DIV>
>   <DIV class="generated-section">
>     <H2/>
>     <P/>
>     <P/>
>   </DIV>
> </BODY>
>
> So I want to display my source XML document using CSS without 
> transforming it into another and applying different CSS.

No, IMO, you really don't want this. But, good luck anyway.

best,
-Rob


>
> -- 
> Stanimir
>
Received on Thursday, 30 October 2003 13:03:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:24 GMT