How to validate XSLT 3.0 stylesheet with xsl:use-package?

Here should go questions about transforming XML with XSLT and FOP.
tmakita
Posts: 69

How to validate XSLT 3.0 stylesheet with xsl:use-package?

Fri Apr 07, 2017 7:10 pm

Hello,

oXygen 19 supports Saxon-EE 9.7.0.15 XSLT processor as external add-on. Today I tried to compile following stylesheets by constructing new project.

[package-020-includeC.xsl]

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:pkg="urn:use-me"
    version="3.0">
   
    <!-- testing using a pkg (twice), the used pkg contains two functions which do nothing -->
    <xsl:use-package name="urn:use-me" package-version="*"  >
        <xsl:accept component="function" names="pkg:function1" visibility="public" />
    </xsl:use-package>
   
    <xsl:template match="second-child">
        <xsl:value-of select="pkg:function1()" />
    </xsl:template>
   
</xsl:stylesheet>


[package-021-used.xsl]

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:package
    package-version="0.1"
    name="urn:use-me"
    xmlns:me="urn:use-me"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="3.0">
   
    <!-- private to a package -->
    <xsl:mode on-no-match="fail" />
   
    <xsl:function name="me:function1" visibility="public" >You found me!</xsl:function>
    <xsl:function name="me:function2" visibility="public" />
   
</xsl:package>


But default validation reports the following error message:

Code: Select all

System ID: C:\Users\toshi\OneDrive\Documents\study\xslt\20170407\package-020-includeC.xsl
Main validation file: C:\Users\toshi\OneDrive\Documents\study\xslt\20170407\package-020-includeC.xsl
Scenario name: XSLT
Document type: XSLT
Engine name: Saxon-EE 9.7.0.15 (External)
Severity: error
Description: Errors were reported during stylesheet compilation

System ID: C:\Users\toshi\OneDrive\Documents\study\xslt\20170407\package-020-includeC.xsl
Main validation file: C:\Users\toshi\OneDrive\Documents\study\xslt\20170407\package-020-includeC.xsl
Scenario name: XSLT
Document type: XSLT
Engine name: Saxon-EE 9.7.0.15 (External)
Severity: fatal
Description: Package urn:use-me could not be found
Start location: 8:62

System ID: C:\Users\toshi\OneDrive\Documents\study\xslt\20170407\package-020-includeC.xsl
Main validation file: C:\Users\toshi\OneDrive\Documents\study\xslt\20170407\package-020-includeC.xsl
Scenario name: XSLT
Document type: XSLT
Engine name: Saxon-EE 9.7.0.15 (External)
Severity: fatal
Description: Cannot find a matching 0-argument function named {urn:use-me}function1()
Start location: 13:0

System ID: C:\Users\toshi\OneDrive\Documents\study\xslt\20170407\package-020-includeC.xsl
Main validation file: C:\Users\toshi\OneDrive\Documents\study\xslt\20170407\package-020-includeC.xsl
Scenario name: XSLT
Document type: XSLT
Engine name: Saxon-EE 9.7.0.15 (External)
Severity: fatal
Description: No function function1 exists in the used package
Start location: 9:86


I noticed that xsl:use-package/@name is defined as URI. So I made the following catalog file and assigned to this project via Options>Preference menu.

[catalog.xml]

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <group>
        <system systemId="urn:use-me" uri="package-021-used.xsl"/>
    </group>
    <group>
        <uri name="urn:use-me" uri="package-021-used.xsl"/>
    </group>
</catalog>


But the validation result did not change at all.
Does anyone succeed with validating XSLT 3.0 stylesheet containing xsl:use-package in oXygen IDE?

Any suggestions are welcome.

Regards,
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
alex_jitianu
Posts: 600

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Tue Apr 11, 2017 10:32 am

Hello,

Thank you for reporting this issue. I did some research and it looks like the only way one can load packages into Saxon is through these two methods:
Packages must be explicitly loaded into a configuration, for example by use of the -pack option on the command line or by the method XsltCompiler.importPackage().

I would have expected to be able to specify them in the Saxon configuration file as well but, unfortunately, that isn't possible. I've logged an issue to Saxonica asking for an alternative way of specifying packages (either through the configuration file or through catalogs)


Best regards,
Alex
tmakita
Posts: 69

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Tue Apr 11, 2017 4:47 pm

Hi Alex,

Thank you for your investigation. I appreciate your help.
According to the link you specified, I made the next build.xml. However Saxon still reports the error.

[build.xml]

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="test.xslt.build">
    <property name="input.file" value="input.xml"/>
    <property name="output.file" value="output.xml"/>
    <property name="xsl.file" value="package-020-includeC.xsl"/>
    <property name="catalog.file" value="catalog.xml"/>
    <java classname="net.sf.saxon.Transform">
        <arg value="-s:${input.file}"/>
        <arg value="-o:${output.file}"/>
        <arg value="-xsl:${xsl.file}"/>
        <arg value="-pack:${catalog.file}"/>
        <arg value="-t"/>
    </java>
</project>


[Result log]

Code: Select all

Buildfile: C:\Users\toshi\OneDrive\Documents\test\xslt\20170407\build.xml
     [java] Saxon-EE 9.7.0.15J from Saxonica
     [java] Java version 1.8.0_121
     [java] Using license serial number K005068
     [java] Using parser org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
     [java] Building tree for file:/C:/Users/toshi/OneDrive/Documents/test/xslt/20170407/catalog.xml using class net.sf.saxon.tree.tiny.TinyBuilder
     [java] Tree built in 16.104526ms
     [java] Tree size: 18 nodes, 0 characters, 4 attributes
     [java] Static error at xsl:use-package on line 8 column 62 of package-020-includeC.xsl:
     [java]   XTSE3000: Package urn:use-me could not be found
     [java] Static error in {pkg:function1()} in expression in xsl:value-of/@select on line 13 column 50 of package-020-includeC.xsl:
     [java]   XPST0017: Cannot find a matching 0-argument function named {urn:use-me}function1()
     [java] Static error at xsl:accept on line 9 column 86 of package-020-includeC.xsl:
     [java]   XTSE3030: No function function1 exists in the used package
     [java] Errors were reported during stylesheet compilation
     [java] Java Result: 2


It is not the problem of oXygen. So I will report this on Saxon mailing list.

Regards,
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
alex_jitianu
Posts: 600

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Tue Apr 11, 2017 5:05 pm

Hello,

According to Saxon's documentation:
The package catalog is an XML document containing package elements, the @href attributes of which are taken as the URLs of package files; if these are relative URLs then they are resolved against the base URI of the package catalog itself. Package names and versions are only defined in the packages themselves - any other decorations within the package catalog are ignored.


So the catalog.xml file must have a special structure, like this:

Code: Select all

<root>
    <package href="package_1.xsl"/>
    <package href="package_2.xsl"/>
</root>


Best regards,
Alex
tmakita
Posts: 69

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Wed Apr 12, 2017 3:12 am

Hi Alex,

Thank you very much for your help!
I will try it.

Regards,
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
markdunn
Posts: 7

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Tue Jul 04, 2017 11:05 am

Saxon 9.8 recognizes a new element <xsltPackages> in a Saxon configuration file.

http://www.saxonica.com/documentation/i ... ation-file

Will Saxon 9.8 be included in the next point release of Oxygen XML Editor?
Radu
Posts: 5088

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Tue Jul 04, 2017 12:29 pm

Hi,

The next release of Oxygen is Oxygen 19.1 which will be available in Autumn 2017.
As it's a minor version we want it as stable as possible so based also on some discussions we had with Michael Kay (Saxon's owner and main developer) we will ship with Oxygen 19.1 the latest Saxon 9.7 available at that time.
Oxygen has an add-on mechanism. If you go to the Oxygen Help menu->Install new add-ons and choose the default add-on update site https://www.oxygenxml.com/InstData/Addons/default/updateSite.xml, you can find add-ons for various Saxon versions.
We plan in a week or so to release also an add-on for Saxon 9.8. So basically you will be able to use Saxon 9.8 with both Oxygen 19.0 and 19.1 by installing this add-on. It will work for validation and transformation but it will not work in the "XSLT Debugger" perspective.
I cannot guarantee that the packages support will work better with it, it needs to be tested.

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

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Tue Jul 04, 2017 12:44 pm

I got an error trying to do this:

Invalid update site. Cause: An 'include' failed, and no 'fallback' element was found.

Appears to be referring to this element in the file:

<xi:include href="https://raw.githubusercontent.com/oxygenxml/oxygenxml.cgm.support/master/addon.xml" xpointer="element(/1/1)" xmlns:xi="http://www.w3.org/2001/XInclude"/>
Radu
Posts: 5088

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Tue Jul 04, 2017 1:47 pm

Hi,

Indeed the default add-ons repository xi:includes two more addons we created and host on GitHub:

Code: Select all

             <xi:include href="https://raw.githubusercontent.com/oxygenxml/oxygenxml.cgm.support/master/addon.xml" xpointer="element(/1/1)" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   
             <xi:include href="https://raw.githubusercontent.com/oxygenxml/oxygenxml.xlsx.import/master/addon.xml" xpointer="element(/1/1)" xmlns:xi="http://www.w3.org/2001/XInclude"/>


The add-ons are there and they are defined in public repositories. Do you have some kind of proxy or firewall set up which would restrict Oxygen to connect via HTTP to those GitHub projects?

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

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Tue Jul 04, 2017 2:58 pm

Yes, I'm behind a firewall. It might be unable to validate the site's certificate
Radu
Posts: 5088

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Wed Jul 05, 2017 12:18 pm

Hi,

One thing you could try would be to open in Oxygen (using our File menu->"Open URL" action) the URL https://www.oxygenxml.com/InstData/Addons/default/updateSite.xml and use the "Validate" toolbar button. It should report a warning something like
Include operation failed, ....
in the Errors list. Then right click the problem in the errors list, "Show message" and the dialog which pops up should have a "More details" link which when clicked will show the entire error cause. If you post this in a code block I could maybe find out more about why it fails.

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

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Wed Jul 05, 2017 4:57 pm

Here's the full message I get when following the steps you advised:

Code: Select all

ro.sync.exml.validate.c.r; systemId: https://www.oxygenxml.com/InstData/Addons/default/updateSite.xml; lineNumber: 317; columnNumber: 179; An 'include' failed, and no 'fallback' element was found.
   at ro.sync.exml.validate.c.p.e(Unknown Source)
   at ro.sync.exml.validate.c.p.fatalError(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at ro.sync.exml.validate.c.v.reportError(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.reportError(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.reportFatalError(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.reportFatalError(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.reportFatalError(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.ditang.relaxng.defaults.RelaxDefaultsParserConfiguration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at ro.sync.exml.validate.b.jb.kd(Unknown Source)
   at ro.sync.exml.validate.b.jb.n(Unknown Source)
   at ro.sync.exml.validate.f$1.b(Unknown Source)
   at ro.sync.exml.validate.f$1.run(Unknown Source)
   at ro.sync.exml.validate.f.d(Unknown Source)
   at ro.sync.exml.validate.b.g.d(Unknown Source)
   at ro.sync.exml.editor.validate.p.j(Unknown Source)
   at ro.sync.exml.editor.validate.p.y(Unknown Source)
   at ro.sync.exml.editor.validate.p.z(Unknown Source)
   at ro.sync.exml.editor.validate.p.g(Unknown Source)
   at ro.sync.exml.editor.validate.p$2.b(Unknown Source)
   at ro.sync.ui.application.nb.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException; systemId: https://www.oxygenxml.com/InstData/Addons/default/updateSite.xml; lineNumber: 317; columnNumber: 179; An 'include' failed, and no 'fallback' element was found.
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   ... 29 more
Radu
Posts: 5088

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Thu Jul 06, 2017 8:13 am

Hi Mark,

Sorry to keep bugging you. When you validate the XML there is a warning and an error reported.
I'm interesting on the "More details..." for the warning because it seemed to contain the actual cause of the connection failure.

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

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Thu Jul 06, 2017 10:23 am

It's no problem, I'm happy to supply whatever information you need.

But in this case, my previous note already contains the full message from the "More Details" field.
Radu
Posts: 5088

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Thu Jul 06, 2017 1:53 pm

Hi Mark,

If you use the "Validate" toolbar button on the opened addon.xml, it should report two problems, a warning:

Code: Select all

Include operation failed, reverting to fallback. ....


and an error:

Code: Select all

An 'include' failed, and no 'fallback' element was found..........


I'm interested in you right clicking the warning, using Show Messages and then "More details..." because the "More details" on the warning contains more information than the one for the error.

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

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Thu Jul 06, 2017 2:55 pm

Sorry I misunderstood!

Here's the "More Details" for the *warning*:

Code: Select all

ro.sync.exml.validate.c.r; systemId: https://www.oxygenxml.com/InstData/Addons/default/updateSite.xml; lineNumber: 317; columnNumber: 179; Include operation failed, reverting to fallback. Resource error reading file as XML (href='https://raw.githubusercontent.com/oxygenxml/oxygenxml.cgm.support/master/addon.xml'). Reason: There was a problem establishing the secure HTTPS connection. In case the server you are trying to connect to uses self-signed certificates, read the 'Troubleshooting HTTPS' section from the user manual.
 Full error message: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at ro.sync.exml.validate.c.p.e(Unknown Source)
   at ro.sync.exml.validate.c.p.warning(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at ro.sync.exml.validate.c.v.reportError(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.reportError(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.reportResourceError(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.handleIncludeElement(Unknown Source)
   at org.apache.xerces.xinclude.XIncludeHandler.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.ditang.relaxng.defaults.RelaxDefaultsParserConfiguration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at ro.sync.exml.validate.b.jb.kd(Unknown Source)
   at ro.sync.exml.validate.b.jb.n(Unknown Source)
   at ro.sync.exml.validate.f$1.b(Unknown Source)
   at ro.sync.exml.validate.f$1.run(Unknown Source)
   at ro.sync.exml.validate.f.d(Unknown Source)
   at ro.sync.exml.validate.b.g.d(Unknown Source)
   at ro.sync.exml.editor.validate.p.j(Unknown Source)
   at ro.sync.exml.editor.validate.p.y(Unknown Source)
   at ro.sync.exml.editor.validate.p.z(Unknown Source)
   at ro.sync.exml.editor.validate.p.g(Unknown Source)
   at ro.sync.exml.editor.validate.p$2.b(Unknown Source)
   at ro.sync.ui.application.nb.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException; systemId: https://www.oxygenxml.com/InstData/Addons/default/updateSite.xml; lineNumber: 317; columnNumber: 179; Include operation failed, reverting to fallback. Resource error reading file as XML (href='https://raw.githubusercontent.com/oxygenxml/oxygenxml.cgm.support/master/addon.xml'). Reason: There was a problem establishing the secure HTTPS connection. In case the server you are trying to connect to uses self-signed certificates, read the 'Troubleshooting HTTPS' section from the user manual.
 Full error message: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   ... 28 more
Caused by: ro.sync.net.protocol.http.abstraction.HttpException: There was a problem establishing the secure HTTPS connection. In case the server you are trying to connect to uses self-signed certificates, read the 'Troubleshooting HTTPS' section from the user manual.
 Full error message: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at ro.sync.net.protocol.http.b.d.j(Unknown Source)
   at ro.sync.net.protocol.http.abstraction.n.s(Unknown Source)
   at ro.sync.net.protocol.http.abstraction.n.f(Unknown Source)
   at ro.sync.net.protocol.http.WebdavHttpURLConnection.g(Unknown Source)
   at ro.sync.net.protocol.http.WebdavHttpURLConnection.getInputStream(Unknown Source)
   at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
   at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   ... 22 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at sun.security.ssl.Alerts.getSSLException(Unknown Source)
   at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
   at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
   at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
   at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
   at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
   at sun.security.ssl.Handshaker.processLoop(Unknown Source)
   at sun.security.ssl.Handshaker.process_record(Unknown Source)
   at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
   at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
   at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
   at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
   at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
   at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:185)
   at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.upgrade(PoolingHttpClientConnectionManager.java:369)
   at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:415)
   at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
   at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
   at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
   at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
   at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
   at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
   ... 31 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
   at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
   at sun.security.validator.Validator.validate(Unknown Source)
   at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
   at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
   at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
   ... 49 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
   at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
   at java.security.cert.CertPathBuilder.build(Unknown Source)
   ... 55 more
Radu
Posts: 5088

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Thu Jul 06, 2017 3:28 pm

Hi Mark,

Great, that's what I needed. Somehow the secure HTTP connection Oxygen is trying to establish does not like GitHub's certificate.
Strange that I cannot reproduce the problem on my side though.
Are you using Oxygen standalone or the Oxygen Eclipse plugin? On what platform?
In the Oxygen Help menu there is a "Report Problem" action. Could you report an empty problem description to us? We get also lost of details about your installation in the automatic email that we receive so this might help us figure this out.
By the way, yesterday we made available the Saxon 9.8 add-on at that specific add-on location that it fails to work on your side.
Until we figure this out on our side you can create an XML document somewhere on your disk with the content:

Code: Select all

<extensions xmlns="http://www.oxygenxml.com/ns/extension"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xsi:schemaLocation="http://www.oxygenxml.com/ns/extension http://www.oxygenxml.com/ns/extension/extensions.xsd">
         
<xt:extension xmlns:xt="http://www.oxygenxml.com/ns/extension" id="com.oxygenxml.sdksamples.transformer.Saxon98TransformerPlugin">
    <xt:location href="https://www.oxygenxml.com/InstData/Addons/default/../../../maven/com/oxygenxml/samples/oxygen-sample-plugin-tranformer-saxon-9-8/19.0.0.1/oxygen-sample-plugin-tranformer-saxon-9-8-19.0.0.1-plugin.jar"/>
    <xt:version>19.0.0</xt:version>
    <xt:oxy_version>19.0+</xt:oxy_version>
    <xt:type>plugin</xt:type>
    <xt:author>Oxygen XML Editor</xt:author>
    <xt:name>Saxon 9.8 XSLT and XQuery Transformer</xt:name>
    <xt:description><html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <title>Sample External Saxon 9.8 Transformer plugin</title>
            </head>
            <body>
                <div>
                    <p>This plugin installs an external <a href="http://saxonica.com/products/latest.xml#saxon9-8">Saxon 9.8 XSLT &amp; XQuery processor</a> into &lt;oXygen/&gt;. You will be able to validate and transform XSLT/XQuery with Saxon 9.8. </p>
                    <p style="color:red">Note: Debugging XSLT/XQuery transformations based on this engine is <b>NOT</b> supported. </p>
                </div>
            </body>
        </html>
    </xt:description>
    <xt:license><![CDATA[(c) Syncro Soft , All rights reserved.
This Plug-In is part of the Oxygen XML Software and, as such, is part of the License Agreement governing the Oxygen XML Software.
]]></xt:license>
</xt:extension>
         </extensions>


and then from the Oxygen Help menu->Install new add-on and there is a file chooser button which allows you to choose an add-on update site from your local disk, then choose the newly created local add on XML.

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

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Thu Jul 06, 2017 3:37 pm

I'm using Oxygen XML Editor standalone on Windows 7.

I've submitted a report using "Report problem", linking to this forum thread.
colibrisson
Posts: 5

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Sun Sep 03, 2017 8:28 pm

I'm using <oXygen/> XML Editor 19.0 with Saxon 9.8 add-on.

I would like to use a package in my stylesheet but I Saxon can't find it and issue the following error:

ID Système: C:\Users\colibrisson\Desktop\img package\test.xsl
Fichier de validation principal: C:\Users\colibrisson\Desktop\img package\test.xsl
Nom du scénario: XSLT
Type de document: XSLT
Nom du moteur: Saxon-EE 9.8.0.4 (External)
Gravité: error
Description: Cannot find package img_pkg (version *)

I don't know if it a standard error message, but the package version doesn't seem to be recognized.

The package name is img_pkg and I'm using its 1.0 version. It's declared in Saxon configuration file as below:

Code: Select all

<xsltPackages>
    <package name="img_pkg" version="1.0" sourceLocation="img_package.xsl"/>
  </xsltPackages>


The configuration file and the package are both in the same folder.

Does anybody know where the problem come from?

Many thanks in advance!
colibrisson
Posts: 5

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Mon Sep 04, 2017 9:57 am

Quick update:

I tested the package and the stylesheet with Saxon 9.8 from the command line and everything was working fine.

I also tried to load the stylesheet by adding the -lib option in the transformation scenarios parameters but I got exactly the same error.
adrian
Posts: 2326

Re: How to validate XSLT 3.0 stylesheet with xsl:use-package?

Mon Sep 04, 2017 11:04 am

Hi,

I tested the package and the stylesheet with Saxon 9.8 from the command line and everything was working fine.
How did you run it in the command line? Did you specify the same Saxon configuration file?
Did you set the Saxon configuration file in the Oxygen transformation scenario ("Advanced options" for transformer)?

How are you referring the package in the XSLT?
I tested with

Code: Select all

<xsl:use-package name="img_pkg" package-version="*">
and it works fine for me.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests