[Prev][Next][Index][Thread]

Re: questions about element declarations



At 12:32 PM 24/09/96 CDT, Paul Grosso wrote:

>For example, if I'm given an XML document and partial declarations
>equivalent to the following: 
...
[I've moved Paul's example down because it's really not what I'm addressing]
...

>1.  Am I right that the logical equivalent of what I describe is what's
>    expected by an XML editing tool?

I think it is outside the scope of this work to define what the expectations
should be for an XML editing tool.  I don't think that experience or wisdom
exists in this group or the world at large to understand that question, let
alone write it into a standard.  My personal bias would be that if there
is no DTD, all the tool could possibly do would be to test "well-formed-ness",
i.e. no syntax errors nor mis-nested elements.  If there is a DTD, the
problem is well-understood.  Trying to adduce grammars from instances is
very far from easy and of questionable utility.

-Cheers, Tim

><!DOCTYPE doc [
>  <!ELEMENT doc (title, section*)>
>  <!ELEMENT section (para*)>
>  <!ELEMENT title (#PCDATA)>
>  <!ELEMENT para (#PCDATA)>
>]>
><doc>
><title>The Title</title>
><chapter>
><title>Chapter Title</title>
><section>
><para>abc<emphasis>MNO</emphasis>xyz.</para>
></section>
></chapter>
></doc>
>
>then my XML editor would probably intuit and use the following DTD:
>
>  <!ENTITY % undeclared_elements "chapter, emphasis">
>
>  <!ELEMENT doc (title, section*)      +(%undeclared_elements)>
>  <!ELEMENT section (para*)>
>  <!ELEMENT title (#PCDATA)>
>  <!ELEMENT para (#PCDATA)>
>
>  <!ELEMENT (%undeclared_elements) ANY>