[Schematron] selecting mode for generating id's
lars_huttar at sil.org
Fri Sep 19 18:20:29 EDT 2008
I think the request below got buried under other discussions...
Does anybody have suggestions regarding how to select the alternative
On 9/15/2008 4:00 PM, Lars Huttar wrote:
> *Eric van der Vlist* vdv at dyomedea.com
> /wrote on Wed May 30 02:36:27 EDT 2007:/
>> Le mardi 29 mai 2007 à 17:45 +0100, David Carlisle a écrit :
>>> / On 29/05/07, Eric van der Vlist <vdv at dyomedea.com <http://eccnet.eccnet.com/mailman/listinfo/schematron-love-in>> wrote:
>> />/ > Hi,
>> />/ >
>> />/ > Just wondering if anyone has already started to write ISO (X)HTML
>> />/ > Schematron report generators and what people would think about deriving
>> />/ > a microformat from SVRL to do this kind of thing?
>> />/ >
>> />/ There are I believe some changes in the pipeline that would make svrl
>> />/ a useful alternative to the "skeleton" model, where instead of using a
>> />/ modified schematron engine to generate different output formats, you
>> />/ always generate svrl and then style that appropriately, but svrl needs
>> />/ to be able to record all the schematron output before that can
>> />/ really work, see
>> />/ http://eccnet.eccnet.com/pipermail/schematron-love-in/2007-April/000606.html
>> Yes, exactly.
>> There might still be cases where it can be handy to generate a HTML
>> report in a single pass (for instance if you wanted to validate a XML
>> document in a browser using the xml-stylesheet PI).
>> In that case, an approach that seems to be working pretty well is to
>> transform iso-svrl.xsl (using XSLT) into a transformation that produces
>> XHTML span and divs instead of SVRL elements and attributes.
>> />/ > Also, looking back at good old
>> />/ > http://xml.ascc.net/schematron/1.5/report1-5/schematron-frame.html, I
>> />/ > see how handy that was to add node IDs to the report. Unfortunately,
>> />/ > XSLT generate-id() is both implementation and execution dependent, but
>> />/ > we could try to define a simple id mechanism, for instance based on
>> />/ > count(preceding::node()), to identify nodes in the instance documents.
>> />/ >
>> />/ > What do you think?
>> />/ >
>> />/ >
>> />/ the skeleton has some id generatiing templates for exactly that reason.
>> />/ <xsl:comment>MODE: GENERATE-ID-2 </xsl:comment>
>> />/ <xsl:text>
>> />/ </xsl:text>
>> />/ <!-- repeatable-id maker from David Carlisle. -->
>> />/ <!--
>> />/ use this if you need generate IDs in separate passes,
>> />/ because generate-id() is not guaranteed to produce the same
>> />/ results each time. These IDs are well-formed XML NMTOKENS
>> That was exactly what I had in mind, thanks!
> Can someone tell me how to select these alternative id-generating templates?
> I'm getting completely confused.
> I see they work by specifying a mode, but I can't see how to specify
> which mode the generated stylesheet will use.
> Is it specified in something that comes from the *.sch file?
> Or something in iso_schematron_for_saxon.xsl?
> My generated stylesheet contains
> <div class="errors"><ul><h3/><xsl:apply-templates select="/" mode="M2"/></ul>
> And I think I need to change "M2" to "generate-id-2", but how?
> In case it helps, my pipeline that generates the validator stylesheet looks like:
> foo.sch is input to
> iso_dsdl_include.xsl, whose output goes to
> iso_abstract_expand.xsl, whose output goes to
> schematron_report.xsl (which imports iso_schematron_skeleton_for_saxon.xsl)
> The output of this pipeline is used as a stylesheet to validate the XML document.
More information about the Schematron