473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Generating CSS from XML: how to?

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"
Apr 13 '07 #1
4 3006

Follow-ups to comp.text.xml.

On Apr 13, 1:29 pm, Rob Kerr <robert.k...@bbc.co.ukwrote:
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

Apr 13 '07 #2
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/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.
...
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
Apr 13 '07 #3
Manuel Collado escribió:
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
Apr 13 '07 #4
On 13 Apr, 11:29, Rob Kerr <robert.k...@bbc.co.ukwrote:

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.

Apr 17 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Riley Phelps | last post by:
When I use the XML Serializer in the following example, the first Serialize (with the class Pets) works, but the second (with the cplaa Pets2) fails. Which arrtubute nedds to be applied to make the...
10
by: Al Christoph | last post by:
Please forgive me if this is the wrong place to post this. The last place I posted got me a fairly rude response. I guess vb.db people just don't want to think about XML as database. At any rate,...
3
by: Raed Sawalha | last post by:
Hello when I serialize an object an error generated using this function public string SerializeObject(object oClassObject,System.Type oClassType) { XmlSerializer oSerializer = new...
0
by: VR | last post by:
Hi, I'm generating some XML documents to integrate my system with a Macromedia Flash front-end and I'm really getting crazy with something related to encoding. As I have to use some special...
1
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive...
0
by: manas589 | last post by:
Hi Can any one tell me how to use binding.xml while generating castor bean from an xsd file. i have one xsd file where two element are conflicting. so i thought to use binding file while...
2
by: imonline | last post by:
Hi, I am generating XML and setting it into the string field. Which will be again generated into xml. Now the last xml which has xml in string field converts into "&gt" for the xml which is set...
2
by: rednarjess | last post by:
Hello every body; When I want to generate the Javadoc for my project, The result is fine at the bigining of the generating init: Generating Javadoc Javadoc execution Loading source file...
2
by: orsula | last post by:
Hi all, I would like to generate xml from a structure, e.g.: Dictionary <key, valueArraymyDict; Into : <myDict> <key>key</key> <valueArray> <value>1</value> <value>2</value>
1
nine72
by: nine72 | last post by:
Ok, I am at a complete loss on this and have finally come to the XML Parsing Gods (and perhaps a PHP minor deity) for guidance… I will try my best to describe what I have going on… 1) I have 15...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.