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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: RE: [xml-dev] Building Complex XML

[ Lists Home | Date Index | Thread Index ]

6/6/02 1:38:53 PM, Nischal Muthana <nischal_muthana@yahoo.com> wrote:

>Mike
>
>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
>> stylesheet.
>
>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
>wants to. 

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
                    "Compiler" stylesheet

Step 2 (done when data change)

Data document   ------ XSLT ------->  Graded data document
                Criteria stylesheet

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 
stylesheet processor.

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.
 






 

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

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