Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Attaching a style sheet?


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

Recommended Posts

Posted

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

Posted

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

Posted

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

This topic is 6608 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.