XEP on catalina

<oXygen/> general issues.
catterall
Posts: 57
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

XEP on catalina

Post by catterall » Sun Jun 20, 2021 4:14 pm

Just moved from linux to catalina. oXygen 23.1 and XEP loaded OK, Preferences...FO processor accepts XEP OK. Use fop to PDF works OK But XEP to PDF dies "can't open xep" xep sets JAVA_HOME to jdk 16.0.1
Is this an oxygen, xep or macos problem, or just something I haven't done right?

catterall
Posts: 57
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Re: XEP on catalina - more info

Post by catterall » Sun Jun 20, 2021 4:32 pm

Code: Select all

The process 'XEP' ended with code: -1234567.
The error was: 
Cannot run program "/Users/ron/XEP/xep" (in directory "/Applications/Oxygen XML Editor"): error=2, No such file or directory
java.io.IOException: Cannot run program "/Users/ron/XEP/xep" (in directory "/Applications/Oxygen XML Editor"): error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:620)
	at ro.sync.cmdline.k.bb(Unknown Source)
	at ro.sync.exml.editor.xmleditor.hc.tze(Unknown Source)
	at ro.sync.exml.editor.xmleditor.hc.oze(Unknown Source)
	at ro.sync.exml.editor.xmleditor.hc.lye(Unknown Source)
	at ro.sync.exml.editor.xmleditor.hc.jxe(Unknown Source)
	at ro.sync.exml.editor.xmleditor.hc.txe(Unknown Source)
	at ro.sync.exml.editor.xmleditor.hc$4.zgk(Unknown Source)
	at ro.sync.ui.application.lb.run(Unknown Source)
Caused by: java.io.IOException: error=2, No such file or directory
--------------------
ron@Ronalds-MacBook-Pro XEP % cd /Users/ron/XEP
ron@Ronalds-MacBook-Pro XEP % ls
doc		hyphen		license.xml	rolemap.xml	xep
examples	images		readme.txt	validate	xep.xml
fonts		lib		releaseinfo.txt	x4u
ron@Ronalds-MacBook-Pro XEP % ls -l xep
-rwxr-xr-x  1 ron  staff  438 19 Jun 15:21 xep
ron@Ronalds-MacBook-Pro XEP % cat xep
#!/bin/sh

# XEP command-line

JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home"
XEP_HOME="/Users/ron/XEP"

CP="$JAVA_HOME/lib/tools.jar:\
$XEP_HOME/lib/xep.jar:\
$XEP_HOME/lib/saxon6.5.5/saxon.jar:\
$XEP_HOME/lib/saxon6.5.5/saxon-xml-apis.jar:\
$XEP_HOME/lib/xt.jar"

"$JAVA_HOME/bin/java" \
	-classpath "$CP" \
	"-Dcom.renderx.xep.CONFIG=$XEP_HOME/xep.xml" \
	com.renderx.xep.XSLDriver "$@" 

ron@Ronalds-MacBook-Pro XEP % ls -l /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java
-rwxr-xr-x  1 root  wheel  28576 26 Mar 12:32 /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java
ron@Ronalds-MacBook-Pro XEP %

Radu
Posts: 7592
Joined: Fri Jul 09, 2004 5:18 pm

Re: XEP on catalina

Post by Radu » Tue Jun 22, 2021 8:11 am

Hi,

After the transformation fails there should be an "XEP" console tab view at the bottom of Oxygen showing exactly the command line Oxygen used to run XEP, something like:

Code: Select all

Started: /Users/.../XEP/xep -fo "/Users/...../samples/fo/Basic Font Attributes/bold.fo_fo" -pdf "/Users/..../samples/fo/Basic Font Attributes/bold.pdf"
......
Probably in this case the "xep" file being more of a script, it needs to be run using something like "sh xep", so in the Oxygen Preferences=>"XML / PDF Output / FO Processors" page you can try to edit the "XEP" entry in the "External FO Processors" list and prepend a "sh" to the command line Oxygen executes.
Other than that maybe the "xep" needs to have additional changes inside, maybe change the path it uses to identify the Java Home.
For starters you can try to make this work from the Mac Terminal.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

catterall
Posts: 57
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Re: XEP on catalina

Post by catterall » Tue Jun 22, 2021 5:35 pm

Hi Radu
Thanks for the suggestions

I tried the sh xep but same problem occurs

I checked the directory in xep this does point to the correct java
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home"
ron@Ronalds-MacBook-Pro XEP % ls -l /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java
-rwxr-xr-x 1 root wheel 28576 26 Mar 12:32 /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java

running xep from terminal seems to start OK - expects and accepts xml like <book> and </book>
so it doesn't look like a java incompatibility issue between RenderX and latest java /jdk in MacOS 10.15.7

my terminal test script:
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home"
XEP_HOME="/Users/ron/XEP"
CP="$JAVA_HOME/lib/tools.jar:\
$XEP_HOME/lib/xep.jar:\
$XEP_HOME/lib/saxon6.5.5/saxon.jar:\
$XEP_HOME/lib/saxon6.5.5/saxon-xml-apis.jar:\
$XEP_HOME/lib/xt.jar"
"$JAVA_HOME/bin/java" \
-classpath "$CP" \
"-Dcom.renderx.xep.CONFIG=$XEP_HOME/xep.xml" \
com.renderx.xep.XSLDriver "$@"


Same setup all works OK on Linux (CentOS 8 stream)

Radu
Posts: 7592
Joined: Fri Jul 09, 2004 5:18 pm

Re: XEP on catalina

Post by Radu » Wed Jun 23, 2021 8:07 am

Hi,

One more problem the "xep" script seems to have is that it uses Windows-style line separators (\r\n) instead of Linux style separators (\n).
You can go to the Oxygen Preferences->"Global", uncheck the "Detect line separator on open" checkbox, set the "Line separator" combo box to "Unix-like", save the settings, then open the "xep" script in Oxygen, make a small change to it, then save to force using unix-style line separators in the entire file.
As an extra check, in the Oxygen "XML / PDF Output / FO Processors" preferences page if you edit the "XEP" engine from the "External FO Processors" list, it should have a command line something like:

Code: Select all

sh /Users/path/to/XEP/xep -fo ${fo} -${method} ${out}
After I do both of these fixes things work on my side.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

catterall
Posts: 57
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Re: XEP on catalina

Post by catterall » Wed Jun 23, 2021 5:49 pm

Hi Radu

Thanks again.    I’ve tried your suggestions, but no luck.
_____________________

xep has \n line terminators - checked: no \r\n, all lines end \n
(Did you have a Windows version?)
_____________________

Xep exists
ron@Ronalds-MacBook-Pro ~ % ls -l /Users/ron/XEP/xep
-rwxr-xr-x    1 ron    staff    438 19 Jun 15:21 /Users/ron/XEP/xep
_________________

XEP command line in FO Processors
sh /Users/ron/XEP/xep -fo ${fo} -${method} ${out}
(I put the sh in - shouldn’t be necessary)
_________________

I have xep 4.30 - latest
ron@Ronalds-MacBook-Pro ~ % cat /Users/ron/XEP/xep
#!/bin/sh

# XEP command-line

JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home"
XEP_HOME="/Users/ron/XEP"

CP="$JAVA_HOME/lib/tools.jar:\
$XEP_HOME/lib/xep.jar:\
$XEP_HOME/lib/saxon6.5.5/saxon.jar:\
$XEP_HOME/lib/saxon6.5.5/saxon-xml-apis.jar:\
$XEP_HOME/lib/xt.jar"

"$JAVA_HOME/bin/java" \
-classpath "$CP" \
"-Dcom.renderx.xep.CONFIG=$XEP_HOME/xep.xml" \
com.renderx.xep.XSLDriver "$@"

ron@Ronalds-MacBook-Pro ~ %
_____________________

Java ref in xep looks correct
ron@Ronalds-MacBook-Pro ~ % ls -l /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java
-rwxr-xr-x    1 root    wheel    28576 26 Mar 12:32 /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java
ron@Ronalds-MacBook-Pro ~ %
_________________

Transfer scenario is DocBook PDF - copy
XML URL: ${currentFileURL}
XSP URL: ${frameworks}/docbook/xsl/fo/docbook_custom.xsl
_____________________

Try a transformation - the XEP console messages are:

Started: sh /Users/ron/XEP/xep -fo /Users/ron/Desktop/Scorpio/scorpio.xml_xslt -pdf /Users/ron/Desktop/Scorpio/out/pdf/scorpio.pdf
/Users/ron/XEP/xep: line 2: : command not found
/Users/ron/XEP/xep: line 4: : command not found
/Users/ron/XEP/xep: line 7: : command not found
/Users/ron/XEP/xep: line 13: : command not found
/Users/ron/XEP/xep: line 14: /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java: No such file or directory
/Users/ron/XEP/xep: line 15: -classpath: command not found
/Users/ron/XEP/xep: line 16: -Dcom.renderx.xep.CONFIG=/Users/ron/XEP/xep.xml: No such file or directory
/Users/ron/XEP/xep: line 17: com.renderx.xep.XSLDriver: command not found
/Users/ron/XEP/xep: line 18: : command not found
Process ended with exit code: 127

Seems to have found the correct xep and identifies the lines BUT why ‘command not found?

Radu
Posts: 7592
Joined: Fri Jul 09, 2004 5:18 pm

Re: XEP on catalina

Post by Radu » Thu Jun 24, 2021 6:57 am

Hi,

I get exactly the same problems "xep" on my side because of the \r\n line separators. And yes, I am using the XEP kit for Mac OS. After I switch the file to using only "\n" the publishing starts working.
In the Oxygen Tools menu there is a "Hex Viewer" application, if you use it to open the "xep" script and look through it, are the line separators encoded as "0D 0A" or as "0A"? They should be the latter.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

catterall
Posts: 57
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Re: XEP on catalina

Post by catterall » Thu Jun 24, 2021 5:40 pm

First
bbedit hexdump showed xep was all 0A - no 0D0A
sublime found \n but could not find \r\n
but oxygen hexdump showed 0D0A when I opened it in oxygen
Is oxygen re-setting the line endings?

I followed your instructions:
>Oxygen Preferences->"Global", uncheck the "Detect line separator on open" checkbox, set the "Line separator" combo box to "Unix-like", save the settings, then open the "xep" script in Oxygen, make a small change to it, then save to force using unix-style line separators>
and now transformation to a non-exiting lpp.pdf file went to completion OK with Transformation successful
Second:
But I got a new error:
The file "lpp.pdf" could not be opened. It may be damaged or use a file format that Preview doesn't recognise.
The file lpp.pdf file is created and file lpp.pdf gives
XML 1.0 document text, UTF-8 Unicode text
and head gives:
ron@Ronalds-MacBook-Pro ~ % head git/lpp/PDFout/lpp.pdf
<?xml version="1.0" encoding="UTF-8"?>
<?xep-pdf-drop-unused-destinations false?>
<xep:document xmlns:xep="http://www.renderx.com/XEP/xep" producer="XEP 4.30.961" creator="DocBook XSL Stylesheets V1.79.2" author="Ron Catterall   " title="Lone Pine Pendle">
<xep:internal-bookmark label="Lone Pine Pendle" font-style="normal" font-weight="400" id="1" parent-id="0" collapse-subtree="true" destination-id="LonePinePendle" destination="1" destination-x="40500" destination-y="506970">
<xep:gray-color gray="0.0"/>
</xep:internal-bookmark>
<xep:internal-bookmark label="Table of Contents" font-style="normal" font-weight="400" id="2" parent-id="0" collapse-subtree="false" destination-id="toc...LonePinePendle" destination="5" destination-x="40500" destination-y="506970">
<xep:gray-color gray="0.0"/>
</xep:internal-bookmark>

Any idea what this poblem is?

Ron

Radu
Posts: 7592
Joined: Fri Jul 09, 2004 5:18 pm

Re: XEP on catalina

Post by Radu » Mon Jun 28, 2021 8:03 am

Hi Ron,

Our hexviewer is a simple application which looks directly at the file contents in bytes as it is present on disk.
I'm glad you got over the first problem, about the second problem maybe you can ask somebody from XEP. Maybe you can also notify them that the "xep" contain Windows-like line separators.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply