Re: [xml-dev] Wellformed?

From
Karl Waclawek <>
To
Jeff Rafter <>,
Date
2004-05-25T05:13:46Z
ID
<003001c44217$0ea7de60$0300a8c0@karlglen188>
Thread
Re: [xml-dev] Wellformed?
----- Original Message ----- 
From: "Jeff Rafter" <>
To: <>
Sent: Tuesday, May 25, 2004 12:52 AM


> Just a quick sanity check I am tying to work on some conformance and want to
> make sure I am correct:
> 
> The following is wellformed:
> ===================
> 
> <!DOCTYPE doc [
>   <!ENTITY e "<foo bar1:att='att' bar2:att='att'>test</foo>">
> ]>
> <doc xmlns:bar1="http://www.example1.org"
>      xmlns:bar2="http://www.example2.org">
>   <child>&e;</child>
> </doc>

Yes, looks OK.

> 
> But the following is not:
> ================
> <!DOCTYPE doc [
>   <!ENTITY e "<foo bar1:att='att' bar2:att='att'>test</foo>">
> ]>
> <doc xmlns:bar1="http://www.example.org"
>      xmlns:bar2="http://www.example.org">
>   <child>&e;</child>
> </doc>

Duplicate attribute - not OK.
 
> I have even tried:
> ===========
> <!DOCTYPE doc [
>   <!ELEMENT doc (child)>
>   <!ATTLIST doc xmlns:bar1 CDATA #IMPLIED
>                 xmlns:bar2 CDATA #IMPLIED>
>   <!ELEMENT child (foo)>
>   <!ELEMENT foo (#PCDATA)*>
>   <!ATTLIST foo bar1:att CDATA #IMPLIED
>                 bar2:att CDATA #IMPLIED>
>   <!ENTITY e "<foo bar1:att='att' bar2:att='att'>test</foo>">
> ]>
> <doc xmlns:bar1="http://www.example1.org"
>      xmlns:bar2="http://www.example2.org">
>   <child>&e;</child>
> </doc>

Should be OK.

> Basically, I am getting errors (even for the WF files) and the results are
> all over the map. I knew that expansion of entity references (and WF
> checking therein) was spotty-- but combine that with namespace scoping and
> things get downright crazy. It seems that only Xerces handles this the way I
> would expect... but then I am not sure that is right. The XML Rec claims
> that the literal must be WF on it's own-- is that possible with a colon in
> one of the attribute names (without a namespace decl?).

AFAIK, within DTDs namespaces have no meaning,
as there is no scope defined for a prefix mapping.

> Maybe the MSXML
> parser which claims that there is an undeclared prefix is more correct.

For which of the above?

Karl