^Alan^ said:
Schematron is based on this technique:
http://www.ldodds.com/papers/schematron_xsltuk.html
I'm looking for other examples of this use of XSLT...
I've used this technique recently. In my particular case, the task was
to create an HTML page with color-coded text based on both the values
from an input XML file and an XSLT. For example, let's say the XML file
contained the following:
<?xml version="1.0" encoding="UTF-8"?>
<porridge>
<tempC>37</tempC>
<cooked>true</cooked>
</porridge>
Now imagine that we want to transform this into an HTML file in which
the temperature is color coded; blue for too cold, red for too hot, and
green for just right. Since these temperatures are somewhat subjective,
I needed a way to enter the list of rules. I could have built the rules
directly into a stylesheet, but ultimately I decided to have the rules
in more-or-less human readable XML and then generate the XSLT. Also,
this had the advantage of making it easier to generate an HTML page
which summarized the rules. Here are the transformations:
rules.xml + rules2html.xsl = rules.html
rules.xml + rules2xsl.xsl = rules.xsl
porridge.xml + rules.xsl = porridge.html
If you need more details, or you're stuck on one particular thing, let
me know.
Ed