Re: Standalone document VC and WFC inconsistency

> I wrote
> > Perhaps you give a little example of a standalone document that
> > you think has these attributes?
> >
>
> I have been experimenting with this a little further, and I think I've
> devised a test case that pinpoints the VC: Standalone Document:
>
> <?xml version="1.0" standalone="yes"?>
> <!DOCTYPE test [
> <!ELEMENT test EMPTY>
> <!ENTITY % pe "
>        <!ENTITY x 'x'>
>        <!ATTLIST test foo CDATA '&x;'>
> " >
> %pe;
> ]>
> <test foo='x'/>
>
> Do you agree this test file is
> a) well-formed

Yes - it passes my re-written WFC.

> b) invalid, for the only reason that the default value for parameter foo
> refers to &x; which is 'externally' declared.

Re-reading the VC:
<quote>
The standalone document declaration must have the value "no" if any external
markup declarations contain declarations of:
  a.. attributes with default values, if elements to which these attributes apply appear
      in the document without specifications of values for these attributes, or
  b.. entities (other than amp, lt, gt, apos, quot), if references to those entities
      appear in the document, or
</quote>

I would say this is invalid because of b).
It hinges on what "if references to those entities appear in the document"
means. I would say that the internal subset is part of the document.
Otherwise it should have said: "document content", am I right?

I believe you could actually convert it to a VC violation of a).
Leave out the attribute value in the element, and just write <test/>,
the entity x declaration would not be necessary either, like this:

<?xml version="1.0" standalone="yes"?>
<!DOCTYPE test [
<!ELEMENT test EMPTY>
<!ENTITY % pe "
       <!ATTLIST test foo CDATA 'something'>
" >
%pe;
]>
<test/>

Still wellformed, but invalid, IMO. What do you think?

Karl

Received on Wednesday, 19 June 2002 09:47:18 UTC