use existing css with xslt transforms? - new user - I don't get it...

Oxygen general issues.
BryceS
Posts: 6
Joined: Fri Oct 19, 2012 1:20 am

use existing css with xslt transforms? - new user - I don't get it...

Post by BryceS »

Hi,

I've just started using oxygen xml editor (still on trial licence) to assist with debugging our xslt transforms.
I copied all of one projects related xslt files and an xml file they can work against to their own folder.
I created a new project using this directory.
Now the output from the transform (XHTML tab) shows result but is not using CSS file.
I tried copying CSS from web server to above directory but that doesn't do it.
I couldn't understand what the manual was on about in this regard, maybe cause I'm jumping in at the middle with here is an xml and some xslt -> do the transformation...

How do I utilize our existing CSS file within the xml editor?

(in meantime I have been copying the output file back to the web server to view in a browser)

Regards,
Bryce S.
Costin
Posts: 837
Joined: Mon Dec 05, 2011 6:04 pm

Re: use existing css with xslt transforms? - new user - I don't get it...

Post by Costin »

Hello,

What version of oXygen are you using and what distribution (Eclipse plugin or the standalone application)?

Make sure you have configured an output file in the debugger (or in the transformation scenario that you use to initiate the debugging). Also make sure that the CSS is correctly referred from the output file (it is usually simpler to have them in same folder).

In order to use an existing CSS within the XML editor you should just associate it to the XML file. Open the XML and press the Associate XSLT/CSS Stylesheet toolbar icon (a pin with 3 blue rectangles) or from main menu > Document > XLM Document > Associate XSLT/CSS Stylesheet.... Browse in your file system and pick the CSS to associate. It will insert in the document a processing instruction like this:

Code: Select all

<?xml-stylesheet type="text/css" href="myCSS.css"?>
In case the XML file in discussion is the result of a transformation, then you could just insert the CSS code snippet directly into the XSLT (in the main/root template).
Eg.:

Code: Select all

<xsl:processing-instruction name="xml-stylesheet">type="text/css" href="myCSS.css"</xsl:processing-instruction>
I hope this helps.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
BryceS
Posts: 6
Joined: Fri Oct 19, 2012 1:20 am

Re: use existing css with xslt transforms? - new user - I don't get it...

Post by BryceS »

Hi Costin,

<oXygen/> XML Editor 14.0, build 2012082911.

I added the css's into the xml file (there are 3 in use) with method you showed above.
Top of xml file now looks like:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/css" href="nav.css" title="nav" alternate="no"?>
<?xml-stylesheet type="text/css" href="style.css" title="style" alternate="no"?>
<?xml-stylesheet type="text/css" href="data-new.css" title="hrnzdata-new" alternate="no"?>

But when I run the debugger the output looks unchanged and nothing like our normal webpages so I suspect the css style sheets are still not applied to the output.

Any other suggestions?

(This also seems a very extensive application. Am I using the right product just to debug xslt tranformations of xml to html?)

Regards,
Bryce Stenberg.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: use existing css with xslt transforms? - new user - I don't get it...

Post by adrian »

Hi,

For HTML you have to use:

Code: Select all

<link rel="stylesheet" type="text/css" href="myCSS.css"/>
inside the head element of the HTML document.

The XSLT debugger is available in oXygen XML Editor and oXygen XML Developer.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply