[Schematron] selecting mode for generating id's

Lars Huttar lars_huttar at sil.org
Thu Sep 25 18:01:38 EDT 2008


On 9/25/2008 11:57 AM, Lars Huttar wrote:
> On 9/24/2008 5:57 PM, David Carlisle wrote:
>   
>> 2008/9/24 Lars Huttar <lars_huttar at sil.org <mailto:lars_huttar at sil.org>>
>>
>>     Thanks, that helps.
>>
>>     I guess my next hurdle is that I'm using schematron-report.xsl instead
>>     of iso_svrl.xsl,
>>
>>
>> I'm not sure which versions of the various bits you have (or are 
>> really current)
>>
>>
>>
>> the latest (but old by now) skeleton-based version of 
>> schematron-report that I could see is
>>
>> http://xml.ascc.net/schematron/1.5/report1-5/schematron-report.xsl
>>
>> That uses (as did my original) generate-id(.) to generate ids even 
>> though that isn't really stable
>> to use one of the modes  instead I think all you should need to do is 
>> include a newer skeleton that defines the mode and then change
>>
>>   <a href="schematron-out.html#{{generate-id(.)}}"
>>
>> to
>>
>>    <axsl:veriable name="id">
>>      <axsl:apply-templates mode="generate-id-2" select="."/>
>>    </axsl:variable>
>>   <a href="schematron-out.html#{{$id}}"
>>
>>   
>>
>> and similarly for any other uses of generate-id.
>>
>> David
>>
>>     
>
> P.S.
> Thanks again... I was able to do this successfully and now have a 
> working stylesheet.
>
>   
I spoke too soon.

I didn't notice that schematron-report.xsl was throwing fatal errors 
(yet it still ran...!?).
It throws errors because the imported 
iso_schematron_skeleton_for_saxon.xsl calls the template named process-p 
with a "class" parameter; but schematron-report.xsl overrides the 
process-p template with one that has no "class" parameter.
My fix was to add three more param declarations into the process-p 
template in schematron-report.xsl, in addition to the declaration of 
"icon" that was already there. Similarly, the other templates (except 
"process-prolog") needed some new parameters declared.

> > Do you think this should become a part of the current 
> schematron-report.xsl that you have out there,
> > in order not to generate invalid stylesheets?
>
>
> Probably. The base is shifting a bit though as Rick experiments with 
> new features, which is a good thing, but I suspect that there needs to 
> be a stable version of the iso version before people really fix up the 
> assorted schematron implementations that sit on that.


OK.

Lars




More information about the Schematron mailing list