473,785 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3021

Follow-ups to comp.text.xml.

On Apr 13, 1:29 pm, Rob Kerr <robert.k...@bb c.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...@bb c.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
9722
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 second Serialize work namespace SerializeTes public class Class args Test _test = new Test() _test.TestAnimal()
10
1966
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, here is what I posted: I have downloaded the final production version of VS 2005 pro after testing with Team version. I wonder if I've been screwed or if it's just too early on a Sunday morning. It seems to me that it was relatively trivial to...
3
9444
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 XmlSerializer(oClassType); System.Text.StringBuilder strBuilder = new System.Text.StringBuilder(); System.IO.TextWriter writer = new System.IO.StringWriter(strBuilder); try { oSerializer.Serialize(writer,oClassObject); }
0
787
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 characters (latin) I use <? xml version="1.0" encoding="iso-8859-1" ?> as the document declaration. The problem is that when I generate some XML document all special characters get corrupted in Flash but if I save the file to disk and set Flash to...
1
2862
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 types and of more elaborate classes implementing IXmlSerializable. The resulting WSDL file for the webservice has two separate schemas in its <types> sections, and the client proxy (generated with wsdl.exe) is missing the definitions of the...
0
1464
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 generating castor bean. i have created my binding.xml file. but i don't know how to use this binding.xml file while creating beans. is it required to put the binding.xml file in classpath or where can i mentioned the path of this file so that while...
2
1519
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 into string field. Can you please let me know what am I doing wrong. Thanks, Nis
2
4279
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 D:\workspace\JavaApplication4\src\javaapplication4\Main.java... Constructing Javadoc information... Standard Doclet version 1.6.0 Building tree for all the packages and classes...
2
1265
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
2207
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 form pages, well over 500 potential fields, which are written in PHP. While most pages are one time entry forms, there are 5 that can be “recycled” as many times as needed. An example would be the Contacts Form. A user can give me 1 contact and move...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.