At 3:50 PM -0700 10/5/09, Don Smith wrote:
What I want to do is produce, for every element, not only what it's
declared content model is (in DTDParse's output file, the content of
<content-model-expanded>), but also of any inclusions that apply to
the element. And that's where the problem is.
If I recall SGML inclusions correctly, an inclusion declared on an
element applies to all child elements all the way to the bottom of
the relevant part of the document tree.
1. An inclusion declared on an element applies to all child elements
all the way to the bottom of the relevant part of the document tree
UNLESS there is an exclusion at a lower level that over-rides the
inclusion.
2. In models with inclusions and/or exclusions and elements that
appear in more than one context (in other words, most real document
models), it is not possible to specify what elements are allowed in
another element; the answer is context-dependent. Imagine, for
example, a document model with <footnote> included at the top level,
and excluded on <footnote>. If <footnote> contains <paragraph>s and
<paragraph>s are also allowed in other contexts, then some
<paragraph>s are allowed to contain <footnote>s (those not in
<footnote>s) and other <paragraph>s are not allowed to contain
<footnote>s (those that are in <footnote>s. This is a very common
situation in SGML models for prose documents.
Unless you are working with SGML that has inclusions but not
exclusions (which is possible, I suppose), you will not be able to
produce such a list unless it lists each element in each context. And
sometimes the contexts may be many levels nested. (If <paragraph> can
contain <list> which can contain <item> then, using the example
above, <item> may contain <footnote> unless the <item> is inside a
<footnote>, such as if it is in a <paragraph> that is in a <footnote>.
I started to write "I hope that helps", but I know that it doesn't.
Thank you for reminding me of one of the best things about the XML
specification. And GOOD LUCK!
-- Tommie
--
======================================================================
B. Tommie Usdin
mailto:btusdin(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Phone: 301/315-9631
Suite 207 Direct Line: 301/315-9634
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in XML and SGML
======================================================================
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--