Re: [docbook-apps] Syntax Highlighting

2007-03-15 Thread Keith Fahlgren

On 3/15/07, Bob Stayton [EMAIL PROTECTED] wrote:

I've used xslthl.jar with 1.72.0 and Saxon 6.5.5.  I think it is the best
approach.


Ah, glad to see that someone got it going.[1] :-)


Can you provide more details on how you are using it?


Yeah, here is my Saxon6.5 attempt:

$ ./highlight-fo.sh -o ch09.fo ch09.xml
/work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl
Making portrait pages on USletter paper (8.5inx11in)
potentially highlighting? false
FOOO!
Error at xsl:apply-templates on line 29 of
file:/work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl:
 The URI java:net.sf.xslthl.ConnectorSaxon6 does not identify an
external Java class
Transformation failed: Run-time errors were reported

$ less highlight-fo.sh
#!/bin/sh
#SAXON=/usr/share/saxon/lib/saxon8.jar
#CP8=/work/tools/keith/scratch/xslthl-cvs/build/classes/net/sf/xslthl/ConnectorSaxon8.class:/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar
OLD_CP=$CLASSPATH
export CLASSPATH=

SAXON=/usr/share/saxon/lib/old/6.5/saxon.jar
CP6=/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar
XSLTHL_CONFIG=/work/tools/docbook/highlighting/xslthl-config.xml
/usr/bin/java -classpath $CP6 -Dxslthl.config=$XSLTHL_CONFIG -Xmx1024m
-jar $SAXON $*
export CLASSPATH=$OLD_CP

$ less /work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl
?xml version=1.0?
xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
   xmlns:fo=http://www.w3.org/1999/XSL/Format;
   xmlns:xslthl=http://xslthl.sf.net;
   xmlns:hl=java:net.sf.xslthl.ConnectorSaxon6
   xmlns:axf=http://www.antennahouse.com/names/XSL/Extensions;
   xmlns:exsl=http://exslt.org/common;
   version=1.0
   exclude-result-prefixes=xslthl exsl hl
 xsl:import href=../docbook-xsl/fo/docbook.xsl/
 !-- cool stuff here --
 xsl:param name=highlight.source select=1/

 xsl:template name=apply-highlighting
   xsl:messagepotentially highlighting? xsl:value-of
select=function-available('hl-highlight')/ /xsl:message
   xsl:choose
 !-- Blow up if you can't highlight--
 xsl:when test=$highlight.source != 0 !--and
function-available('hl:highlight') --
   xsl:variable name=language
 xsl:call-template name=language.to.xslthl
   xsl:with-param name=context select=./
 /xsl:call-template
   /xsl:variable
   xsl:choose
 xsl:when test=$language != ''
   xsl:variable name=content
 xsl:apply-templates/
   /xsl:variable
   xsl:apply-templates select=hl:highlight($language,
exsl:node-set($content))/
 /xsl:when
 xsl:otherwise
   xsl:apply-templates/
 /xsl:otherwise
   /xsl:choose
 /xsl:when
 !-- No syntax highlighting --
 xsl:otherwise
   xsl:apply-templates/
 /xsl:otherwise
   /xsl:choose
 /xsl:template

 xsl:template name=language.to.xslthl
   xsl:param name=context/
   !-- Expand content (to handle e.g. textdata fileref=.../) --
   xsl:variable name=content
 xsl:apply-templates select=$context/node()/
   /xsl:variable
   xsl:messageFOOO! /xsl:message
   xsl:choose
 xsl:when test=$context/@language != ''
   xsl:value-of select=$context/@language/
   /xsl:when
 !-- Files containing / are considered to be XML files --
 xsl:when test=contains($content, 'lt;/')xml/xsl:when
 xsl:otherwise
   xsl:textc/xsl:text
 /xsl:otherwise
   /xsl:choose
 /xsl:template
/xsl:stylesheet


(I tried building a JAR from the CVS repo of XSLTHL and using a Saxon8
Connector described here[1], but that failed in a similar way).




Keith

1. http://sourceforge.net/forum/forum.php?thread_id=1652381forum_id=513404
2. http://sourceforge.net/forum/forum.php?thread_id=1606945forum_id=513404

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[docbook-apps] DocBook and Apple Help

2007-03-15 Thread Jana Volencová
Hello, 

 

does anyone know please whether it is possible to create Apple Help directly 
from DocBook? Or what modifications need to be applied to the current templates 
to generate HTML pages according to Apple Help specifications? 

 

Thank you,

Jana

 



GMC Software Technology
Jana Volencova
Technical Writer
Hořická 283
500 02 Hradec Králové
Czech Republic

Phone:  +420 495 402 043
Fax:  +420 495 402 010
www.gmc.net

 



The information contained in this e-mail is intended only for the individual to 
whom it is addressed. It may contain privileged and confidential information. 
If you have received this message in error or there are any problems, please 
notify the sender immediately and delete the message from your computer. The 
unauthorized use, disclosure, copying or alteration of this message is 
forbidden. GMC Software Technology will not be liable for direct, special, 
indirect or consequential damage as a result of any virus being passed on, or 
arising from alteration of the contents of this message by a third party.

 



image001.gif
Description: image001.gif


Re: [docbook-apps] Syntax Highlighting

2007-03-15 Thread Bob Stayton
Well, I tried your command and it did not work.  When I replaced the -jar 
$SAXON with the classname com.icl.saxon.StyleSheet, it worked. Anyone know 
why that would happen?


Bob Stayton
Sagehill Enterprises
DocBook Consulting
[EMAIL PROTECTED]


- Original Message - 
From: Keith Fahlgren [EMAIL PROTECTED]

To: Bob Stayton [EMAIL PROTECTED]
Cc: apps docbook docbook-apps@lists.oasis-open.org
Sent: Thursday, March 15, 2007 7:47 AM
Subject: Re: [docbook-apps] Syntax Highlighting



On 3/15/07, Bob Stayton [EMAIL PROTECTED] wrote:
I've used xslthl.jar with 1.72.0 and Saxon 6.5.5.  I think it is the 
best

approach.


Ah, glad to see that someone got it going.[1] :-)


Can you provide more details on how you are using it?


Yeah, here is my Saxon6.5 attempt:

$ ./highlight-fo.sh -o ch09.fo ch09.xml
/work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl
Making portrait pages on USletter paper (8.5inx11in)
potentially highlighting? false
FOOO!
Error at xsl:apply-templates on line 29 of
file:/work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl:
 The URI java:net.sf.xslthl.ConnectorSaxon6 does not identify an
external Java class
Transformation failed: Run-time errors were reported

$ less highlight-fo.sh
#!/bin/sh
#SAXON=/usr/share/saxon/lib/saxon8.jar
#CP8=/work/tools/keith/scratch/xslthl-cvs/build/classes/net/sf/xslthl/ConnectorSaxon8.class:/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar
OLD_CP=$CLASSPATH
export CLASSPATH=

SAXON=/usr/share/saxon/lib/old/6.5/saxon.jar
CP6=/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar
XSLTHL_CONFIG=/work/tools/docbook/highlighting/xslthl-config.xml
/usr/bin/java -classpath $CP6 -Dxslthl.config=$XSLTHL_CONFIG -Xmx1024m
-jar $SAXON $*
export CLASSPATH=$OLD_CP

$ less /work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl
?xml version=1.0?
xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
   xmlns:fo=http://www.w3.org/1999/XSL/Format;
   xmlns:xslthl=http://xslthl.sf.net;
   xmlns:hl=java:net.sf.xslthl.ConnectorSaxon6

xmlns:axf=http://www.antennahouse.com/names/XSL/Extensions;
   xmlns:exsl=http://exslt.org/common;
   version=1.0
   exclude-result-prefixes=xslthl exsl hl
 xsl:import href=../docbook-xsl/fo/docbook.xsl/
 !-- cool stuff here --
 xsl:param name=highlight.source select=1/

 xsl:template name=apply-highlighting
   xsl:messagepotentially highlighting? xsl:value-of
select=function-available('hl-highlight')/ /xsl:message
   xsl:choose
 !-- Blow up if you can't highlight--
 xsl:when test=$highlight.source != 0 !--and
function-available('hl:highlight') --
   xsl:variable name=language
 xsl:call-template name=language.to.xslthl
   xsl:with-param name=context select=./
 /xsl:call-template
   /xsl:variable
   xsl:choose
 xsl:when test=$language != ''
   xsl:variable name=content
 xsl:apply-templates/
   /xsl:variable
   xsl:apply-templates select=hl:highlight($language,
exsl:node-set($content))/
 /xsl:when
 xsl:otherwise
   xsl:apply-templates/
 /xsl:otherwise
   /xsl:choose
 /xsl:when
 !-- No syntax highlighting --
 xsl:otherwise
   xsl:apply-templates/
 /xsl:otherwise
   /xsl:choose
 /xsl:template

 xsl:template name=language.to.xslthl
   xsl:param name=context/
   !-- Expand content (to handle e.g. textdata fileref=.../) --
   xsl:variable name=content
 xsl:apply-templates select=$context/node()/
   /xsl:variable
   xsl:messageFOOO! /xsl:message
   xsl:choose
 xsl:when test=$context/@language != ''
   xsl:value-of select=$context/@language/
   /xsl:when
 !-- Files containing / are considered to be XML files --
 xsl:when test=contains($content, 'lt;/')xml/xsl:when
 xsl:otherwise
   xsl:textc/xsl:text
 /xsl:otherwise
   /xsl:choose
 /xsl:template
/xsl:stylesheet


(I tried building a JAR from the CVS repo of XSLTHL and using a Saxon8
Connector described here[1], but that failed in a similar way).




Keith

1. 
http://sourceforge.net/forum/forum.php?thread_id=1652381forum_id=513404
2. 
http://sourceforge.net/forum/forum.php?thread_id=1606945forum_id=513404


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]