-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support XSLT 3.0 and other improvements #6
Conversation
that takes a catalog.xml file and processes the XSLT files it contains. XMLCalabash is used to implement the custom Java step.
… etc. This is the term used in XSLT 3.0, and more appropriate than "element".
- For packages, only show public components. - List exposed components from a used package/module in the documentation of the using package/module, with links to the documentation of the used package/module. - The TOC now contains only links to the top-level package/module. - Call a package by it's package name and a module by it's file name, instead of calling them by their file path. - In the TOC use paths relative to the top-level package/module to refer to files.
so that: - A public XSLT with name http://www.daisy.org/pipeline/... results in a documentation file at org/daisy/pipeline/... - A documentation file coming from an XSLT private to a bundle can not overwrite a file coming from another bundle.
Thanks a lot, @bertfrees , that's a large improvement. I need some time to validate this, but I have no doubt this should be Ok. |
Hi guys ! Looks like a really great job @bertfrees ! Maybe I missed something but you add Actually I published a new version of get-xfile-dependencies.xsl here. Might be a good idea to add a dependency to call it: <dependency>
<groupId>org.mricaud.xml</groupId>
<artifactId>xut</artifactId>
<version>0.1.1</version>
</dependency> Then one could resolve new issues directly there (like package ?) I unfortunately don't have time to do it now but I can add an issue if you like. Cheers |
Thanks for having a look! I have to confess that I haven't actually been using XSLT 3.0 yet. In order to do these changes I just read the spec. Yes, to use your xml-utilities dependency sounds like a good idea. Could one of you guys do it please? I know there is the catalogBuilder-maven-plugin, but I haven't used it before, and I don't know if it will break the Gaulois pipeline. I can then make another PR for xml-utilities if you like, with these changes. Are the new attributes, type and package-name, OK? |
@cmarchand can you deal with the xut dependency ? I'm not quite sure about these changes. |
I'm not sure how Saxon solves the package resolving issue. I haven't tried it, but assumed it would just use the system of URIResolvers that is also used to resolve xsl:import. This what the spec says about it:
Anyway, for xsl-doc it should be irrelevant whether the package can be resolved or not, as long as your xsl:use-package contains no xsl:accept with visibility "public" or "final", which we aren't planning to do in DAISY Pipeline. If your xsl:use-package does contain a xsl:accept with visibility "public" or "final", you just have to make sure that the package can be resolved when generating the documentation. Whether I have made a test here. If you want I could move it to this repository. However it doesn't cover xsl:use-package, exactly because we aren't planning to use it in a way that xsl-doc needs to handle it. |
In my opinion, When, in a Java class, you import an external library, you do not generate this external library javadoc. I do agree problem is a little bit different, but I do not agree to generate a package documentation from a XSL that uses this package. Saxon requires, to run a XSL that uses a package, that the package has been loaded previously - in the XsltCompiler via importPackage() method. So, currently, there is no PackageResolver, it's up to Java developer to pre-load package before using it. Or packages can be provided on command line via |
OK thanks for the info regarding Saxon.
This is indeed how we are planning to do it. So it's fine for us to drop the support for xsl:use-package in xsl-doc. I decided to try to support it anyway because in theory it is possible to have a xsl:accept with visibility "public" inside the xsl:use-package. What about ignoring xsl:use-package but raise a warning if needed? <xsl:template match="xsl:use-package">
<xsl:if test="xslt:accept[@visibility=('public','final')]">
<!--
raise warning
-->
</xsl:if>
</xsl:template> |
That sounds a good idea ! For |
Anything else I can do to help here? |
Excuse me, @bertfrees , I've been very busy these last months. I put this task on the top-most of my list, and plan to merge it current next week. |
OK thanks! Let me know if I can do something. |
Did you manage to run successfully all XSpec in maven build ? |
It's a dependency of XMLCalabash.
Maybe I forgot to run them. Trying now... I had to fix something in the POM first (see commit above), but now I'm geting a NullPointerException in the xspec-maven-plugin. The plugin doesn't give me any other information. |
If I update to the latest version of xspec-maven-plugin: <plugin>
<groupId>io.xspec.maven</groupId>
<artifactId>xspec-maven-plugin</artifactId>
<version>1.5.2-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.8.0-5</version>
</dependency>
</dependencies> ... I get further. It seems I broke some tests. I'll update them. |
9b79787
to
82b30f8
Compare
Ok, I get the build work correctly. |
Merged, and published release 1.8. |
Thank you! |
These are some changes I did in order to make the plugin meet our requirements. The main change is the support for XSLT 3.0, which makes it possible to control the visibility of XSLT components, which we need in order to be able to define the public API of our modules.
I still have a list of things that can be improved:
You can disregard the last commit which is specific to DAISY Pipeline.