Referring to the TEI Stylesheets on the web
Hi Council, hi Martin,
the subject is a little misleading, so let me explain the issue (sorry, lengthy again):
Say, you want to build the TEI Guidelines but don’t have the TEI Stylesheets installed/downloaded on your machine. In the Makefile (under TEI/P5) you’ll find the following lines
```
XSL=/usr/share/xml/tei/stylesheet
# If you have not installed the Debian packages, uncomment one
# of the next two lines:
#XSL=../Stylesheets/release/tei-xsl/p5
#XSL=http://www.tei-c.org/stylesheet/release/xml/tei
```
which suggests that you can point to an online resource for the Stylesheets (see the last line of the code snippet).
Yet, that does not work and probably never(!) worked, because in the ant built file (TEI/P5/antbuilder.xml) the stylesheets are called like
```
HI Peter, We could try using the Java task in ant to pass parameters directly to Saxon: (Example from my own project): <java fork="true" classname="net.sf.saxon.Transform" classpath="utilities/saxon9he.jar"> <arg value="-s:xsl/list_images_used.xsl"/> <arg value="-xsl:xsl/list_images_used.xsl"/> <arg value="--suppressXsltNamespaceCheck:on"/> </java> I think this will happily accept a URI (but I haven't tested). Cheers, Martin On 2018-09-15 12:50 AM, Peter Stadler wrote:
Hi Council, hi Martin,
the subject is a little misleading, so let me explain the issue (sorry, lengthy again):
Say, you want to build the TEI Guidelines but don’t have the TEI Stylesheets installed/downloaded on your machine. In the Makefile (under TEI/P5) you’ll find the following lines ``` XSL=/usr/share/xml/tei/stylesheet # If you have not installed the Debian packages, uncomment one # of the next two lines: #XSL=../Stylesheets/release/tei-xsl/p5 #XSL=http://www.tei-c.org/stylesheet/release/xml/tei ``` which suggests that you can point to an online resource for the Stylesheets (see the last line of the code snippet).
Yet, that does not work and probably never(!) worked, because in the ant built file (TEI/P5/antbuilder.xml) the stylesheets are called like ```
https://ant.apache.org/manual/Tasks/style.html – only filenames. URIs can be consumed by the ANT XSLT task, but then we’d need to replace the @style attribute with a nested style element. When using a nested style element (with an appropriate url element), we’re getting in trouble with our current practice which is to only use relative paths (almost) everywhere but without providing a proper scheme. This seems like a whole can of worms and I already tried several things but nothing really worked without rewriting too much code.
Any comments and/or ideas are welcome Peter
Martin, thanks for the input – brilliant as ever! I started rewriting the code but realised that there’s not only `P5/antbuilder.xml` that needs treatment but also `P5/Test/antruntest.xml` and probably others. So it’s going to be a bit more exhausting … Second, while I’m able to rewrite most of it, I’m not sure how to rewrite those conditional parameters. see e.g. ``` <xslt force="yes" style="${XSL}/odds/odd2odd.xsl" in="p5odds.odd" out="p5odds.compiled.xml"> <factory name="net.sf.saxon.TransformerFactoryImpl"/> <param name="lang" expression="${lang}" if="lang"/> <param name="defaultSource" expression="${inputDir}/p5subset.xml"/> <param name="verbose" expression="${verbose}" if="verbose"/> </xslt> ``` that translates to ``` <java fork="true" classname="net.sf.saxon.Transform" classpath="Utilities/lib/saxon9he.jar"> <arg value="-s:p5odds.odd"/> <arg value="-xsl:${XSL}/odds/odd2odd.xsl"/> <arg value="-o:p5odds.compiled.xml"></arg> <arg value="--suppressXsltNamespaceCheck:on"/> <arg value="lang=${lang}"/> <arg value="defaultSource=${inputDir}/p5subset.xml"/> <arg value="verbose=${verbose}"/> </java> ``` except of those @if (at the end of the <param>). Does anyone know how to work around? Best Peter
Am 15.09.2018 um 00:57 schrieb Martin Holmes
: HI Peter,
We could try using the Java task in ant to pass parameters directly to Saxon:
(Example from my own project): <java fork="true" classname="net.sf.saxon.Transform" classpath="utilities/saxon9he.jar"> <arg value="-s:xsl/list_images_used.xsl"/> <arg value="-xsl:xsl/list_images_used.xsl"/> <arg value="--suppressXsltNamespaceCheck:on"/> </java>
I think this will happily accept a URI (but I haven't tested).
Cheers, Martin
On 2018-09-15 12:50 AM, Peter Stadler wrote:
Hi Council, hi Martin, the subject is a little misleading, so let me explain the issue (sorry, lengthy again): Say, you want to build the TEI Guidelines but don’t have the TEI Stylesheets installed/downloaded on your machine. In the Makefile (under TEI/P5) you’ll find the following lines ``` XSL=/usr/share/xml/tei/stylesheet # If you have not installed the Debian packages, uncomment one # of the next two lines: #XSL=../Stylesheets/release/tei-xsl/p5 #XSL=http://www.tei-c.org/stylesheet/release/xml/tei ``` which suggests that you can point to an online resource for the Stylesheets (see the last line of the code snippet). Yet, that does not work and probably never(!) worked, because in the ant built file (TEI/P5/antbuilder.xml) the stylesheets are called like ```
https://ant.apache.org/manual/Tasks/style.html – only filenames. URIs can be consumed by the ANT XSLT task, but then we’d need to replace the @style attribute with a nested style element. When using a nested style element (with an appropriate url element), we’re getting in trouble with our current practice which is to only use relative paths (almost) everywhere but without providing a proper scheme. This seems like a whole can of worms and I already tried several things but nothing really worked without rewriting too much code. Any comments and/or ideas are welcome Peter
Hi Peter, You could use the ant-contrib <if> tag for the conditional parameters. But I think it would be better to have the XSLT handle missing or empty params gracefully. Cheers, Martin On 2018-09-28 07:20 AM, Peter Stadler wrote:
Martin,
thanks for the input – brilliant as ever! I started rewriting the code but realised that there’s not only `P5/antbuilder.xml` that needs treatment but also `P5/Test/antruntest.xml` and probably others. So it’s going to be a bit more exhausting … Second, while I’m able to rewrite most of it, I’m not sure how to rewrite those conditional parameters. see e.g.
``` <xslt force="yes" style="${XSL}/odds/odd2odd.xsl" in="p5odds.odd" out="p5odds.compiled.xml"> <factory name="net.sf.saxon.TransformerFactoryImpl"/> <param name="lang" expression="${lang}" if="lang"/> <param name="defaultSource" expression="${inputDir}/p5subset.xml"/> <param name="verbose" expression="${verbose}" if="verbose"/> </xslt> ```
that translates to ``` <java fork="true" classname="net.sf.saxon.Transform" classpath="Utilities/lib/saxon9he.jar"> <arg value="-s:p5odds.odd"/> <arg value="-xsl:${XSL}/odds/odd2odd.xsl"/> <arg value="-o:p5odds.compiled.xml"></arg> <arg value="--suppressXsltNamespaceCheck:on"/> <arg value="lang=${lang}"/> <arg value="defaultSource=${inputDir}/p5subset.xml"/> <arg value="verbose=${verbose}"/> </java> ``` except of those @if (at the end of the <param>).
Does anyone know how to work around?
Best Peter
Am 15.09.2018 um 00:57 schrieb Martin Holmes
: HI Peter,
We could try using the Java task in ant to pass parameters directly to Saxon:
(Example from my own project): <java fork="true" classname="net.sf.saxon.Transform" classpath="utilities/saxon9he.jar"> <arg value="-s:xsl/list_images_used.xsl"/> <arg value="-xsl:xsl/list_images_used.xsl"/> <arg value="--suppressXsltNamespaceCheck:on"/> </java>
I think this will happily accept a URI (but I haven't tested).
Cheers, Martin
On 2018-09-15 12:50 AM, Peter Stadler wrote:
Hi Council, hi Martin, the subject is a little misleading, so let me explain the issue (sorry, lengthy again): Say, you want to build the TEI Guidelines but don’t have the TEI Stylesheets installed/downloaded on your machine. In the Makefile (under TEI/P5) you’ll find the following lines ``` XSL=/usr/share/xml/tei/stylesheet # If you have not installed the Debian packages, uncomment one # of the next two lines: #XSL=../Stylesheets/release/tei-xsl/p5 #XSL=http://www.tei-c.org/stylesheet/release/xml/tei ``` which suggests that you can point to an online resource for the Stylesheets (see the last line of the code snippet). Yet, that does not work and probably never(!) worked, because in the ant built file (TEI/P5/antbuilder.xml) the stylesheets are called like ```
https://ant.apache.org/manual/Tasks/style.html – only filenames. URIs can be consumed by the ANT XSLT task, but then we’d need to replace the @style attribute with a nested style element. When using a nested style element (with an appropriate url element), we’re getting in trouble with our current practice which is to only use relative paths (almost) everywhere but without providing a proper scheme. This seems like a whole can of worms and I already tried several things but nothing really worked without rewriting too much code. Any comments and/or ideas are welcome Peter
participants (2)
-
Martin Holmes
-
Peter Stadler