RE: XSL Discussion

Subject: RE: XSL Discussion
From: Fabio Vitali <fabio@xxxxxxxxxxx>
Date: Tue, 24 Feb 1998 20:08:30 +0200
>> First off, I've mentioned in the past that I think a simple separation of
>> the patterns and actions should happen, like:
>> <rule>
>>   <pattern>
>>     <target-element type="p">
>>   </pattern>
>>   <action>
>>     <DIV>
>>       <children/>
>>     </DIV>
>>   </action>
>> </rule>
>>
>	I agree.  This makes it a lot easier to read the rules. The downside
>is that it makes XSL even more verbose than it already is.
>
>> Much of what I'm going to be talking about is based on this...
>>
>> Lets talk about the patterns for a bit.  Maybe it's just a matter of
>> syntax,
>> but I would feel more comfortable writing something like:
>>   <chapter>
>>     <p type="introduction" xml:style="target"/>
>>   </chapter>
>>
>	This was considered and there are still supporters for this syntax.
>The argument against it is that it makes it impossible to write a DTD for
>XSL.  In addition, the <chapter> and <p> are really being used out of
>context in the XSL document.

There is an additional issue to be considered about introducing <action>
and <pattern> tags, that of the official flow objects made available by the
parser.

We are developing an extensible rendering engine for XML. The idea is that
the list of available flow objects is not given by CSS, DSSSL or whatever,
but it is an open list of items, among which the ones in CSS and DSSSL.
This would allow graphic designers and people with special needs (math,
chemistry, music, etc.) to provide special flow objects for their XML
notations and mix them with other text-based flow objects.

Now, since in the current state of the XSL proposal the name of the
available flow objects are elements of the XSL document, any DTD for XSL
would contain a closed list of acceptable flow objects, i.e. the ones
defined in CSS and DSSSL, which would make our project impossible. In fact
we are currently not using any DTD.

What we would hope for is something like:

<rule>
  <target-element type="p">
  <action name="CSS.DIV">
    <attribute name="CSS.font-size" value="14pt"/>
    <attribute name="CSS.font-family" value="serif"/>
    <children/>
  </action>
</rule>

or maybe even:

<rule>
  <target-element type="p">
  <flow name="CSS.DIV">
    <attribute name="CSS.font-size" value="14pt"/>
    <attribute name="CSS.font-family" value="serif"/>
    <children/>
  </flow>
</rule>

Advantages of this approach:

* The list of acceptable flow objects is open. You can allow and mix
CSS.div,DSSSL.paragraph and my_package.my_own_flow_object without modifying
the XSL DTD.
* This syntax is only slightly more verbose than the current one
* Patterns and actions are clearly distinguishable, basically because
actions are. To determine whether a rule should be activated you simply
compute a truth value (or a priority value) on every first-level element of
rule, and the rule has a truth value of the OR of all elements (or a
priority equal to the largest of the priority values of the elements). With
my proposal, having <action> (or <flow>) elements immediately return a
truth value of FALSE and a priority of 0 makes it very easy to verify the
appropriateness of the rule without wasting too much time.

Disadvantages we see:
* The XSL engine has no way to verify the correctness of a CSS or DSSSL
style. The relevant engines will have this duty.
* Our syntax for attributes is not wonderful, but again it allows an open
set of attributes. Unfortunately, it easily allows the mixing of attributes
and content elements within an action, which some may see as contemptible.
Alternatively it could be possible to specify some monster notation such as:

<rule>
  <target-element type="p">
  <flow name="CSS.DIV" attributes="CSS.font-size='14pt',
                                   CSS.font-family='serif'">
    <children/>
  </flow>
</rule>

Come to think of it, I actually like this last notation better.

Any opinion?

Fabio Vitali


Fabio Vitali                            Tiger got to hunt, bird got to fly,
Dept of Computer Science         Man got to sit and wonder "Why, why, why?'
Univ. of Bologna  ITALY               Tiger got to sleep, bird got to land,
e-mail: fabio@xxxxxxxxxxx            Man got to tell himself he understand.
                                                             Kurt Vonnegut



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread