Ag-Chieve 1 Posted August 8, 2012 Report 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. Quote Link to post Share on other sites
boen_robot 107 Posted August 8, 2012 Report 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. Quote Link to post Share on other sites
Ag-Chieve 1 Posted August 8, 2012 Author Report 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). Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.