xslthl not working
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 5
- Joined: Thu Dec 04, 2008 2:50 am
xslthl not working
Hi,
I tried to get syntax highlighting for code in programlistings working today. I downloaded xslthl.zip an put it to disk. I put xslthl.jar to lib directory in oxygen dir. I use saxon6.5.5 and custom fop with my native language fonts.
My transformation scenario has these highlight values set properly I think, but I still have no success with generation nice code
.
xslthl-config is contains this.
I use -current snapshot of docbook-xsl style sheets with snapshot_8394 version number. It is post 1.74.2 build.
I'm trying to highlight this code from my document.
I use oxygen 10.1 with academic license. Do you have any idea what can be wrong or how can I debug it more ?
I tried to get syntax highlighting for code in programlistings working today. I downloaded xslthl.zip an put it to disk. I put xslthl.jar to lib directory in oxygen dir. I use saxon6.5.5 and custom fop with my native language fonts.
Code: Select all
[haad@ ~]$ ls /Users/haad/Opt/xslthl/
LICENSE.txt highlighters xslthl-2.0.1.jar

Code: Select all
highlight.default.language "c"
highlight.source 1
highlight.xslthl.config file:///Users/haad/Opt/xslthl/highlighters/xslthl-config.xml
Code: Select all
<xslthl-config>
<highlighter id="java" file="/Users/haad/Opt/xslthl/highlighters/java-hl.xml" />
<highlighter id="delphi" file="/Users/haad/Opt/xslthl/highlighters/delphi-hl.xml" />
<highlighter id="pascal" file="/Users/haad/Opt/xslthl/highlighters/delphi-hl.xml" />
<highlighter id="ini" file="/Users/haad/Opt/xslthl/highlighters/ini-hl.xml" />
<highlighter id="php" file="/Users/haad/Opt/xslthl/highlighters/php-hl.xml" />
<highlighter id="myxml" file="/Users/haad/Opt/xslthl/highlighters/myxml-hl.xml" />
<highlighter id="m2" file="/Users/haad/Opt/xslthl/highlighters/m2-hl.xml" />
<highlighter id="tcl" file="/Users/haad/Opt/xslthl/highlighters/tcl-hl.xml" />
<highlighter id="c" file="/Users/haad/Opt/xslthl/highlighters/c-hl.xml" />
<highlighter id="cpp" file="/Users/haad/Opt/xslthl/highlighters/cpp-hl.xml" />
<highlighter id="csharp" file="/Users/haad/Opt/xslthl/highlighters/csharp-hl.xml" />
<highlighter id="python" file="/Users/haad/Opt/xslthl/highlighters/python-hl.xml" />
<highlighter id="ruby" file="/Users/haad/Opt/xslthl/highlighters/ruby-hl.xml" />
<highlighter id="perl" file="/Users/haad/Opt/xslthl/highlighters/perl-hl.xml" />
<highlighter id="javascript" file="/Users/haad/Opt/xslthl/highlighters/javascript-hl.xml" />
<namespace prefix="xslthl" uri="http://xslthl.sf.net" />
</xslthl-config>
I'm trying to highlight this code from my document.
Code: Select all
<programlisting language="c">
typedef struct auth_msg {
char msg_path[MAXPATHLEN]; /** Path to application */
uid_t msg_euid; /** Effective user id */
gid_t msg_egid; /** Effective group id */
pid_t msg_pid; /** Process id */
int msg_auth_status; /** Status of message after auth process */
} auth_msg_t;
</programlisting>
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: xslthl not working
Post by sorin_ristache »
Hello,
XSLTHL is enabled by default in the built-in Docbook transformation scenarios of Oxygen 10.1 (the current version). If you want to have syntax highlight in the PDF result or the HTML result of a Docbook transformation just insert your fragment that contains
and apply one of the predefined Docbook scenarios or a scenario created by duplicating a predefined one. Oxygen includes a version of the XSLTHL jar file that works correctly with the Docbook stylesheets and the built-in XSLTHL config file already supports the C language.
Regards,
Sorin
XSLTHL is enabled by default in the built-in Docbook transformation scenarios of Oxygen 10.1 (the current version). If you want to have syntax highlight in the PDF result or the HTML result of a Docbook transformation just insert your fragment that contains
Code: Select all
<programlisting language="c">
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: xslthl not working
Post by sorin_ristache »
Please send your Docbook XML file for which the program listing is not highlighted in the transformation output. What predefined scenario did you try?
Regards,
Sorin
Regards,
Sorin
-
- Posts: 5
- Joined: Thu Dec 04, 2008 2:50 am
Re: xslthl not working
This is my testing xml file.
I'm using Docbook PDF transformation scenario.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article SYSTEM "file:/Users/haad/Opt/docbook-dtd/docbookx.dtd">
<article>
<title>TEST</title>
<section>
<title>test sec</title>
<para>foo</para>
<programlisting language="c">
/* comment */
int main(int argc, char **argv) {
// another c++ comment
int test;
printf("HEllo World\n");
return 0;
}
</programlisting>
</section>
</article>
I'm using Docbook PDF transformation scenario.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: xslthl not working
Post by sorin_ristache »
There is a problem in the stylesheets and we will fix it in version 10.2. Please contact us for telling you how you can fix it in version 10.1.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: xslthl not working
Post by sorin_ristache »
Hello haad,
I replied with a patch that should fix the highlight problem in the transformation output. The patch will be included also in Oxygen version 10.2.
Regards,
Sorin
I replied with a patch that should fix the highlight problem in the transformation output. The patch will be included also in Oxygen version 10.2.
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service