October 19, 200619 yr Hi there, I am pretty new to XML / XSL so apologies if this is a dumb question. I have used an XSL file to output data as XML from FMP8 in fmpxmlresult format. The XSL file I am using is this: - <?xml version="1.0" encoding="UTF-8"?> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" exclude-result-prefixes="fmp"> It seems to work ok and produce an output file that looks like this: - <?xml version="1.0" encoding="UTF-8"?> 222 286 242 Quite simple! I want to format the output using a CSS (or XSL) style sheet which I would normally do by adding the following line to the top of the XML file. <?xml-stylesheet type="text/css" href="housepoints.css"?> But if I include that line in my XSL file, it does not appear in the output (XML) file. Can anyone suggest what I am doing wrong here please? Thanks in advance, Codeus
October 19, 200619 yr <?something?> is a processing instruction, and, hence, will be processed by the XSLT processor That's why it does not appear in your XML result. There is a special XSLT command for generating processing instructions, and guess what?, it's called So you need to add the following to your XSLT code type="text/css" href="housepoints.css" See also http://www.dpawson.co.uk/xsl/sect2/N6145.html#d8258e133
October 20, 200619 yr Author Thanks Martin, That hit the spot perfectly. I guessed that it was interpreting my <?something?> command too early but was unaware of the command. Your response saved me a ton of time so thanks again! Codeus
Create an account or sign in to comment