Jump to content

Attaching a style sheet?


Codeus

This topic is 6422 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

<?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

Link to comment
Share on other sites

This topic is 6422 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.