David Sewell <[EMAIL PROTECTED]> writes:

[...]

> My principal XML editor uses a processing instruction to
> associate a Relax NG schema with a document, a simple and
> convenient solution from my point of view.

But wouldn't it be even more simple and convenient if your editor
did not require you to add such a processing instruction at all --
if it were smart enough to determine what schema to associate it
with on its own, without you needing to explicitly specify the
association in all of your individual document instances?

With an external association mechanism, in the best case, if your
document is a instance of a well-known industry standard schema,
your editor is smart enough to automatically detect at least what
"document family" (e.g., TEI or DocBook) it belongs to. Then, the
first time you open a document of that "family", it:

  - Asks (for example), "This looks like a TEI document. Which
    of the following TEI schemas do you want to associate it with?"

  - After you pick one, say "TEI Drama", maybe it can ask you, "Do
    you want to always associate TEI documents with the TEI Drama
    schema by default?"

  - If you say Yes, it says, "OK, all TEI documents will be
    associated with TEI Drama by default. You can always change
    that setting later using the Schema > Associations menu." (or
    whatever the menu item might be called)

Or, another way it could make the association persistent is to
just do the thing I mentioned earlier in the thread: Add a local
association between the filename for that particular document and
whatever schema you have chosen.

In either case, even with a instance that could potentially be
associated with several schemas in the same "family", you would
need to specify the association only once and then would never
again need to tell your editor what schema to associate it with
(unless you wanted to change it, which you could hopefully do
through some GUI widget the editor provides).

And in the worst case -- when you first open a document of a certain
type and your editor has no idea what it is and so no idea what
schema to associate it with -- your editor prompts you, just that
first time, to ask the location of a schema to associate it with.

If the editor is really smart, it could then actually "learn" from
information in that document, and automatically build and save
rules based on what it learns. If, say, the document has a
namespace, it builds and saves a rule so that it can automatically
remember to always associate that namespace with the schema at the
location you specified. (Or a rule based on the root element of
the document.)

Then, the next time you open that document -- or any other
document that has the same namespace or root element -- it handles
the schema association transparently.

For users, that seems to me simpler and more convenient than a PI.

  --Mike

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to