[Schematron] selecting mode for generating id's

Lars Huttar lars_huttar at sil.org
Thu Sep 25 01:05:10 EDT 2008


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
>


Thank you!
I was confused by the appearance that

  <a href="schematron-out.html#{{generate-id(.)}}"

seemed to be evaluating generate-id() at the time of generating the validator stylesheet (and therefore in the context of foo.sch), instead of generating code that would evaluate generate-id() later (in the context of the XML document to be validated).

But your example helped me notice the double curly brackets and realize that meant deferred evaluation.

Lars






More information about the Schematron mailing list