on 23.08.2002 19:19 Uhr Joshua Slive ([EMAIL PROTECTED]) wrote:
> Cliff Woolley wrote:
>> On Wed, 21 Aug 2002, Joshua Slive wrote:
>>> Any ideas? Can anyone else recreate this?
>>
>> Yes, I see this exact kind of thing all the time. Very annoying. I
>> hadn't put much thought into it though. Perhaps it has to do with whether
>> you run ./build.sh or ../build.sh?
>
> The nearest I can figure out, the variable definition for relativepath
> gets set correctly for the first doc that is transformed, and then all
> future docs gets the same relativepath. I don't think this is a bug in
> the stylesheet. A "variable" in xslt is really a constant, in the sense
> that it can't be changed; but this should only apply per-file, right?
There is no bug in the stylesheet, but since Ant only loads the stylesheet
one time per <style>-section, the stylesheet doesn't get updated for every
single file. Therefore the relativepath-var in the xsl keeps its value from
the first xml-document. Although this results in faster transforming, it
introduces the described problems when it comes to different path-depths.
> In any case, I'll give this issue another 24 hours to mull around in
> peoples brains, and if nobody comes up with a solution I will revert the
> build.xml how it was a few versions ago: transform each directory
> seperately.
A possible solution would be some additional <style>-sections in which the
path-depth for transforming the docs is restricted to only one depth. Since
we don't have a very complex directory-tree this should be a lot easier to
maintain as the last version of build.xml, where we had to change a lot, to
insert new languages or new directories. Another positive side-effect is the
fact that this should be much faster than loading the stylesheet for every
directory (e.g. ./, ./misc, ./howto, ./developers, ./ssl, ./vhost, ... in
contrast to ./, ./**, ...).
Puuh, I hope this is somewhat understandable...I surely have to improve my
english-skills :-)) If there are any questions, please ask.
Attached a patch to the current CVS HEAD. I tested this thoroughly and it
works very fine for me.
Another thing to mention: while playing with the build-system I spotted a
param named 'relative-path' in every <style>-section. I couldn't find any
reference to it in the stylesheet, so I think this is an oddment of an older
version. I removed it in the attached patch.
BTW: sorry for the late reply on this, but I wasn't at home for the last two
days...*sigh*...
Erik
Index: build.xml
===================================================================
RCS file: /home/cvspublic/site-tools/httpd-docs-build/build.xml,v
retrieving revision 1.5
diff -u -r1.5 build.xml
--- build.xml 19 Aug 2002 17:37:06 -0000 1.5
+++ build.xml 23 Aug 2002 20:36:52 -0000
@@ -68,7 +68,14 @@
destdir="../"
style="../style/manual.en.xsl">
<mapper type="glob" from="*.xml" to="*.html.en" />
- <param name="relative-path" expression="." />
+ <depth min="1" max="1" />
+ <patternset refid="en-allxml" />
+ </style>
+
+ <style basedir="../"
+ destdir="../"
+ style="../style/manual.en.xsl">
+ <mapper type="glob" from="*.xml" to="*.html.en" />
<patternset refid="en-allxml" />
</style>
@@ -77,16 +84,30 @@
destdir="../"
style="../style/manual.ja.xsl">
<mapper type="glob" from="*.xml.ja" to="*.html.ja.jis" />
- <param name="relative-path" expression="." />
+ <depth min="1" max="1" />
<patternset refid="ja.jis-allxml" />
</style>
-
+
+ <style basedir="../"
+ destdir="../"
+ style="../style/manual.ja.xsl">
+ <mapper type="glob" from="*.xml.ja" to="*.html.ja.jis" />
+ <patternset refid="ja.jis-allxml" />
+ </style>
+
<!-- Transform all German documents -->
<style basedir="../"
destdir="../"
style="../style/manual.de.xsl">
<mapper type="glob" from="*.xml.de" to="*.html.de" />
- <param name="relative-path" expression="." />
+ <depth min="1" max="1" />
+ <patternset refid="de-allxml" />
+ </style>
+
+ <style basedir="../"
+ destdir="../"
+ style="../style/manual.de.xsl">
+ <mapper type="glob" from="*.xml.de" to="*.html.de" />
<patternset refid="de-allxml" />
</style>
</target>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]