...

CSS style sheets in XML - Is it possible

nibs
04-25-2003, 10:06 PM
I wat to apply CSS style sheet attributes to an XML file is this possible or do I have to write a seperate XSLT sheet for modifying style in an XML file


thank you in advance

brothercake
04-25-2003, 10:22 PM
You don't have to, but XSL is far more powerful; what you can do with CSS is more limited, even with CSS3.

Nonetheless - w3schools have an example of an XML doc processed with CSS - it's pretty much the same as processing HTML, except that no styles are implicit - you have to specify everything. Have a look at http://www.w3schools.com/xml/xml_display.asp

Alex Vincent
04-26-2003, 01:12 AM
The <?xml-stylesheet ?> processing instruction works almost identically to the HTML 4 LINK element. If you know how to set that element's attributes, then use the same format for the processing instruction, with "pseudo-attributes".

For CSS, you'd use:

<?xml-stylesheet href="foo.css" type="text/css" ?>

XSLT and CSS are really intended for different purposes. XSLT is to transform one XML language into another (usually into XHTML). CSS is to style the appearance of the XML document.

nibs
04-28-2003, 04:02 PM
Thank you both so much for the great insights

nibs

liorean
09-02-2003, 06:42 PM
Originally posted by brothercake
You don't have to, but XSL is far more powerful; what you can do with CSS is more limited, even with CSS3.

Hmm, if I'm not mistaken, XSLT is not at all a styling language, but a transformation language. if you want to use XLS for styling, you need to look into XML-FO.

However, XLS-FO destroys a document's semantical and structural meaning, changing it to pure style, while css allows the nice combination of a preserved semantical structure while styling a document.


Then we have the bindings languages, HTC/Behaviors, and XBL. Those are not standard, but allows for something that could be called "non-destructive transformation" or "expansion" and styling through regular means (css).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum