Lists Home |
Date Index |
6/6/02 1:38:53 PM, Nischal Muthana <firstname.lastname@example.org> wrote:
>Thanks for the Reply.
>>What you could do is to process the criteria
>> file by transforming
>> it into an XSLT stylesheet and then executing that
>If I undestand you correctly, you mean to say you want
>me to build an XSLT stylesheet which contains all of
>the criteria table. And then apply on the XML source.
>But dont you think doing this would make the user's
>life difficult in editing the criteria's whenever he
Not quite. What Michael is proposing is that you write the criteria document as an ordinary XML
document in whatever "vocabulary" makes the most sense to the user. Then you would write (one
time) a stylesheet that takes the criteria document as input and outputs *another* stylesheet.
Each time someone edits the criteria table, they'd run a stylesheet processor to do this
transformation. Then whenever your main data changes, you'd run it through the stylesheet
processor against the "compiled" criteria stylesheet, which would do the grading.
Schematically, it would be:
Step 1 (done when criteria change)
Criteria document ------- XSLT --------> Criteria stylesheet
Step 2 (done when data change)
Data document ------ XSLT -------> Graded data document
It's quite similar to validating a document with Schematron, which is implemented in the exact same
way. You write a Schematron rules document and run it through the stylesheet processor with the
standard Schematron stylesheet, which turns the rules into a second stylesheet which, when run
against an instance document, does the validation.
The two key concepts here are:
1) An XSLT stylesheet is an XML document itself, so it can be generated as the output of a
2) Stylesheet processing can be done as a simple text-processing step in which neither a Web server
nor a Web client are involved. You'd use a standalone stylesheet processor like Saxon, the
command-line interface to MSXML, or the like.