This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RELAX NG and DocBook


/ Michael Smith <smith@xml-doc.org> was heard to say:
| Elliotte Rusty Harold <elharo@metalab.unc.edu> writes:
| > I'm not that familiar with Relax. Can it handle the entity
| > declarations DocBook needs?

No. The problem with entities is that they are resolved at parse time
and all of the schema languages that have been invented recently
operate on the infoset which exists only *after* parsing.

So the declaration of an entity, even though it could be expressed in
the schema, wouldn't be available to the parser when it was needed.

Like I said a few minutes ago, it's angle-brackets in attribute values
that's the toughest nut to crack.

| Norm can answer this much better than I can, but I'll make an attempt,
| and just hope I don't garble it too much or get anything wrong...

Nothing wrong with your answer, Mike, I just wasn't sure it answered the
question Elliotte was asking :-)

| One of the distinguishing traits/benefits of RELAX NG validation is
| that it makes no changes to the infoset of a document. Because of
| that, you cannot use a RELAX NG schema to specify entities (or
| notations), and you can't specify attribute defaults in RELAX NG
| directly -- you have to use a separate-namespace annotation mechanism
| instead (the "a:defaultValue" attribute):

This is a bug or a feature, I suppose, depending on your point of view.

The problem with defaulted attribute values and other things in your
DTD or schema, is that it's really a subtle sort of transformation.
It's not related to validation, directly, and it really means that the
document you're looking at is *different* depending on whether or not
you validated it, which it can definitely be argued is a bad thing.

| But I think most or all of the parameter entity reference in the
| DocBook DTD can be handled in a RELAX NG schema using the RELAX NG
| <externalref> element and "named patterns" (using the <define> and
| <ref> elements) as discussed in the RELAX NG tutorial:

Yeah, I don't think it's PEs that are at issue. Those are mostly
invisible to the end user. General entities are the problem.

| And James Clark has put together a tool, DTDinst, for converting
| existing DTDs into XML syntax -- either valid RELAX NG syntax or an
| intermediate XML syntax specific to DTDinst.

And it does an amazing job. He really unwinds the parameter entities
in deeply clever ways.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com>      | One stops being a child when one
http://www.oasis-open.org/docbook/ | realizes that telling one's
Chair, DocBook Technical Committee | trouble does not make it
                                   | better.--Cesare Pavese


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]