Crazy idea
Rick Jelliffe
ricko at allette.com.au
Mon Sep 6 19:54:58 BST 1999
From: Paul Prescod <paul at prescod.net>
>This "stylesheet as schema" idea comes around every so often but I
think
>that it has one major flaw: stylesheets cannot drive syntax directed
>editors.
Yes, but the idea is not "stylesheet as schema" but "validator
implemented by
stylesheet transformation language". As Francis Norton's tool (see
previous
email) shows, DCD (which is pretty suitable for a syntax-directed
editor)
validation can be implemented using XSLT.
Also, why should a syntax-directed editor work outside-in (i.e., using
content
models). That the currently do so is because they use grammars where the
children are keyed by the parent, but that is not the only way in which
a
grammar can be specified.
I do not see why a syntax-directed editor could not key off path
expressions
instead of the curent element type. That is surely how global exclusions
and
inclusion exceptions in SGML work: you can or cannot insert this element
type
because some ancestor's (extended) content model has allowed or banned
it.
>From a mathematical point of view, I don't think that XSchemas are much
>stronger than DTDs. The set of tag-based languages they can describe
are
Here here.
>pretty much the same. The XSLT set of languages would be radically
>different. What's the XSLT equivalent for this content model:
>
>((a*,(b|c)+,d)+|(d,(b|c)*,d?)+)
It would be a lot of typing in XSLT, but it cannot see why it could not
be
done. It can be a transformed from a schema anyway.
Another possibility is also that a validator need not perform all
possible
validations to be still useful. I have a note "Weaker Validation" at
http://www.ascc.net/xml/en/utf-8/weakvalid.html on this. In particular,
for documents in development is it useful to have a weaker validation.
>On the other hand there are constraints that XSLT could support that
>schemas probably could not.
I think abbreviated RDF and XML namespaces should be test cases for
XML schemas: if they can handle those, then we have a clear advance.
Rick Jelliffe
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list