OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Re: [Schematron-love-in] ISO Schematron Update (RETRY)

[ Lists Home | Date Index | Thread Index ]

Paul,

there is an xslt (attached) that produces xml output (it imports
skeleton). If you need a customised output then you are actively
encouraged to create your own implementation, at least, thats what we
did (its fairly easy).

Also we use the 1-6 implementation since this fixes a few bugs and
adds some features (let, id/keys, ...)

Regards

Fraser.

On 22/05/06, Paul Spencer <xml-dev-list@boynings.co.uk> wrote:
> Ken,
>
> > >A while back there was some talk of a possible XSLT implementation
> > >being available at some point too ?
> >
> > Works are in progress ... no announcements yet ... sorry for any
> > delay ... the development of implementations is independent of the
> > standardization process.
>
> I have used the old skeleton1-5.xslt. This is extremely useful, but had a
> couple of problems from my point of view. I don't know whether it is useful
> for you to know of these if you are doing a new version.
>
> The first is that I found I had to be very careful on the context of the
> rules to make sure that the right one was run. For example, I might write a
> rule for all elements A, then another for element A when it contained an
> element B. I'm sure you can see the problem - the prioritisation of XSLT
> templates would stop the first rule running if the A in question contained a
> B. The intention was for both to run. The workaround is easy, but it is easy
> to miss the problem, especially as I write my rules as a spreadsheet with a
> context for each rule (easier to review with business people) then create
> the Schematron automatically from that.
>
> The second problem is just the fact that skeleton1-5.xslt produces an HTML
> output. Producing an XML output is much more flexible. Not a problem for me
> to change, but it would be useful if this were the standard as HTML can
> always be produced from this.
>
> Paul Spencer
>
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
>
>
<?xml version="1.0"?>
<!-- Conformance processor for the Schematron XML Schema Language.
	http://www.ascc.net/xml/resource/schematron/schematron.html
 
 Copyright (c) 2001 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.
-->
<!-- Ideas nabbed from schematrons by Francis N., Miloslav N. and David C. -->
<!-- The command-line parameters are:
            diagnose=yes|no  (default is yes) 
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"; xmlns:sch="http://www.ascc.net/xml/schematron";>
	<xsl:import href="skeleton1-5.xsl"/>
	<xsl:param name="diagnose">yes</xsl:param>
	<xsl:param name="block"/>
	<!-- reserved -->
	<xsl:param name="phase">
		<xsl:choose>
			<xsl:when test="//sch:schema/@defaultPhase">
				<xsl:value-of select="//sch:schema/@defaultPhase"/>
			</xsl:when>
			<xsl:otherwise>#ALL</xsl:otherwise>
		</xsl:choose>
	</xsl:param>
	<xsl:template name="process-prolog">
		<axsl:output method="xml" omit-xml-declaration="no" standalone="yes" indent="yes"/>
	</xsl:template>
	<xsl:template name="process-root">
		<xsl:param name="title"/>
		<xsl:param name="contents"/>
		<xsl:param name="schemaVersion"/>
		<!-- unused params: fpi, id, icon, lang, version -->
		<schematron-output title="{$title}" schemaVersion="{$schemaVersion}" phase="{$phase}">
			<xsl:apply-templates mode="do-schema-p"/>
			<xsl:copy-of select="$contents"/>
		</schematron-output>
	</xsl:template>
	<xsl:template name="process-assert">
		<xsl:param name="id"/>
		<xsl:param name="test"/>
		<xsl:param name="role"/>
		<xsl:param name="diagnostics"/>
		<failed-assert id="{$id}" test="{$test}" role="{$role}">
			<axsl:attribute name="location">
				<axsl:apply-templates select="." mode="schematron-get-full-path"/>
			</axsl:attribute>
			<xsl:if test="$diagnose = 'yes'">
				<xsl:call-template name="diagnosticsSplit">
					<xsl:with-param name="str" select="$diagnostics"/>
				</xsl:call-template>
			</xsl:if>
			<text>
				<xsl:apply-templates mode="text"/>
			</text>
		</failed-assert>
	</xsl:template>
	<xsl:template name="process-report">
		<xsl:param name="id"/>
		<xsl:param name="test"/>
		<xsl:param name="role"/>
		<xsl:param name="diagnostics"/>
		<successful-report id="{$id}" test="{$test}" role="{$role}">
			<axsl:attribute name="location">
				<axsl:apply-templates select="." mode="schematron-get-full-path"/>
			</axsl:attribute>
			<xsl:if test="$diagnose = 'yes'">
				<xsl:call-template name="diagnosticsSplit">
					<xsl:with-param name="str" select="$diagnostics"/>
				</xsl:call-template>
			</xsl:if>
			<text>
				<xsl:apply-templates mode="text"/>
			</text>
		</successful-report>
	</xsl:template>
	<xsl:template name="process-diagnostic">
		<xsl:param name="id"/>
		<diagnostic id="{$id}">
			<xsl:apply-templates mode="text"/>
		</diagnostic>
	</xsl:template>
	<xsl:template name="process-rule">
		<xsl:param name="id"/>
		<xsl:param name="context"/>
		<xsl:param name="role"/>
		<fired-rule id="{$id}" context="{$context}" role="{$role}"/>
	</xsl:template>
	<xsl:template name="process-ns">
		<xsl:param name="prefix"/>
		<xsl:param name="uri"/>
		<ns uri="{$uri}" prefix="{$prefix}"/>
	</xsl:template>
	<xsl:template name="process-p">
		<!-- params: pattern, role -->
		<text>
			<xsl:apply-templates mode="text"/>
		</text>
	</xsl:template>
	<xsl:template name="process-pattern">
		<xsl:param name="name"/>
		<active-pattern name="{$name}">
			<xsl:apply-templates mode="do-pattern-p"/>
			<axsl:apply-templates/>
		</active-pattern>
	</xsl:template>
	<xsl:template name="process-message"/>
</xsl:stylesheet>




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS