XML over CSS

M

Mudge

Hi,

I am a relatively new PHP programmer and I am familiar with programming
logic of web sites.  I now want to get a good grasp of content and
presentation.  I am trying to figure out if I should focus on XML and XSL
or CSS.   

Can XML and XSL be used to show content to a browser?  or can only HTML do
that?  

I am thinking that if I could do everything in XML and XSL that I could do
using CSS that I might want to focus on XML and XSL because I can also do
other things with XML and XSL like Web services.

But, is XML and XSL harder to use than CSS and HTML?  Signifigantly harder?

I am planning on building large content management type Web applications.

Your humble opinion is much appreciated (YHOIMA)
 
A

Andy Dingley

Mudge said:
I am trying to figure out if I should focus on XML and XSL
or CSS.

All of the above.
Can XML and XSL be used to show content to a browser?

Yes, but it's not a good idea.
or can only HTML do that?

Use XSL on the server to make (X)HTML that you send to the browser.
Use CSS on the browser to style the presentation.

I am thinking that if I could do everything in XML and XSL that I could do
using CSS

There is no overlap between XSL and CSS. There is _some_, but in
practical terms it turned out not to be a good idea to use it.

But, is XML and XSL harder to use than CSS and HTML?

They're broader in scope, so I'd have to say yes. But it's not a major
factor in choosing which to learn.
 
S

Saqib Ali

Hello,
I am a relatively new PHP programmer and I am familiar with programming
logic of web sites. I now want to get a good grasp of content and
presentation. I am trying to figure out if I should focus on XML and XSL
or CSS.

XSL and CSS are very different. However they do overlap in some area,
especially where presentation of information is concenered. Mozilla
and (I think) IE are capable of presenting XML data by applying a CSS
to it. This should be used (or maybe preffered) in displaying simple
XML data. Take a look at http://www.xml-dev.com/blog/#18 for more info
and sample CSS to display XML in the browser. There is also a tutorial
at the above link.

However XSL should be used when a large amount of XML data needs to
transformed and displayed. So to simplify:

XML + XSL => XHTML
XHTML + CSS => presentable (human readable) content.

I this case the XSL is used to transform the XML content to XHTML. and
a CSS is used to make it presentable.
Here are some examples ( http://www.xml-dev.com/blog/#88 ) of how
Apache's Cocoon (XML publishing framework) is being used to transform
XML to XHTML and then a CSS being applied to present the content.

So to summarize:
It really depends on your application and your audience who will be
using the application. For cross browser compatibility I would suggest
using XSLT to first convert XML to XHTML and then applying CSS.

Some benefits of CSS:
1) CSS can help multi-platform use.
2) Done right, CSS is a great way to separate content from
presentation.
3) Printing: Another Advantage of CSS


In Peace,
Saqib Ali
http://validate.sf.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top