Re: Crazy idea
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  a standard schema-validation stylesheet, an > engine operating on documents and 'xslt-schemas', or  that people > will provide "self-processing" schemas which don't require any engine > except an XSLT processor? > > If  then the standard schema-validation stylesheet can be defined to > return nothing but a status. If  then it all depends, I guess, on how > the 'xslt-validator' gets called. I was thinking of  - 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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format