This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Stylesheets > April 2007 > Generating CSS from XML: how to?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Generating CSS from XML: how to?
|
|
| Rob Kerr 2007-04-13, 6:16 pm |
| 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"
| |
| p.lepin@ctncorp.com 2007-04-13, 6:16 pm |
|
Follow-ups to comp.text.xml.
On Apr 13, 1:29 pm, Rob Kerr <robert.k...@bbc.co.uk> wrote:
> 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:
<xsl:output method="text"/>
> Is there an existing schema for CSS in XML?
Not to my knowledge.
--
Pavel Lepin
| |
| Manuel Collado 2007-04-13, 6:16 pm |
| Rob Kerr escribió:
> 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.
> 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/messa...rg/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.
> ...
> 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
| |
|
|
| Andy Dingley 2007-04-17, 6:28 pm |
| On 13 Apr, 11:29, Rob Kerr <robert.k...@bbc.co.uk> wrote:
> 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.
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|