HighDots Forums  

Generating CSS from XML: how to?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Generating CSS from XML: how to? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rob Kerr
 
Posts: n/a

Default Generating CSS from XML: how to? - 04-13-2007 , 06:29 AM






Hi,

After a quick Google turned up very little of use, I've turned to
here. The question: has anyone tried to (or more usefully, succeeded
in) generating CSS files from an XML document transformed using XSL?
Is there an existing schema for CSS in XML? Would there be any
benefit in such a thing?

The reason I ask is because I'm about to embark on an overhaul of a
large site which divides into similar sections with thematic design
variations. The structure of the sections will be similar, but each
section will have its own colour scheme. I would like to be able to
have an XML document for each theme that would create a CSS file for
that theme -- easier for content people to edit XML documents than
CSS files, as they are already editing the content XML.

Any help (or definite answers saying why it's a non-starter) would be
useful.

Thanks,

Rob Kerr
--
"It's impossible for an Englishman to open his mouth without making
some other Englishman despise him."
-- G.B.S., "Pygmalion"

Reply With Quote
  #2  
Old   
p.lepin@ctncorp.com
 
Posts: n/a

Default Re: Generating CSS from XML: how to? - 04-13-2007 , 07:06 AM







Follow-ups to comp.text.xml.

On Apr 13, 1:29 pm, Rob Kerr <robert.k... (AT) bbc (DOT) co.uk> wrote:
Quote:
The question: has anyone tried to (or more usefully,
succeeded in) generating CSS files from an XML document
transformed using XSL?
I haven't but I see no reason why this wouldn't work,
assuming you transform server-side and supply correct
Content-Type when serving the result.

Just use:

<xslutput method="text"/>

Quote:
Is there an existing schema for CSS in XML?
Not to my knowledge.

--
Pavel Lepin



Reply With Quote
  #3  
Old   
Manuel Collado
 
Posts: n/a

Default Re: Generating CSS from XML: how to? - 04-13-2007 , 11:00 AM



Rob Kerr escribió:
Quote:
Hi,

After a quick Google turned up very little of use, I've turned to
here. The question: has anyone tried to (or more usefully, succeeded
in) generating CSS files from an XML document transformed using XSL?
I've been interested in such thing. It seems relatively simple, but
found not enough spare time to try it. After reading your post, I've
spent some time in searching the net, with partial success.

Quote:
Is there an existing schema for CSS in XML? Would there be any
benefit in such a thing?

There is JXCSS: a CSS to XCSS (XML markup) converter.

Home: https://jxcss.dev.java.net/
Download: from the "Documents & files" left menu entry.
Some reference:
http://www.opensubscriber.com/messag...g/3083290.html

Regretably, the mentioned CSS in XML DTD (xcss.dtd) cannot be found in
the distribution files, nor in the website (there is a broken page
reference: https://jxcss.dev.java.net/css-dtd.html)

The missing DTD can probably by inferred by processing css samples with
JXCSS, or from the provided XSLT stylesheet (compact-xcss.xsl) to
convert xcss to plain css.

If you ever produce a XML DTD or schema for CSS, I'll be interested on
it. Perhaps I could offer some collaboration, at least by discussing
issues or testing the draft stuff.

Quote:
...
Any help (or definite answers saying why it's a non-starter) would be
useful.
Hope this helps.
--
Manuel Collado - http://lml.ls.fi.upm.es/~mcollado


Reply With Quote
  #4  
Old   
Manuel Collado
 
Posts: n/a

Default Re: Generating CSS from XML: how to? - 04-13-2007 , 11:12 AM



Manuel Collado escribió:
Quote:
Rob Kerr escribió:
...
Is there an existing schema for CSS in XML? Would there be any
benefit in such a thing?

There is JXCSS: a CSS to XCSS (XML markup) converter.
A further search finds:

CSSML, at: http://www.outer-court.com/tech/index.htm

Perhaps too simple, but provides a DTD and ready-to-use tools.

Regards.
--
Manuel Collado - http://lml.ls.fi.upm.es/~mcollado


Reply With Quote
  #5  
Old   
Andy Dingley
 
Posts: n/a

Default Re: Generating CSS from XML: how to? - 04-17-2007 , 05:18 PM



On 13 Apr, 11:29, Rob Kerr <robert.k... (AT) bbc (DOT) co.uk> wrote:


Quote:
The question: has anyone tried to (or more usefully, succeeded
in) generating CSS files from an XML document transformed using XSL?
Trivial, easy and just a bad idea, so don't do it.

CSS is plain text. Use the right XSL output method and you can make
some - anything you want, whatever content you like.

However you shouldn't _need_ dynamic CSS. An apparent need for such a
thing usually indicates that the HTML itself is broken and has
inadequate specificity of usable selectors (i.e., get some better
classes in there). If the selectors are adequate, then a _static_ CSS
document can deliver all you need.

This technique is often seen in conjunction with absolute CSS
positioning, and indicating that the design positioning is inflexible.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.