OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
My XML assignment
This page's ID:
11057
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I have to build small web site ( 3 pages) using XML and XSL. Well, honestlly I am pretty confused about this XML things. I cannot describe details about what I am confused but I want to say something. 1. Am I allowed to put CSS stylesheet link in XSL file? XSLT is stylesheet of XML, right. That is fine. I am making a template to show XML data as XHTML. My XSL file is including table. I wanted to formate it nicely. My code was like: [code]<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <html> <body style="font-family: verdana; font-size: x-small;"> <h3>Ophihi Vinyeard Home Page</h3> <table style="font-size: x-small; border: solid 1px #000;border-collapse: collapse; "> <tr bgcolor="#9acd32"> <th style="border: solid 1px #000;padding: 5px;">Wine</th> <th style="border: solid 1px #000;padding: 5px;">Color</th> <th style="border: solid 1px #000;padding: 5px;">Award</th> <th style="border: solid 1px #000;padding: 5px;">Price</th> </tr> <xsl:for-each select="home/list"> <tr > <td style="border: solid 1px #000;padding: 5px;"><xsl:value-of select="wine" /></td> <td style="border: solid 1px #000;padding: 5px;"><xsl:value-of select="color" /></td> <td style="border: solid 1px #000;padding: 5px;"><xsl:value-of select="award" /></td> <td style="border: solid 1px #000;padding: 5px;"><xsl:value-of select="price" /></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>[/code] Then I thought it is pretty much like [b]INLINE[/b] format, which is not convinient to change formate many pages at once. I tried to put CSS inside of XSLT file like: [code]<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <html> <head> [b]<link rel="stylesheet" type="text/css" href="1-1.css" />[/b] </head> <body style="font-family: verdana; font-size: x-small;"> <h3>Ophihi Vinyeard Home Page</h3> <table style="font-size: x-small; border: solid 1px #000;border-collapse: collapse; "> <tr bgcolor="#9acd32"> <th >Wine</th> <th >Color</th> <th >Award</th> <th >Price</th> </tr> <xsl:for-each select="home/list"> <tr > <td ><xsl:value-of select="wine" /></td> <td ><xsl:value-of select="color" /></td> <td ><xsl:value-of select="award" /></td> <td ><xsl:value-of select="price" /></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>[/code] Well, it worked fine (IE5.0). What I have done is: take out all td and th stlyle then put them into stylesheet file called 1-1.css. Then made a link in head section of XSL file. Hmm......... Well, let me clear again. 1. I cannot see the point making web site using XML and XSLT. Is that any good thing behind them? 2. I cannot see the point to apply XSLT to XML to display data. Why not just apply CSS on XML??? Well, I have to do it even though I am pretty confused.......Ah........ Hiroki Kozai [This message has been edited by Hiroki (edited 09-24-2003).] [This message has been edited by Hiroki (edited 09-24-2003).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »