FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

CSS or XSL

 


vinx_18
I want to build a full xml website.. Which should I choose to render it..xsl or css? Then, I have a problem with links... How could i put links?
rohan2kool
what do u mean by a XML website?? You mean an XHTML website??

XSLT is not used as a substitute for CSS : never. XSLT is used to actually modify an XML file into another XML file. Let's say... converting ATOM feeds to XHTML in a particular scenario bound by certain rules which are defined in your XSLT document.

It's more commonly used to convert XML database records to HTML but in concept, it is meant to be used to convert one type of XML document into another.
mariohs
A full xml site... that could be just a well formed xhtml document, served as text/xml or application/xhtml+xml, right?
xhtml is, by its essence, a xml document itself. You can just use css to present your site.

Just be careful that IE6 doesn't (and I think that IE7 doesn't either) support application/xhtml+xml mime type, so you'll have to use Content Negotiation to serve your document as real xhtml for browsers that support it, and text/html for IE.
-Jordan-
Use XSL, it was built for displaying styled XML data.

CSS was built for styling HTML, unless you are meaning XHTML?

XSL Is a little bit more tricky than CSS though, mainly because you are styling VERY raw data. But if you insist on a 100% XML website, xsl is your best bet.

http://www.w3schools.com/xsl
rohan2kool
-Jordan- wrote:
Use XSL, it was built for displaying styled XML data.

CSS was built for styling HTML, unless you are meaning XHTML?

XSL Is a little bit more tricky than CSS though, mainly because you are styling VERY raw data. But if you insist on a 100% XML website, xsl is your best bet.

http://www.w3schools.com/xsl


XSL doesn't style XHTML, it just transforms it into another type of an XML document. Now, we say styling when we refer to XSLT is because with XSLT we generally transform normal XML pages to XHTML [now, XHTML too is a type of an XML document] and then view the transformed XML document [which is our XHTML page] in an application known as a 'browser' which can understand the XHTML page.
Ranfaroth
CSS can perfecly style raw XML documents...
To add links in your XML files, use XLink.
Alias
I prefer XSL to use in XML because it is far more flexible than CSS. Smile
vinx_18
Ranfaroth wrote:
CSS can perfecly style raw XML documents...
To add links in your XML files, use XLink.


But xlink is not supported by major browsers...
Ranfaroth
It's supported by gecko browsers...
ehab
Though, I dont know XML much .. CSS is fun in most cases, a little easier I think ?

Right now, I am learning the essence of HTML and moving on to CSS so that I wouldn't have to use DreamWeaver any more Smile

I think you shud stick to CSS , like i do Razz
jabapyth
use CSS, its easier and better supported by browsers
Kaneda
rohan2kool wrote:
XSL doesn't style XHTML


Yes it does.

Quote:
it just transforms it


No, it can also transform it.

Quote:
Now, we say styling when we refer to XSLT is because with XSLT we generally transform normal XML pages to XHTML


We rarely say styling when we refer to XSLT - XSLT is a subset of XSL which is preoccupied with Transformation of a document. Like you say. However, transformation is not styling.

XSL is a family of tools, consisting of XSLT, XPath and XSL-FO. And XSL-FO is a (more powerful) CSS equivalent expressed in XML.

Code:
<store>
  <fruits>
    <fruit type="apple">Granny Smith</fruit>
    <fruit type="apple">Some other apple</fruit>
    <fruit type="orange">Seville</fruit>
  </fruits>
  <beverages>
    <beverage type="vodka">Stolichnaya</beverage>
  </beverages>
</store>


Code:
<xsl:template match="fruits">
  <fo:block font-weight="bold">
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

<xsl:template match="fruit[@type='apple']">
  <fo:block background-color="green">
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

<xsl:template match="fruit[@type='orange']">
  <fo:block background-color="orange">
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>


That's XSL, and that's styling.

That said, yes, unless your XML (and no, it doesn't have to be XHTML in order to style it) is very complex, use CSS. Simpler and more widely supported - and both are recommended by W3C.
akshar
Quote:
CSS is easy to learn then xslt.CSS is uaed to format HTML.
XSLT is used to format XML.XSLT is not used as a substitute for CSS : never. XSLT is used to actually modify an XML file into another XML file.
just take in to account that old browser dont support XSLT and css(external)
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.