-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
That revert missed some things, should be fixed now
- Loading branch information
Jelte Jansen
committed
Oct 16, 2018
1 parent
c303f73
commit 69a9572
Showing
7 changed files
with
1,888 additions
and
1,938 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -6,59 +6,21 @@ | |
This is a preprocessor for ISO Schematron, which implements abstract patterns. | ||
It also | ||
* extracts a particular schema using an ID, where there are multiple | ||
schemas, such as when they are embedded in the same NVDL script | ||
* allows parameter substitution inside @context, @test, @select, @path | ||
* experimentally, allows parameter recognition and substitution inside | ||
text (NOTE: to be removed, for compataibility with other implementations, | ||
please do not use this) | ||
schemas, such as when they are embedded in the same NVDL script | ||
* experimentally, allows parameter recognition and substitution inside | ||
text as well as @context, @test, & @select. | ||
This should be used after iso-dsdl-include.xsl and before the skeleton or | ||
meta-stylesheet (e.g. iso-svrl.xsl) . It only requires XSLT 1. | ||
Each kind of inclusion can be turned off (or on) on the command line. | ||
--> | ||
|
||
<!-- | ||
Open Source Initiative OSI - The MIT License:Licensing | ||
[OSI Approved License] | ||
This source code was previously available under the zlib/libpng license. | ||
Attribution is polite. | ||
The MIT License | ||
Copyright (c) 2004-2010 Rick Jellife and Academia Sinica Computing Centre, Taiwan | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
--> | ||
|
||
<!-- | ||
VERSION INFORMATION | ||
2013-09-19 RJ | ||
* Allow macro expansion in @path attributes, eg. for sch:name/@path | ||
2010-07-10 RJ | ||
* Move to MIT license | ||
2008-09-18 RJ | ||
* move out param test from iso:schema template to work with XSLT 1. (Noah Fontes) | ||
<!-- | ||
VERSION INFORMATION | ||
2008-09-18 RJ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tjeb
Contributor
|
||
* move out param test from iso:schema template to work with XSLT 1. (Noah Fontes) | ||
2008-07-29 RJ | ||
* Create. Pull out as distinct XSL in its own namespace from old iso_pre_pro.xsl | ||
|
@@ -78,6 +40,29 @@ VERSION INFORMATION | |
* Original written for old namespace | ||
* http://www.topologi.com/resources/iso-pre-pro.xsl | ||
--> | ||
<!-- | ||
LEGAL INFORMATION | ||
Copyright (c) 2000-2008 Rick Jelliffe and Academia Sinica Computing Center, Taiwan | ||
This software is provided 'as-is', without any express or implied warranty. | ||
In no event will the authors be held liable for any damages arising from | ||
the use of this software. | ||
Permission is granted to anyone to use this software for any purpose, | ||
including commercial applications, and to alter it and redistribute it freely, | ||
subject to the following restrictions: | ||
1. The origin of this software must not be misrepresented; you must not claim | ||
that you wrote the original software. If you use this software in a product, | ||
an acknowledgment in the product documentation would be appreciated but is | ||
not required. | ||
2. Altered source versions must be plainly marked as such, and must not be | ||
misrepresented as being the original software. | ||
3. This notice may not be removed or altered from any source distribution. | ||
--> | ||
<xslt:stylesheet version="1.0" xmlns:xslt="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:iso="http://purl.oclc.org/dsdl/schematron" | ||
|
@@ -100,12 +85,12 @@ VERSION INFORMATION | |
<!-- Normal processing rules --> | ||
<!-- ================================================================================== --> | ||
<!-- Output only the selected schema --> | ||
<xslt:template match="iso:schema" > | ||
<xslt:template match="iso:schema" > | ||
<xsl:if test="string-length($schema-id) =0 or @id= $schema-id "> | ||
<xslt:copy> | ||
<xslt:copy-of select="@*" /> | ||
<xslt:apply-templates mode="iae:go" /> | ||
</xslt:copy> | ||
</xslt:copy> | ||
</xsl:if> | ||
</xslt:template> | ||
|
||
|
@@ -150,7 +135,7 @@ VERSION INFORMATION | |
|
||
|
||
<!-- Suppress uses of abstract patterns --> | ||
<xslt:template match="iso:pattern[@is-a]" mode="iae:go" > | ||
<xslt:template match="iso:pattern[@is-a]" mode="iae:go" > | ||
|
||
<xslt:comment>Start pattern based on abstract <xslt:value-of select="@is-a"/></xslt:comment> | ||
|
||
|
@@ -245,21 +230,20 @@ VERSION INFORMATION | |
<xslt:template mode="iae:do-pattern" match="*"> | ||
<xslt:param name="caller"/> | ||
<xslt:copy> | ||
<xslt:for-each select="@*[name()='test' or name()='context' or name()='select' or name()='path' ]"> | ||
<xslt:for-each select="@*[name()='test' or name()='context' or name()='select']"> | ||
<xslt:attribute name="{name()}"> | ||
<xslt:call-template name="iae:macro-expand"> | ||
<xslt:with-param name="text"><xslt:value-of select="."/></xslt:with-param> | ||
<xslt:with-param name="caller"><xslt:value-of select="$caller"/></xslt:with-param> | ||
</xslt:call-template> | ||
</xslt:attribute> | ||
</xslt:for-each> | ||
<xslt:copy-of select="@*[name()!='test'][name()!='context'][name()!='select'][name()!='path']" /> | ||
<xslt:copy-of select="@*[name()!='test'][name()!='context'][name()!='select']" /> | ||
<xsl:for-each select="node()"> | ||
<xsl:choose> | ||
<!-- Experiment: replace macros in text as well, to allow parameterized assertions | ||
and so on, without having to have spurious <iso:value-of> calls and multiple | ||
delimiting. | ||
NOTE: THIS FUNCTIONALITY WILL BE REMOVED IN THE FUTURE --> | ||
delimiting --> | ||
<xsl:when test="self::text()"> | ||
<xslt:call-template name="iae:macro-expand"> | ||
<xslt:with-param name="text"><xslt:value-of select="."/></xslt:with-param> | ||
|
Oops, something went wrong.
Good morning @tjeb,
I deliberately excluded the converter tool update from the revert. Could you explain why we are not using the most recent version?