Getting <oXygen/> to run Calabash to run Saxon with -dtd:off or with catalogs?

I have a XSLT 2.0 stylesheet that uses 'collection()' to open multiple documents and that runs fine from within <oXygen/> 12.1 either because I have 'DTD validation of the source' set to 'off' in my preferences or because Saxon is finding the DTD because I have an <oXygen/> framework for the document type. When I try to execute the stylesheet as part of a XProc pipeline, Calabash gives the error message: E:\path\DTD.dtd (The system cannot find the file specified) where 'DTD.dtd' is the system identifier in the DOCTYPE of the documents, which makes this look a lot like it's a Saxon error message. Is there a way to get <oXygen/> to run Calabash to run Saxon with -dtd:off or with catalogs? FWIW, here's the XProc step: <p:xslt> <p:input port="source"> <p:empty/> </p:input> <p:input port="stylesheet"> <p:document href="../XSLT/test2schematron.xsl"/> </p:input> <p:with-param name="path" select="$path"> <p:empty/> </p:with-param> <p:with-option name="template-name" select="'main'"/> <p:with-option name="version" select="'2.0'"/> </p:xslt> Regards, Tony Graham Tony.Graham@MenteithConsulting.com Director W3C XSL FO SG Invited Expert Menteith Consulting Ltd XML Guild member XML, XSL and XSLT consulting, programming and training Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland Registered in Ireland - No. 428599 http://www.menteithconsulting.com -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- xmlroff XSL Formatter http://xmlroff.org xslide Emacs mode http://www.menteith.com/wiki/xslide Unicode: A Primer urn:isbn:0-7645-4625-2

Hi Tony, You hit a similar problem with the one recently discussed on the xproc list in several threads. There the issue appears when a document is accessed through a p:http-request step. We surely set both an entity resolver and an URI resolver on Calabash and in some circumstances it uses them. However, in some other cases it fails to provide them to Saxon. For more details please see: http://lists.w3.org/Archives/Public/xproc-dev/2011Jan/0004.html I am afraid we cannot do much on our side, the fix should be made in Calabash, either similar with my suggestion or in some other way. Please note that the -dtd:off turns off validation but the parser will still give an error if the DTD is not found. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 2/7/11 7:18 PM, Tony Graham wrote:
I have a XSLT 2.0 stylesheet that uses 'collection()' to open multiple documents and that runs fine from within<oXygen/> 12.1 either because I have 'DTD validation of the source' set to 'off' in my preferences or because Saxon is finding the DTD because I have an<oXygen/> framework for the document type.
When I try to execute the stylesheet as part of a XProc pipeline, Calabash gives the error message:
E:\path\DTD.dtd (The system cannot find the file specified)
where 'DTD.dtd' is the system identifier in the DOCTYPE of the documents, which makes this look a lot like it's a Saxon error message.
Is there a way to get<oXygen/> to run Calabash to run Saxon with -dtd:off or with catalogs?
FWIW, here's the XProc step:
<p:xslt> <p:input port="source"> <p:empty/> </p:input> <p:input port="stylesheet"> <p:document href="../XSLT/test2schematron.xsl"/> </p:input> <p:with-param name="path" select="$path"> <p:empty/> </p:with-param> <p:with-option name="template-name" select="'main'"/> <p:with-option name="version" select="'2.0'"/> </p:xslt>
Regards,
Tony Graham Tony.Graham@MenteithConsulting.com Director W3C XSL FO SG Invited Expert Menteith Consulting Ltd XML Guild member XML, XSL and XSLT consulting, programming and training Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland Registered in Ireland - No. 428599 http://www.menteithconsulting.com -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- xmlroff XSL Formatter http://xmlroff.org xslide Emacs mode http://www.menteith.com/wiki/xslide Unicode: A Primer urn:isbn:0-7645-4625-2
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

On Tue, February 8, 2011 2:31 pm, George Cristian Bina wrote:
You hit a similar problem with the one recently discussed on the xproc list in several threads. There the issue appears when a document is accessed through a p:http-request step. We surely set both an entity resolver and an URI resolver on Calabash and in some circumstances it uses them. However, in some other cases it fails to provide them to Saxon. For more details please see: http://lists.w3.org/Archives/Public/xproc-dev/2011Jan/0004.html
Thanks for your response. I worked around the problem by reworking the XProc to open the files and use them as the source for the transform. My current problem is that though it works inside <oXygen/>, it doesn't work when I try to get <oXygen/> to run Calabash as an external tool using the same XProc (so it can be run from the menu bar instead of having to invoke a transform on a file that usually isn't the current file). With this external tool command: "${oxygenInstallDir}/jre/bin/java.exe" -Dxml.catalog.files="${frameworksDir}/DTD/schema/catalog.xml" -cp "${oxygenInstallDir}/lib/xproc/calabash/calabash.jar"${ps}"${oxygenInstallDir}/lib/saxon9ee.jar"${ps}"${oxygenInstallDir}/lib/resolver.jar"${ps}CatalogManager.properties com.xmlcalabash.drivers.Main -U org.apache.xml.resolver.tools.CatalogResolver XProc/schematron5.xpl path="${pdu}"/Tests schematron=Schematron/testing.sch the beginning of the 'External Tool' output is: Started: "C:\Program Files\Oxygen XML Editor 12/jre/bin/java.exe" -Dxml.catalog.files="C:\Program Files\Oxygen XML Editor 12\frameworks//DTD/schema/catalog.xml" -cp "C:\Program Files\Oxygen XML Editor 12/lib/xproc/calabash/calabash.jar";"C:\Program Files\Oxygen XML Editor 12/lib/saxon9ee.jar";"C:\Program Files\Oxygen XML Editor 12/lib/resolver.jar";CatalogManager.properties com.xmlcalabash.drivers.Main -U org.apache.xml.resolver.tools.CatalogResolver XProc/schematron5.xpl path="file:/E:/Projects/DTD/"/Tests schematron=Schematron/testing.sch java.io.FileNotFoundException: http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) It's failing because it can't find the DTD for XML catalogs. I would have expected it to be able to bootstrap itself with the DTD for catalogs. Regards, Tony Graham Tony.Graham@MenteithConsulting.com Director W3C XSL FO SG Invited Expert Menteith Consulting Ltd XML Guild member XML, XSL and XSLT consulting, programming and training Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland Registered in Ireland - No. 428599 http://www.menteithconsulting.com -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- xmlroff XSL Formatter http://xmlroff.org xslide Emacs mode http://www.menteith.com/wiki/xslide Unicode: A Primer urn:isbn:0-7645-4625-2

Hi Tony, oXygen sets both an URI resolver and an entity resolver on Calabash. In case of a DTD specified in an XML file the parser will try to resolve the DTD through the entity resolver, not through the URI resolver. In your command line you seems to set only the URI resolver with the -U option. Please try setting also the entity resolver, see the -E option. You can set it to the same org.apache.xml.resolver.tools.CatalogResolver class as this implements both the URIResolver and the EntityResolver interfaces. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 2/8/11 5:50 PM, Tony Graham wrote:
On Tue, February 8, 2011 2:31 pm, George Cristian Bina wrote:
You hit a similar problem with the one recently discussed on the xproc list in several threads. There the issue appears when a document is accessed through a p:http-request step. We surely set both an entity resolver and an URI resolver on Calabash and in some circumstances it uses them. However, in some other cases it fails to provide them to Saxon. For more details please see: http://lists.w3.org/Archives/Public/xproc-dev/2011Jan/0004.html
Thanks for your response. I worked around the problem by reworking the XProc to open the files and use them as the source for the transform.
My current problem is that though it works inside<oXygen/>, it doesn't work when I try to get<oXygen/> to run Calabash as an external tool using the same XProc (so it can be run from the menu bar instead of having to invoke a transform on a file that usually isn't the current file).
With this external tool command:
"${oxygenInstallDir}/jre/bin/java.exe" -Dxml.catalog.files="${frameworksDir}/DTD/schema/catalog.xml" -cp "${oxygenInstallDir}/lib/xproc/calabash/calabash.jar"${ps}"${oxygenInstallDir}/lib/saxon9ee.jar"${ps}"${oxygenInstallDir}/lib/resolver.jar"${ps}CatalogManager.properties com.xmlcalabash.drivers.Main -U org.apache.xml.resolver.tools.CatalogResolver XProc/schematron5.xpl path="${pdu}"/Tests schematron=Schematron/testing.sch
the beginning of the 'External Tool' output is:
Started: "C:\Program Files\Oxygen XML Editor 12/jre/bin/java.exe" -Dxml.catalog.files="C:\Program Files\Oxygen XML Editor 12\frameworks//DTD/schema/catalog.xml" -cp "C:\Program Files\Oxygen XML Editor 12/lib/xproc/calabash/calabash.jar";"C:\Program Files\Oxygen XML Editor 12/lib/saxon9ee.jar";"C:\Program Files\Oxygen XML Editor 12/lib/resolver.jar";CatalogManager.properties com.xmlcalabash.drivers.Main -U org.apache.xml.resolver.tools.CatalogResolver XProc/schematron5.xpl path="file:/E:/Projects/DTD/"/Tests schematron=Schematron/testing.sch java.io.FileNotFoundException: http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
It's failing because it can't find the DTD for XML catalogs. I would have expected it to be able to bootstrap itself with the DTD for catalogs.
Regards,
Tony Graham Tony.Graham@MenteithConsulting.com Director W3C XSL FO SG Invited Expert Menteith Consulting Ltd XML Guild member XML, XSL and XSLT consulting, programming and training Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland Registered in Ireland - No. 428599 http://www.menteithconsulting.com -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- xmlroff XSL Formatter http://xmlroff.org xslide Emacs mode http://www.menteith.com/wiki/xslide Unicode: A Primer urn:isbn:0-7645-4625-2
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

On Tue, February 8, 2011 8:20 pm, George Cristian Bina wrote:
oXygen sets both an URI resolver and an entity resolver on Calabash. In case of a DTD specified in an XML file the parser will try to resolve the DTD through the entity resolver, not through the URI resolver. In your command line you seems to set only the URI resolver with the -U option. Please try setting also the entity resolver, see the -E option. You can set it to the same org.apache.xml.resolver.tools.CatalogResolver class as this implements both the URIResolver and the EntityResolver interfaces.
Thanks for that, that helped but wasn't the complete solution. It's now working, but not quite the way that it should. I had to change the DTD's catalog.xml version from 1.1 to 1.0 to get it to work. I also had to add the MathML DTD to the DTD's catalog, whereas inside oXygen, oXygen was resolving it correctly. The Calabash output is full of 'INFO' messages, but oXygen's Calabash doesn't recognise the <cc:log-level> configuration option shown in http://norman.walsh.name/2009/07/22/xmlCatalogsandXProc and http://svn.xmlcalabash.com/calabash/trunk/schemas/configuration.rnc. The current external tool command is: "${oxygenInstallDir}/jre/bin/java.exe" -Dxml.catalog.files="${frameworksDir}/xml/catalog.xml${ps}${frameworksDir}/DTD/schema/catalog.xml" -cp "${oxygenInstallDir}/lib/xproc/calabash/calabash.jar"${ps}"${oxygenInstallDir}/lib/saxon9ee.jar"${ps}"${oxygenInstallDir}/lib/resolver.jar" com.xmlcalabash.drivers.Main -c calabashconfig.xml XProc/test-schematron.xpl path="${pdu}"/Tests schematron=Schematron/testing.sch where 'calabashconfig.xml' is: <cc:xproc-config xmlns:cc="http://xmlcalabash.com/ns/configuration"> <cc:schema-aware>false</cc:schema-aware> <!-- <cc:log-level level="warning"/> --> <cc:serialization omit-xml-declaration="true"/> <cc:entity-resolver class-name="org.apache.xml.resolver.tools.CatalogResolver"/> <cc:uri-resolver class-name="org.apache.xml.resolver.tools.CatalogResolver"/> </cc:xproc-config> Have you considered adding an XProc option in oXygen equivalent to Calabash's: -s, --step-name stepname Run the step named 'stepname' ? Have you considered making the 'Command line' dialog box resizable? When the command gets so long that you have to scroll to see the whole command, it's sometimes easier to copy the command line into another editor to edit it and paste it back to run it. Regards, Tony Graham Tony.Graham@MenteithConsulting.com Director W3C XSL FO SG Invited Expert Menteith Consulting Ltd XML Guild member XML, XSL and XSLT consulting, programming and training Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland Registered in Ireland - No. 428599 http://www.menteithconsulting.com -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- xmlroff XSL Formatter http://xmlroff.org xslide Emacs mode http://www.menteith.com/wiki/xslide Unicode: A Primer urn:isbn:0-7645-4625-2

On Wed, February 9, 2011 10:17 am, Tony Graham wrote: ...
Thanks for that, that helped but wasn't the complete solution. It's now working, but not quite the way that it should.
It's also working differently on Windows and Linux using oXygen 12.1 on both. The Linux command line for the external tool is: "${oxygenInstallDir}/jre/bin/java" -Dxml.catalog.files="${frameworksDir}/xml/catalog.xml${ps}${frameworksDir}/DTD/schema/catalog.xml" -cp "${oxygenInstallDir}/lib/xproc/calabash/calabash.jar"${ps}"${oxygenInstallDir}/lib/saxon9ee.jar"${ps}"${oxygenInstallDir}/lib/resolver.jar" com.xmlcalabash.drivers.Main -U org.apache.xml.resolver.tools.CatalogResolver -E org.apache.xml.resolver.tools.CatalogResolver XProc/test-schematron.xpl path="${pdu}"/Tests schematron=Schematron/testing.sch and the Windows command line is: "${oxygenInstallDir}/jre/bin/java.exe" -Dxml.catalog.files="${frameworksDir}/xml/catalog.xml${ps}${frameworksDir}/DTD/schema/catalog.xml" -cp "${oxygenInstallDir}/lib/xproc/calabash/calabash.jar"${ps}"${oxygenInstallDir}/lib/saxon9ee.jar"${ps}"${oxygenInstallDir}/lib/resolver.jar" com.xmlcalabash.drivers.Main -U org.apache.xml.resolver.tools.CatalogResolver -E org.apache.xml.resolver.tools.CatalogResolver XProc/test-schematron.xpl path="${pdu}"/Tests schematron=Schematron/testing.sch The only difference is the extra '.exe' in the Windows version (and without that sort of trivial difference, I could have half as many external tool definitions). The Windows version works, but the Linux version can't find the DTD because it's looking for it in the same directory as the XML files, which would indicate that the catalog isn't being used. Regards, Tony Graham Tony.Graham@MenteithConsulting.com Director W3C XSL FO SG Invited Expert Menteith Consulting Ltd XML Guild member XML, XSL and XSLT consulting, programming and training Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland Registered in Ireland - No. 428599 http://www.menteithconsulting.com -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- xmlroff XSL Formatter http://xmlroff.org xslide Emacs mode http://www.menteith.com/wiki/xslide Unicode: A Primer urn:isbn:0-7645-4625-2
participants (2)
-
George Cristian Bina
-
Tony Graham