PDA

View Full Version : XSL Styles


smckillop
03-10-2005, 03:45 PM
I have an XML file that is produced from a software application. My goal is to generate a website based on the information in this file.

I have been able to generate a simple XSL file to produce an HTML output of some of the data. I am planning on creating a lot of different pages using the data from the XML file. The only problem that I'm left with is the prospects of website design changes. Is there any way to encorporate a CSS into the XSL so that if I make a color change, etc to the website, I don't have to go and manually change every XSL? I could potentially have up to 100 XSL pages of different views of the data.

Is there a better way of displaying the XML data on the web? Possibly XHTML? I have been reading information all over the place but I'm a bit lost on what the best way of encorporating XML data into my web design.

The data will be housed on IIS so ASP is an option.

Hopefully I haven't confused everyone.

mindlessLemming
03-11-2005, 02:44 AM
The only problem that I'm left with is the prospects of website design changes. Is there any way to encorporate a CSS into the XSL so that if I make a color change, etc to the website, I don't have to go and manually change every XSL?

Sure, just add a <link> element to the intended output of the XSL file. Then make changes to that CSS file and you're golden :)
You can also add the namespace prefix if you need to...

Your XSL shouldn't be adding any styling anyway, the XSL is for structure (unless you're using XSL-FO for other output formats)

smckillop
03-11-2005, 02:13 PM
Thanks for your help!

I've been creating and working on websites for quite a while now but got really off track when it came to trying to work with this XML data. This is the first time that I've had to use data that someone else (software) has provided to me . Everything else that I've done data related has been done with databases that I've created (Access or SQL) from scratch.

I think I have everything in order now. Although I've decided to use server side ASP. My plan is to process the XML using XSL through an ASP script to output an XHTML page. I am then going to format that returned page using a CSS. My problem for the most part has been trying to get in my head to separate the formatting from the XML data that the XSL returns (As you mention).

I am also going to try my best to conform everything to the XHTML 1.1 standard. This is going to be an adventure!

Thanks again for your help. It's greatly appreciated :thumbsup: