XML over CSS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mudge

    XML over CSS

    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)
  • Andy Dingley

    #2
    Re: XML over CSS

    Mudge <mark1822@hotma il.com> wrote in message news:<I0kIc.705 32$XM6.15707@at tbi_s53>...
    [color=blue]
    > I am trying to figure out if I should focus on XML and XSL
    > or CSS.[/color]

    All of the above.
    [color=blue]
    > Can XML and XSL be used to show content to a browser?[/color]

    Yes, but it's not a good idea.
    [color=blue]
    >or can only HTML do that?[/color]

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

    [color=blue]
    > I am thinking that if I could do everything in XML and XSL that I could do
    > using CSS[/color]

    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.

    [color=blue]
    > But, is XML and XSL harder to use than CSS and HTML?[/color]

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

    Comment

    • Saqib Ali

      #3
      Re: XML over CSS

      Hello,
      [color=blue]
      > 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.[/color]

      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

      Comment

      Working...