W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

Re: CM: DocumentCM.getInternalCM()

From: Benjamin C. Chang <Ben.Chang@oracle.com>
Date: Tue, 06 Mar 2001 15:16:25 -0800
Message-ID: <3AA56FC9.74929AD4@oracle.com>
To: Sander Bos <sander@x-hive.com>
CC: www-dom@w3.org
Sander Bos wrote:

> Hi there,
> I have a question concerning the content model specification, about
> getInternalCM defined on DocumentCM. I suppose the content model returned by
> this method represents the internal subset of the document (the method is
> defined as the 'sole CMModel')?

Yes, it's the internal subset that's returned.

> I wonder how this works out in practice.
> If you have a document with both an internal subset and a DTD, and you want
> to validate that document, do you have to call isValid() twice, once for the
> internal subset and once for the external DTD? Because if isValid() always

No, isValid() needs to be called only once, since the internal subset has a
to the external subset.

> validates against the internal subset as well as the active CM, how does
> that work out if the active CM represents an XML schema?

Why wouldn't it work out?  It would process the internal subset, e.g., entity
definitions, then go on to the active CM / external subset, which underneath
could be a DTD, XML Schema, database schema, etc.

> What happens when there are extra declarations in the internal subset which
> use declarations in the external DTD. E.g.
>   <?xml version="1.0"?>
>   <!DOCTYPE A SYSTEM "test.dtd"[
>     <!ATTLIST B
>         attName CDATA "bla">
>     <!ELEMENT D (B)>
>   ]>
>   <A>
>     <B/>
>   </A>
> where test.dtd holds
>   <!ELEMENT A (B)>
> Both the declarations of the attribute attName and the element D in the
> 'CM-tree' of the internal subset are related to the element declaration of
> B, which is defined in the (CM of the) external DTD. Is a copy of the
> element declaration of B made for the internal subset in this case?

Yes, the element declaration of B in the external subset would be used
for the internal subset, but I wouldn't call it a "copy".  It's as if you
a macro in a header that you're including and then referenced the macro;
you don't really have 2 versions of that macro.

> (My questions come from some confusion from me about the spec: until today I
> thought that in case of a DTD the internal subset and external part would be
> one unified CM, until my attention was brought to getInternalCM())

The internal subset and external subset would comprise a unified CM.

Hope this helps,

> --Sander.
> --
> X-Hive Corporation (www.x-hive.com)
> email: sander@x-hive.com
> phone: +31 10 7108625
Received on Tuesday, 6 March 2001 18:16:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC