Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 2.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-25-2003, 10:06 PM   PM User | #1
nibs
New Coder

 
Join Date: Feb 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
nibs is an unknown quantity at this point
CSS style sheets in XML - Is it possible

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
nibs is offline   Reply With Quote
Old 04-25-2003, 10:22 PM   PM User | #2
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
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
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark
brothercake is offline   Reply With Quote
Old 04-26-2003, 01:12 AM   PM User | #3
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
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.
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog

Last edited by Alex Vincent; 04-26-2003 at 01:14 AM..
Alex Vincent is offline   Reply With Quote
Old 04-28-2003, 04:02 PM   PM User | #4
nibs
New Coder

 
Join Date: Feb 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
nibs is an unknown quantity at this point
Thank you both so much for the great insights

nibs
nibs is offline   Reply With Quote
Old 09-02-2003, 06:42 PM   PM User | #5
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Quote:
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).
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

Last edited by liorean; 09-02-2003 at 06:47 PM..
liorean is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 02:30 PM.


Advertisement
Log in to turn off these ads.