Christophe Marchand
2017-05-05 19:22:07 UTC
Hello !
I'm looking for a way to map Xslt 3.0 packages to java naming
conventions, and to our project definitions.
Today, we only have XSLT 2.0, very very few XSLT3, but we are trying to
move to XSLT3.0.
Our projects are maven projects, and to avoid code duplication in Xsl,
we use maven dependencies.
Inside each project we have :
src
main
java
...
xsl
package
directory
tree
file1.xsl
otherTree
file2.xsl
test
java
...
xspec
package
directory
tree
file1.xspec
otherTree
file2.xspec
If file2.xsl needs file1.xsl, it has <xsl:include href="../tree/file1.xsl"/>
If file1 needs a xsl from another project, then it has
<xsl:include href="otherProjectArtifactId:/path/to/other.xsl"/>
And in pom we have a dependency to otherProject, and a maven-plugin
generates a catalog, with a rewrite-uri :
<rewriteURI uriStartString="http://domain.name/groupId/artifactId"
rewritePrefix="src/main/xsl" />
for use-package in the same maven project
and
<rewriteURI uriStartString="otherProjectArtifactId:/"
rewritePrefix="file:/home/xxx/.m2/repository/.../artifactId.jar" />
for other maven projects.
This allow to locate
http://domain.name/groupId/artifactId/package/tree/package2.xsl in
src/main/xsl/package/tree/package2.xsl
This works perfectly, without package-version.
For package-version, I can do some tricky things with artifact version,
but I'm not quite clear on what can be done, or not...
I have some questions on specification and Saxon implementation :
- do many xsl files belong to the same package ?
- How does Saxon 9.7EE resolve package location ?
- Must I compile packages before they are being used ?
- Does package-name resolution is based on URIResolver ? May we still
use catalogs for package-name location ?
Any help, suggestions, comments are welcome.
Best regards,
Christophe
I'm looking for a way to map Xslt 3.0 packages to java naming
conventions, and to our project definitions.
Today, we only have XSLT 2.0, very very few XSLT3, but we are trying to
move to XSLT3.0.
Our projects are maven projects, and to avoid code duplication in Xsl,
we use maven dependencies.
Inside each project we have :
src
main
java
...
xsl
package
directory
tree
file1.xsl
otherTree
file2.xsl
test
java
...
xspec
package
directory
tree
file1.xspec
otherTree
file2.xspec
If file2.xsl needs file1.xsl, it has <xsl:include href="../tree/file1.xsl"/>
If file1 needs a xsl from another project, then it has
<xsl:include href="otherProjectArtifactId:/path/to/other.xsl"/>
And in pom we have a dependency to otherProject, and a maven-plugin
generates a catalog, with a rewrite-uri :
<rewriteURI uriStartString="http://domain.name/groupId/artifactId"
rewritePrefix="src/main/xsl" />
for use-package in the same maven project
and
<rewriteURI uriStartString="otherProjectArtifactId:/"
rewritePrefix="file:/home/xxx/.m2/repository/.../artifactId.jar" />
for other maven projects.
This allow to locate
http://domain.name/groupId/artifactId/package/tree/package2.xsl in
src/main/xsl/package/tree/package2.xsl
This works perfectly, without package-version.
For package-version, I can do some tricky things with artifact version,
but I'm not quite clear on what can be done, or not...
I have some questions on specification and Saxon implementation :
- do many xsl files belong to the same package ?
- How does Saxon 9.7EE resolve package location ?
- Must I compile packages before they are being used ?
- Does package-name resolution is based on URIResolver ? May we still
use catalogs for package-name location ?
Any help, suggestions, comments are welcome.
Best regards,
Christophe