[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE: Building Complex XML
6/6/02 1:38:53 PM, Nischal Muthana <nischal_muthana@y...> 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|