Re: Crazy idea

Subject: Re: Crazy idea
From: "Oren Ben-Kiki" <oren@xxxxxxxxxxxxx>
Date: Thu, 9 Sep 1999 15:52:02 +0200
Francis Norton <francis@xxxxxxxxxxx> wrote:
> Oren Ben-Kiki wrote:
> > - People would abuse it.
> >
> > That is, people would create "schema" sheets which would transform the
> > document to something completely different then what you started with.
There
> > are several answers to this, ranging from "so what? anything good can be
> > abused" to "define a strict subset of XSLT which can't be abused". My
> > suggested compromise is to require that a "Schema" XSLT stylesheet
should
> > only emit "fixpoint" documents - that is, applying it a second time must
be
> > a no-op. This is trivially testable and satisfies most objections as to
the
> > difference between "validation/completion" and "transformation".
> >
> Are you thinking of [1] a standard schema-validation stylesheet, an
> engine operating on documents and 'xslt-schemas', or [2] that people
> will provide "self-processing" schemas which don't require any engine
> except an XSLT processor?
>
> If [1] then the standard schema-validation stylesheet can be defined to
> return nothing but a status. If [2] then it all depends, I guess, on how
> the 'xslt-validator' gets called.

I was thinking of [2] - that is, that people will write a "schema" that
actually does processing. That's why I suggested the "fixpoint" requirement;
it seems a pretty effective barrier against such abuse, and is a pretty
natural thing to require.

> I would add another objection - I'm not sure that XSLT is powerful
> enough to do the data-validation (as opposed to the structure
> validation) unless/until it gets regular expressions.

Some sort of order constraints on sub elements are obviously useful. Simple
sequences with optional repeating elements are trivial to express in XSLT
(though not as elegantly as in XSchemas, I admit). Anything further becomes
hairy, but it isn't clear to me that much more is useful in practice.

I don't see any easy way to add regular expressions to XSLT.

> On a less fundamental note, I'd also like the ability to define XSLT
> functions in XSLT, which would make programs very
> much more concise and legible.

You can, using "named templates".

Have fun,

    Oren Ben-Kiki


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


Current Thread