Re: Validating FO

On 20 January 2014 18:28, G. Ken Holman <gkholman@cranesoftwrights.com> wrote:
> At 2014-01-20 11:00 +0000, Dave Pawson wrote:
>>
>> >>   Mixing lengths is another irregular property set.
>> >
>> > I do it quite often.  From a stylesheet that I happened to have open
>> > right
>> > now:
>>
>> That doesn't make it right Tony?
>
>
> Absolutely it is right to mix units of measure in a property specification
> as an arithmetic expression.  Doing so alleviates a tremendous amount of
> unnecessary manipulation in XSLT.  Tony's technique of leveraging variables
> is a long-standing practice and is what I recommend to stylesheet writers.

I disagree Ken.



>
>> > Just because there's more to the property values than you can usefully
>> > assert with Relax NG doesn't mean that it's wrong.
>>
>> No. But one thing I would like to do for users is make it easier to use?
>> And in this aspect, ease of validation would make it easier to use?
>
>
> I disagree.  The processor is going to validate the values in your instance
> for you, so why bother pre-validating the values?  Certainly if you were
> using XSLT's result tree validation for the structure that will help you
> debug the nesting of formatting objects, so I can see where that might help
> catch where in your stylesheet you are incorrectly structuring output.  But
> there is a logical limit to what you can catch at transformation time.

?? I never mentioned xslt? When writing docbook.... I use a syntax validating
editor. I would like to do the same with XSL-FO. Why? Because there are
so many properties (too many?) that I never know what is valid where.
It's answering this question that brings me to edit time validation /
prompting.



>
>> "What property can I use here" is an oft heard question IMHO
>
>
> In XSL-FO the answer is "any" because of the availability of inheritance or
> the possibility of specifying "inherit" for those properties that are not
> inherited.  Any property can be specified on any object.

Which IMHO is on the silly side of wrong.


>
> I would hate to have to support a stylesheet where a schema limiting
> property specification constrained the original writer to avoid exploiting
> inheritance.
>
> I hope this helps.

A separate track Ken? Whether writing FO via a stylesheet (some don't)
or directly, validation by presenting valid options from a finite list
is helpful, always has been in XML.

Inheritance is another aspect that could do with simplification and
clear definition.



regards





-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Received on Tuesday, 21 January 2014 07:56:25 UTC