Re: FO DTD from XSL WD.

Subject: Re: FO DTD from XSL WD.
From: "James Tauber" <jtauber@xxxxxxxxxxx>
Date: Thu, 5 Aug 1999 22:21:12 +0800
----- Original Message -----
From: Paul Tchistopolskii <paul@xxxxxxx>
> >The DTD in the XSL WD is designed for human consumption and indicates
where
> >the properties are *used*.
>
> Very cool. Do I understand right that it means that DTD actualy
> explains what attribute should be taken into account when
> rendring some element i.e. 'specific' to that element?

Yes. FOP, for example, will let you put any property (even one it doesn't
understand) on any formatting object. When it comes to actually getting a
value necessary for formatting, FOP checks to see if the value was
explicitly specified as an attribute on the element. If not, it sees if it
can be computed from one that is (eg text-align-last can be worked out from
text-align). If not, it sees if it is an inherited property. If so, it
queries it's parent. If it is not inherited or if it doesn't have a parent
(ie root) then the value it uses is the default.

> It explains, for example, why
>
> <!ATTLIST fo:inline-sequence
>     id  CDATA  #IMPLIED
> >
>
> is so short

Exactly. As far as FOP is concerned, inline-sequence does nothing.

> For some reason you have not quoted my original letter.

Sorry. I thought the subject heading was self-explanatory.

> Do I understand right that any inheritable attribute,
> may appear within *any* element in FO stream?

FOP treats it that way. Another way would be to only allow inheritable
attributes on elements whose allowable decendants can use that attribute.

> If no - is there any way to understand what
> attribute is valid for some element? Usualy we are
> using ATTLIST to explain such relations, right?

Yes. But you are supposing that there is value in a notion of validity that
is contraining enough to rule out attributes that won't be used. I don't
necessarily disagree with you, but it is worth noting that it is a design
decision whenever developing schemata (and I always include DTDs when I say
'schemata') which constraints are in the schema and which you check at the
application level. Some schema languages can express more than others. For
example, a FO DTD couldn't constrain the values of "font-size" to those the
prose of XSL WD does. The new W3C XML Schema language will be able to in
this particular example.

> For some reason XSL WD is not using DTD for
> that ordinary and trivial purpose, but is using DTD
> syntax for some other purpose.

A useful purpose, though. One that is aimed more at implementors than
stylesheet writers. Of course, it would be perfectly possible to have a DTD
for both, still bearing in mind that there will be a lot of constraints
*not* expressed in the DTD.

James
--
James Tauber / jtauber@xxxxxxxxxxx / www.jtauber.com
Maintainer of : www.xmlinfo.com,  www.xmlsoftware.com and www.schema.net
<pipe>Ceci n'est pas une pipe</pipe>


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


Current Thread