Skip to content

Commit

Permalink
Merge pull request w3c#9 from ndw/buildfixes
Browse files Browse the repository at this point in the history
Build fixes
  • Loading branch information
ndw authored Dec 3, 2020
2 parents 00070b1 + 6b6b3ed commit 35da6c3
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- run: sudo apt-get update
- run: sudo apt-get dist-upgrade
- run: sudo apt-get install graphviz
- run: sudo apt-get install graphviz tidy

- checkout

Expand Down
28 changes: 16 additions & 12 deletions .circleci/publish-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,38 @@ cd ../..
# available HTML files. (I plan to use this later to generate a pretty
# index page.)
BRANCHTEMP=/tmp/lspec.b.$$.txt
SPECTEMP=/tmp/lspec.b.$$.txt
SPECTEMP=/tmp/lspec.s.$$.txt
rm -f $BRANCHTEMP $SPECTEMP

# This is a crude hack. It assumes branch/$branch/$spec is all there is.
for overview in `find branch -type f -name Overview.html -print`; do
path=`dirname $overview`
path=`dirname $path`
echo `basename $path` >> $BRANCHTEMP
for path in `find branch -type d -print`; do
hfiles=`find $path -maxdepth 1 -name "*.html" -print -quit | wc -l`
if [ $hfiles != 0 ]; then
branch=`dirname $path`
echo `basename $branch` >> $BRANCHTEMP
fi
done

echo "<specifications xml:base='branch/'>" > index.xml
for branch in `cat $BRANCHTEMP | sort | uniq`; do
for overview in `find branch/$branch -type f -name Overview.html -print`; do
path=`dirname $overview`
echo `basename $path` >> $SPECTEMP
for path in `find branch/$branch -type d -print`; do
hfiles=`find $path -maxdepth 1 -name "*.html" -print -quit | wc -l`
if [ $hfiles != 0 ]; then
echo `basename $path` >> $SPECTEMP
fi
done
echo " <branch name='$branch'>" >> index.xml
echo " <branch xml:base='$branch/' name='$branch'>" >> index.xml
for spec in `cat $SPECTEMP | sort | uniq`; do
if [ -d "branch/$branch/$spec" ]; then
echo " <specification name='$spec'>" >> index.xml
for file in `ls -1 branch/$branch/$spec/*.html`; do
echo " <specification xml:base='$spec/' name='$spec'>" >> index.xml
for file in `ls -1 branch/$branch/$spec`; do
echo " <html>`basename $file`</html>" >> index.xml
done
echo " </specification>" >> index.xml
fi
done
echo " </branch>" >> index.xml
done
done
echo "</specifications>" >> index.xml

# Push the changes back to the repo
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ repositories {
mavenCentral()
}

defaultTasks 'publish-xslt-40'
defaultTasks 'publish'

ant.importBuild "specifications/build.xml"

task publish() {
// just a place to hang dependencies
}

["xslt-40"].each { spec ->
["xslt-40", "xpath-functions-40", "xquery-40"].each { spec ->
Task t = task "publish-${spec}"(type: Copy, dependsOn: [spec]) {
into "build/www/${spec}"
from "specifications/${spec}/html"
Expand Down
4 changes: 4 additions & 0 deletions specifications/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<ant dir="xpath-functions-31" antfile="build.xml" target="clean"/>
</target>

<target name="grammar-40" depends="specinit">
<ant dir="grammar-40" antfile="build.xml" target="all"/>
</target>

<target name="xpath-functions-40" depends="specinit">
<ant dir="xpath-functions-40" antfile="build.xml" target="all"/>
</target>
Expand Down
2 changes: 1 addition & 1 deletion specifications/grammar-40/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This buildfile is used to ...
<xmlvalidate file="${grammar-file}"
failonerror="yes" lenient="no" warn="yes"
classname="org.apache.xerces.parsers.SAXParser"
classpath="../lib/xerces.jar">
classpath="../../lib/xercesImpl.jar">
</xmlvalidate>
</target>

Expand Down
2 changes: 1 addition & 1 deletion specifications/xpath-functions-40/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<property name="shortname" value="${generic-shortname}-${this-spec-version-code}"/>
<property name="spec.uri" value="${W3C.TR}/${shortname}/"/>
<property name="spec.xml" value="${src.dir}/${generic-shortname}.xml"/>
<property name="merged-spec.xml" value="${src.dir}/xpath-functions-expanded.xml"/>
<property name="merged-spec.xml" value="${build.dir}/xpath-functions-expanded.xml"/>

<!-- 2008-09-03, Jim: The following property has no meaning at present, -->
<!-- because we do not build errata in the qtspecs tree. Maybe later... -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

<!DOCTYPE spec
SYSTEM "../../../schema/xsl-query.dtd">
<spec id="spec-top" w3c-doctype="rec" status="ext-review"><header><title>XPath and XQuery Functions and Operators 4.0</title><version/><w3c-designation>REC-xpath-functions-40</w3c-designation><w3c-doctype>W3C Editor's Draft</w3c-doctype><pubdate><day>11</day><month>November</month><year>2020</year></pubdate><publoc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2020/REC-xpath-functions-40-20201111/" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">https://www.w3.org/TR/2020/REC-xpath-functions-40-20201111/</loc>
</publoc><altlocs><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2020/REC-xpath-functions-40-20201111/xpath-functions-40.xml" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Specification in XML format using HTML5 vocabulary</loc><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2020/REC-xpath-functions-40-20201111/function-catalog.xml" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">XML function catalog</loc><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2020/REC-xpath-functions-40-20201111/xpath-functions-40-diff.html" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">HTML with change markings relative to version 3.0</loc></altlocs><latestloc doc="XPath and XQuery Functions and Operators 4.0">
<spec id="spec-top" w3c-doctype="rec" status="ext-review"><header><title>XPath and XQuery Functions and Operators 4.0</title><version/><w3c-designation>REC-xpath-functions-40</w3c-designation><w3c-doctype>W3C Editor's Draft</w3c-doctype><pubdate><day>01</day><month>January</month><year>2000</year></pubdate><publoc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2000/REC-xpath-functions-40-20000101/" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">https://www.w3.org/TR/2000/REC-xpath-functions-40-20000101/</loc>
</publoc><altlocs><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2000/REC-xpath-functions-40-20000101/xpath-functions-40.xml" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">Specification in XML format using HTML5 vocabulary</loc><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2000/REC-xpath-functions-40-20000101/function-catalog.xml" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">XML function catalog</loc><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2000/REC-xpath-functions-40-20000101/xpath-functions-40-diff.html" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">HTML with change markings relative to version 3.0</loc></altlocs><latestloc doc="XPath and XQuery Functions and Operators 4.0">
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/xpath-functions-40/" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">https://www.w3.org/TR/xpath-functions-40/</loc>
</latestloc><prevlocs doc="XPath and XQuery Functions and Operators 4.0">
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="https://www.w3.org/TR/2017/PR-xpath-functions-31-20170117/" xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest">https://www.w3.org/TR/2017/PR-xpath-functions-31-20170117/</loc>
Expand Down
1 change: 1 addition & 0 deletions specifications/xpath-functions-40/html/.readme
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make sure this directory exists
1 change: 1 addition & 0 deletions specifications/xpath-functions-40/images/.readme
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make sure this directory exists
11 changes: 6 additions & 5 deletions specifications/xpath-functions-40/src/xpath-functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
<!ENTITY doc.w3c-doctype "rec">
<!ENTITY doc.w3c-doctype-full "Editor's Draft">

<!ENTITY date.day "11">
<!ENTITY date.DD "11">
<!ENTITY date.month "November">
<!ENTITY date.monthnum "11">
<!ENTITY date.year "2020">
<!-- N.B. The date 2000-01-01 is magic, it means "today". -->
<!ENTITY date.day "01">
<!ENTITY date.DD "01">
<!ENTITY date.month "January">
<!ENTITY date.monthnum "01">
<!ENTITY date.year "2000">
<!ENTITY doc.date "&date.year;&date.monthnum;&date.DD;">

<!ENTITY w3c.tr "https://www.w3.org/TR">
Expand Down
4 changes: 2 additions & 2 deletions specifications/xpath-functions-40/style/xpath-functions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ table.data table.index {
</xsl:param>

<xsl:param name="toc.level" select="3"/>

<xsl:template name="finder" xmlns:fos="http://www.w3.org/xpath-functions/spec/namespace" exclude-result-prefixes="fos">
<xsl:variable name="catalog" select="doc('../src/function-catalog.xml')"/>
<xsl:variable name="prefixes" select="('fn', 'array', 'map', 'math', 'op')"/>
Expand Down Expand Up @@ -1218,4 +1218,4 @@ table.data table.index {
</xsl:template>


</xsl:stylesheet>
</xsl:stylesheet>
11 changes: 6 additions & 5 deletions specifications/xquery-40/src/xpath.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
<!ENTITY doc.w3c-doctype "wd">
<!ENTITY doc.w3c-doctype-full "Editor's Draft">

<!ENTITY date.day "11">
<!ENTITY date.DD "11">
<!ENTITY date.month "November">
<!ENTITY date.monthnum "11">
<!ENTITY date.year "2020">
<!-- N.B. The date 2000-01-01 is magic, it means "today". -->
<!ENTITY date.day "01">
<!ENTITY date.DD "01">
<!ENTITY date.month "January">
<!ENTITY date.monthnum "01">
<!ENTITY date.year "2000">
<!ENTITY doc.date "&date.year;&date.monthnum;&date.DD;">

<!ENTITY w3c.tr "https://www.w3.org/TR">
Expand Down
11 changes: 6 additions & 5 deletions specifications/xquery-40/src/xquery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
<!ENTITY doc.w3c-doctype "rec">
<!ENTITY doc.w3c-doctype-full "Editor's Draft">

<!ENTITY date.day "11">
<!ENTITY date.DD "11">
<!ENTITY date.month "November">
<!ENTITY date.monthnum "11">
<!ENTITY date.year "2020">
<!-- N.B. The date 2000-01-01 is magic, it means "today". -->
<!ENTITY date.day "01">
<!ENTITY date.DD "01">
<!ENTITY date.month "January">
<!ENTITY date.monthnum "01">
<!ENTITY date.year "2000">
<!ENTITY doc.date "&date.year;&date.monthnum;&date.DD;">

<!ENTITY w3c.tr "https://www.w3.org/TR">
Expand Down
8 changes: 4 additions & 4 deletions specifications/xslt-40/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@
<!-- ====================================================================== -->

<!-- Overrides internal template -->
<target name="-style-spec" depends="specinit,chk.spec, diagrams, function-streamability-rules"
if="build.spec" unless="spec.exists">
<echo message="Building XSLT 4.0 ..." />
<target name="-style-spec"
depends="specinit, chk.spec, diagrams, function-streamability-rules">
<echo message="Building XSLT 4.0 ... ${pubdate}" />

<!-- XSLT 2.0 -->

<xslt in="${merged-spec.xml}" out="${build.dir}/rendered.xml" style="style/xslt-diff.xsl"
force="yes" classpathref="saxon9.classpath">
<param name="baseline" expression="${baseline}"/>
Expand Down
2 changes: 1 addition & 1 deletion specifications/xslt-40/style/xslt.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<!-- publication date in yyyy-mm-dd format -->
<xsl:param name="date" select="'2000-01-01'"/>
<xsl:variable name="pubdate" as="xs:date" select="if ($date='2000-01-01') then current-date() else xs:date($date)"/>
<xsl:variable name="pubdate" as="xs:date" select="if ($date='2000-01-01') then current-date() else xs:date($date)"/>

<!-- cutoff date for closed issues -->
<xsl:param name="cutoff-date" select="'2005-04-04'"/>
Expand Down
25 changes: 18 additions & 7 deletions style/xmlspec-2016.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -984,13 +984,7 @@

<xsl:apply-templates select="w3c-doctype"/>
<xsl:text> </xsl:text>
<xsl:if test="pubdate/day">
<xsl:apply-templates select="pubdate/day"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates select="pubdate/month"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="pubdate/year"/>
<xsl:apply-templates select="pubdate"/>
</h2>
<dl>
<xsl:apply-templates select="publoc"/>
Expand Down Expand Up @@ -1055,6 +1049,23 @@
<xsl:apply-templates select="revisiondesc"/>
</xsl:template>

<xsl:template match="pubdate">
<xsl:choose>
<xsl:when test="empty(*) or (day='01' and month='January' and year='2000')">
<xsl:sequence select="format-dateTime(current-dateTime(), '[D1] [MNn] [Y0000]')"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="day">
<xsl:apply-templates select="day"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates select="month"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="year"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="revisiondesc">
<!-- suppressed by default -->
</xsl:template>
Expand Down

0 comments on commit 35da6c3

Please sign in to comment.