|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Member
Join Date: Dec 2007
Posts: 2
|
creating a .css file for xml
q
Last edited by willroads; Dec 11, 2007 at 06:52. |
|
|
|
|
|
#2 |
|
Community Advisor
![]() ![]() ![]() Join Date: May 2003
Location: Washington, DC
Posts: 9,260
|
What you need to do is use XSL to transform the XML data into HTML that a browser can handle. Then all the normal CSS stuff is avaliable for your use.
|
|
|
|
|
|
#3 | |
|
Brevity is greatly overrated
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,427
|
Quote:
Of course, the first thing you need to to is make sure you have complete (DTD etc.) and properly marked up page/s so the browser/s doesn't choke - a typical XML parser is pretty unforgiving. Further, in the context you have with the iframe and whatnot I am not sure it would/will work and then you have the issue of browser support for XML (which isn't that bad actually). So you may or may not have some success given the browsers you intend to support (there is always THE problem child browser to deal with) and the compromises you are willing to make. Certainly at least worth tinkering with. Saxon is probably the easiest way to get up and running with XSLT, should you want to transform your XML to (X)HTML first and then apply the CSS to it. |
|
|
|
|
|
|
#4 |
|
SitePoint Member
Join Date: Dec 2007
Posts: 2
|
s
Last edited by willroads; Dec 11, 2007 at 06:53. |
|
|
|
|
|
#5 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Nov 2005
Location: Moss, Norway.
Posts: 280
|
Note, there is (was at least not in XSLT 1.0) an output XHTML method in XSLT. But since, XHTML has to be well-formed XML, you can use XML as the output method for XHTML. That is, you can define the style sheet element like this:
Code:
<xsl:stylesheet version='1.0' xmlns:xsl="http://w3.org/1999/XSL/Transform" xmlns="http://w3.org/1999/xhtml"> // (Default name space. I don't like it, so you you may prefix it with your own QName). <xsl:output method="xml" ... /> </xsl:stylesheet> |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 19:25.













Linear Mode
