Page 1 of 1
XHTML preview from XSLT-Debugger doesn't use CSS anymore
Posted: Wed Oct 26, 2011 11:57 am
by LWChris
Hello,
I am parsing an XML file into XHTML with an XSL stylesheet. So far I've always been able to use the XHTML preview and the CSS defined in the parsing result used to work in the preview, too. But now it's only black and white text as if the CSS file wasn't found.
Does anybody have an idea whether it's a wrong setting, a known bug or a missing file? As I'm editing within a huge SVN network I could imagine the CSS file's not in the correct folder anymore. Where do I have to relocate it to?
As for the setting I'm about to say it's not the problem, because I've already re-imported settings from a different PC where the CSS is still showing up.
Thanks, Chris
Re: XHTML preview from XSLT-Debugger doesn't use CSS anymore
Posted: Wed Oct 26, 2011 5:04 pm
by adrian
Hello,
Make sure you set an output file in the debugger(Output field in the toolbar). The reference to the CSS file from the XHTML output will be resolved relative to the output file.
If you are debugging a transformation scenario, you can specify the output file name in the the scenario(Document -> Transformation -> Configure Transformation Scenario, Edit), Output tab, Save As field.
I've logged an issue on our bug tracking tool to resolve the CSS relative to the input file if no output is specified. This already works for the XHTML preview of the transformation.
Regards,
Adrian
Re: XHTML preview from XSLT-Debugger doesn't use CSS anymore
Posted: Wed Oct 26, 2011 6:13 pm
by LWChris
adrian wrote:This already works for the XHTML preview of the transformation.
Hello, this is exactly what my problem is about. As the topic title implies I'm not using any transformation scenario at all, only the XHTML preview.
I'm using the "Run" button from the "Debugger control" toolbar:
Please note that only the screenshot the XML and XSL dropdowns are empty, usually those two are filled with the correct files. The output dropdown however is empty and always was empty before. I don't want oXygen to create the files, I just need an easy to check preview.
Thanks,
Chris
Re: XHTML preview from XSLT-Debugger doesn't use CSS anymore
Posted: Thu Oct 27, 2011 11:22 am
by sorin_ristache
Hello,
The XML and XSL combo boxes cannot be empty. They must contain the names of the files that will be parsed by the XSLT transformer, Saxon 6.5.5 in your case.
How is the CSS referenced in the XHTML output fragment: a relative file path, an absolute one? Please give an example of XHTML fragment that specifies a CSS.
If the CSS is specified in the XHTML output with a relative file path then the file path of the CSS will be resolved relative to the file specified in the Output combo box. In a future version of Oxygen a relative file path of a CSS will be resolved relative to the input XML file when the Output box is empty.
Regards,
Sorin
Re: XHTML preview from XSLT-Debugger doesn't use CSS anymore
Posted: Fri Oct 28, 2011 10:04 am
by LWChris
sorin wrote:The XML and XSL combo boxes cannot be empty. They must contain the names of the files that will be parsed by the XSLT transformer, Saxon 6.5.5 in your case.
That's what I said:
LWChris wrote:Please note that only (in) the screenshot the XML and XSL dropdowns are empty, usually those two are filled with the correct files.
I wanted to add the missing "in" but found I could not edit my post as editing posts seems to be disabled in this forum unfortunately.
sorin wrote:How is the CSS referenced in the XHTML output fragment: a relative file path, an absolute one? Please give an example of XHTML fragment that specifies a CSS.
It's a relative path:
Code: Select all
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
sorin wrote:If the CSS is specified in the XHTML output with a relative file path then the file path of the CSS will be resolved relative to the file specified in the Output combo box
... which is empty and always was empty, that's the point.
sorin wrote:In a future version of Oxygen a relative file path of a CSS will be resolved relative to the input XML file when the Output box is empty.
The CSS file is as well in the XSL input file's folder as the XML input file's folder.
I now solved the problem by putting all XSL and XML files and the CSS file into an oXygen project and it somehow works. However I wonder why the CSS file was found before and still is found at the other PC, which doesn't have any transformation scenario or output file specified, either.
Chris
Re: XHTML preview from XSLT-Debugger doesn't use CSS anymore
Posted: Fri Oct 28, 2011 11:14 am
by sorin_ristache
Hi,
LWChris wrote:However I wonder why the CSS file was found before and still is found at the other PC, which doesn't have any transformation scenario or output file specified, either.
If the
Output combo box is empty the relative path of the CSS stylesheet is resolved relative to the working directory of the Oxygen application which is usually the Oxygen install directory. If you set a file path in the
Output box that file path will be used for resolving the relative path.
Regards,
Sorin
Re: XHTML preview from XSLT-Debugger doesn't use CSS anymore
Posted: Wed Nov 16, 2011 11:47 pm
by LWChris
I believe in your knowledge of how the program is implemented, and thanks to the project and because I am now using the output-box it works. But just for the case files, there has never been
- any transformation scenario been defined
- any content in the output-box
- any CSS in folders other than the in- and output folder.
Maybe it was the encoding of the CSS file (ANSI vs. UTF-8 with or without BOM and so on)? Another idea is the folder oXygen was executed from, like whether I open the program from the startmenu or an existing xpr file or whether I change the folder in a file chooser window.
Well, the problem has been solved and the state when everything worked without the output-box filled will probably be never reproducable anymore.
Thank you for your kind help.
Chris
Re: XHTML preview from XSLT-Debugger doesn't use CSS anymore
Posted: Thu Nov 17, 2011 10:31 am
by sorin_ristache
Hello,
LWChris wrote:Another idea is the folder oXygen was executed from, like whether I open the program from the startmenu or an existing xpr file or whether I change the folder in a file chooser window.
Exactly. If you start Oxygen by double clicking on a file located in the same folder as the CSS stylesheet then a relative path in the output of the transformation will be resolved relative to that start folder.
LWChris wrote:Well, the problem has been solved and the state when everything worked without the output-box filled will probably be never reproducable anymore.
Thank you for your kind help.
Please let us know if you run into this or other problems again.
Thank you,
Sorin