At 07:39 PM 5/17/01, you wrote:
>For starters, it sounds like you and I are in agreement that mixed content
>is necessary. This is in contrast to other things have read, however. At
>least one widely-read (and otherwise excellent, in my opinion) book on XML
>states that mixed content should be used only as a crutch when converting
>old text data to XML. I found this view surprising, and a matter of concern
>if it is indicative of future directions in development of XML tools and
In many cases I'd be inclined simply to chalk such a viewpoint up to
naivete. I'm sure the argument comes in more- and less-sophisticated forms.
Here I'll resist the impulse to get into a tangle with a red herring. :-)
>In my specific case, I've found ways to use mixed content when needed, but
>as a result, our DTD is more permissive than I'd like it to be in a number
>of places. For example, we have an element called <filter> that can be used
>to tag content as specific to a given product, market, or media, as follows:
><p>This sentence appears in both help and the book.
> <filter><media help="exclude"/>
> For more information, see chapter xref...
>The filtered content can be a word or sentence within a paragraph (as
>above), or multiple paragraphs or other block of content. Ideally I'd like
>the DTD to allow only one media, product, or market tag, to eliminate the
>possiblity of conflicting tags:
><!ELEMENT filter (product?, market?, media?, (#PCDATA | p | graphic |
>However because #PCDATA is included, the only declaration that's allowed is:
><!ELEMENT filter (#PCDATA | product | market | media | p | graphic |
>This makes it possible for writers to get themselves in trouble by including
>multiple -- and conflicting -- product, market, or media tags within a given
>filter (which is unlikely the brief example above, but more likely in cases
>where larger chunks of content are filtered).
Here, there appear to me to be two strategies, either or both of which
1. It might be possible (although yours looks like a borderline case) to
model the information in the <product>, <market> and <media> elements as
attributes of <filter>, rather than subelements. When this is doable, it
generally makes for more succinct and elegant design. Alot depends on the
features (or properties) of <filter> that you're tracking with these
elements, their interoperation, how well they fit into attributes, and what
kind of validation requirements you have for your DTD.
2. A wrapper element here might serve you well. So:
<!ELEMENT filter (product?, market?, media?, text) >
Then the element <text> has the same content as <p> with the crucial
difference that <filter> is not allowed in it.
<p>This sentence appears in both help and the book.
<text>For more information, see chapter xref...</text>
It means extra tags, but if the system is designed well, you get used to
them, and the internal logic of the structures becomes alot more lucid.
>Incidentally, we're working on a strategy where the same elements that
>define links in help would become cross-references in the book, which would
>make the above example a moot point. But that's a separate issue.
That also seems like it would be a sound approach: modeling the
functionalities abstractly (e.g. a link is a link no matter whether or how
you represent it), not worrying in your content about the capabilities of
the target media. That is, clean separation of content from presentation.
That's such a good idea I wonder if anyone's thought of it before?
Wendell Piez mailto:[log in to unmask]
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
Mulberry Technologies: A Consultancy Specializing in SGML and XML