Re: Validating FO

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.

> > 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.

>"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.

Regarding the question "what trait is acted upon here?", that is a 
very different question and not one solved by validation.  I ask that 
question of myself all the time, but the answer only guides me as to 
the myriad of possibilities of where I specify the property that gets 
interpreted as the trait.

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.

. . . . . . . . . Ken

--
Public XSLT, XSL-FO, UBL & code list classes: Melbourne, AU May 2014 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/f/ |
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com |
Google+ profile:      http://plus.google.com/+GKenHolman-Crane/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |

Received on Monday, 20 January 2014 19:54:14 UTC