-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rationalizing including file name regularization
- Loading branch information
1 parent
662cc46
commit 054061c
Showing
17 changed files
with
221 additions
and
260 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
src/schema-gen/InspectorXSLT/testing/CURRENT-TEST-MODELS-REFRESH.xpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0" | ||
xmlns:metaschema="http://csrc.nist.gov/ns/metaschema/1.0" type="metaschema:CURRENT-TEST-MODELS-REFRESH" | ||
name="CURRENT-TEST-MODELS-REFRESH"> | ||
|
||
<!-- Purpose: For a given metaschema instance, produces both a viable InspectorXSLT and a viable XSD --> | ||
<!-- Use to refresh artifacts for testing metaschemas --> | ||
<!-- Input: A valid, properly-linked metaschema --> | ||
|
||
<!-- Output: For a metaschema input, produces both an XSD and an InspectorXSLT, together --> | ||
|
||
<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& --> | ||
<p:input port="parameters" kind="parameter"/> | ||
|
||
<!-- For some reason this errors when run on a sequence from Maven (but not in oXygen's older XML Calabash) --> | ||
|
||
<p:option name="targetDir" select="'current'"/> | ||
|
||
<p:input port="METASCHEMA" primary="true" sequence="true"> | ||
<p:document href="tiny_metaschema.xml"/> | ||
<p:document href="computer_metaschema.xml"/> | ||
</p:input> | ||
|
||
|
||
<p:import href="../../METASCHEMA-XSD.xpl"/> | ||
|
||
<p:import href="INSPECTOR-XSLT-TEST.xpl"/> | ||
|
||
|
||
<p:for-each name="iterate"> | ||
<p:iteration-source> | ||
<p:pipe port="METASCHEMA" step="CURRENT-TEST-MODELS-REFRESH"/> | ||
</p:iteration-source> | ||
|
||
<p:variable name="baseURI" select="base-uri(.)"/> | ||
<p:variable name="filepath" select="(replace($baseURI,'[^/]+$',''), $targetDir, replace($baseURI,'(.*/|\.xml$)','') ) => string-join('/')"/> | ||
|
||
<p:identity name="this-metaschema"/> | ||
|
||
<metaschema:METASCHEMA-XSD name="produce-xsd"/> | ||
|
||
<!--<p:sink/>--> | ||
<p:store name="save-xsd" indent="true" encoding="ASCII"> | ||
<p:with-option name="href" select="$filepath || '-schema.xsd'"/> | ||
<p:input port="source"> | ||
<p:pipe port="XSD" step="produce-xsd"/> | ||
</p:input> | ||
</p:store> | ||
|
||
|
||
<metaschema:INSPECTOR-XSLT-TEST name="produce-inspector"> | ||
<p:input port="METASCHEMA"> | ||
<p:pipe port="result" step="this-metaschema"/> | ||
</p:input> | ||
<p:input port="instance"> | ||
<p:inline><X/></p:inline> | ||
</p:input> | ||
<p:input port="parameters"/> | ||
</metaschema:INSPECTOR-XSLT-TEST> | ||
|
||
|
||
<p:store name="save-inspector" indent="true" encoding="ASCII"> | ||
<p:with-option name="href" select="$filepath || '-inspector.xsl'"/> | ||
<p:input port="source"> | ||
<p:pipe port="INT_50_inspector" step="produce-inspector"/> | ||
</p:input> | ||
</p:store> | ||
|
||
|
||
</p:for-each> | ||
|
||
</p:declare-step> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
242 changes: 0 additions & 242 deletions
242
src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema_COMPOSED-metaschema.xml
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
src/schema-gen/InspectorXSLT/testing/refresh-computer-inspector-saxon.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script shows how to use Saxon with only a Maven dependency. | ||
# Unlike other scripts in this folder it does not rely on an external (bash scripting) dependency | ||
# You do need Maven installed.. | ||
|
||
# Fail early if an error occurs | ||
set -Eeuo pipefail | ||
|
||
usage() { | ||
cat <<EOF | ||
Usage: $(basename "${BASH_SOURCE[0]}") [ADDITIONAL_ARGS] | ||
Refreshes current/computer_inspector.xsl | ||
Additional arguments are provided to SaxonHE - see https://www.saxonica.com/documentation11/#!using-xsl/commandline | ||
EOF | ||
} | ||
|
||
if ! [ -x "$(command -v mvn)" ]; then | ||
echo 'Error: Maven (mvn) is not in the PATH, is it installed?' >&2 | ||
exit 1 | ||
fi | ||
|
||
METASCHEMA_SOURCE=computer_metaschema.xml | ||
|
||
XSLT_RESULT=current/computer_metaschema-inspector.xsl | ||
|
||
ADDITIONAL_ARGS=$(echo ${*// /\\ }) | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" | ||
POM_FILE="${SCRIPT_DIR}/../../../../support/pom.xml" | ||
|
||
MAIN_CLASS="net.sf.saxon.Transform" # Saxon defined in pom.xml | ||
|
||
if [ -e "$XSLT_RESULT" ] | ||
then | ||
echo "Deleting prior $XSLT_RESULT ..." | ||
rm -f ./$XSLT_RESULT | ||
fi | ||
|
||
mvn \ | ||
-quiet \ | ||
-f "$POM_FILE" \ | ||
exec:java \ | ||
-Dexec.mainClass="$MAIN_CLASS" \ | ||
-Dexec.args="-xsl:${SCRIPT_DIR}/../../nist-metaschema-MAKE-INSPECTOR-XSLT.xsl -s:\"$METASCHEMA_SOURCE\" -o:\"$XSLT_RESULT\" $ADDITIONAL_ARGS" | ||
|
||
if [ -e "$XSLT_RESULT" ] | ||
then | ||
echo "XSLT written to file $XSLT_RESULT" | ||
fi |
Oops, something went wrong.