From the course: XML Essential Training (2018)
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
XSLT and CSS - XML Tutorial
From the course: XML Essential Training (2018)
XSLT and CSS
- [Instructor] XSLT and CSS are not mutually exclusive. You can use both in your projects, and we'll see how to do that in this example. So let's open up the files from the previous example, simpletransform.xml and simpletransform.xslt. Let's also open up simpletransform.css. And you'll see here in the CSS file, I'm defining some stylesheets for the body, the h1 tag, and the image in the document. And we'll see the results of this in just a moment. So in the XSL stylesheet, let's add a link to the CSS stylesheet, to the HTML part of the template. So I'll do that here in the head, and I'll write link. And the href is going to be simpletransform.css. All right, so let's save that. So now, when we run the XML transformation and use this stylesheet, the CSS stylesheet will be included in the output because it's being included in the resulting HTML. So let's bring this up in Firefox. Here we go. Once again, I've got to fix that error that I put in here. There we go, save. And let's…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.