Ag-Chieve Posted August 8, 2012 Share Posted August 8, 2012 Hi, I noticed in the tutorials that it explains how to use xslt as stylesheets for an xml document. And while it talks about how to get various components to display depending on what parameters you put on them (being greater than, less than something) or getting them to show up in a table, it doesn't seem to touch on how to actually format the content (like what colour to display the font in). Is changing the font colour of an xml element something I can do with xslt? What I'm trying to do is import xml element contents into an html page (specifically a <div> on an html page) but because the background colour of the page is black, I the font of the element contents needs to be white. So, can I make an xml that links to an xslt that says to change the font to white and then import the xml elements into the html document? Would that work? I realize all this can be difficult to answer without seeing the code and that can be provided if necessary. Thank you. Link to comment Share on other sites More sharing options...
boen_robot Posted August 8, 2012 Share Posted August 8, 2012 You need CSS for that. Or to be more precise, you need to use XSLT to generate HTML, which would in turn reference a CSS file.If you don't know CSS already, check out the CSS tutorial and pracice a little over some plain HTML files before you move on to apply it on an XSLT generated HTML.If you already have an HTML page, you could trigger XSLT from it using JavaScript, and insert the result somewhere on the HTML page. From that point on, the HTML page's CSS will take care for the styling. Link to comment Share on other sites More sharing options...
Ag-Chieve Posted August 8, 2012 Author Share Posted August 8, 2012 Hi, Thanks for the info. I have created some very simple web pages using html and css before. I guess it's trial and error from here (with help from W3, of course). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now