Page 1 of 1
use existing css with xslt transforms? - new user - I don't get it...
Posted: Fri Oct 19, 2012 4:20 am
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.
Re: use existing css with xslt transforms? - new user - I don't get it...
Posted: Fri Oct 19, 2012 12:10 pm
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
Re: use existing css with xslt transforms? - new user - I don't get it...
Posted: Wed Oct 24, 2012 2:02 am
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.
Re: use existing css with xslt transforms? - new user - I don't get it...
Posted: Wed Oct 24, 2012 5:47 pm
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