AW: Entities vs #PCDATA with msxml 1.6 ?

Markus Wodrich (markus.wodrich@bmw.de)
Mon, 1 Dec 1997 01:37:34 +0100


-----Urspr=FCngliche Nachricht-----
Von: Patrice.Bonhomme@loria.fr [SMTP:Patrice.Bonhomme@loria.fr]
Gesendet am: Sonntag, 30. November 1997 17:57
An: xml-dev@ic.ac.uk
Betreff: Entities vs #PCDATA with msxml 1.6 ?

Hi,

I have a problem with msxml 1.6. If i put only one entity within an =
element,=20
this element must be able to contain some PCDATA because msxml considers =
an=20
entity as a piece of PCDATA !

But if i have:

<?XML VERSION=3D"1.0" ?>
<!DOCTYPE EXAMPLE [
<!ELEMENT EXAMPLE (P+)>
<!ELEMENT P (S+)>
<!ELEMENT S (#PCDATA)>
<!ATTLIST S ID ID #IMPLIED>
<!-- ENTITY incs SYSTEM "inc-s.xml" -->
<!ENTITY incs "<S>A third in a new paragraph.</S>">
]>
<EXAMPLE>
<P><S ID=3D"s1">A sentence.</S><S ID=3D"s2">An another.</S></P>
<P>&incs;</P>
</EXAMPLE>

I get this message:
% java msxml2 -i -d test-ext-ent.xml
Invalid element 'PCDATA' in content of 'P'. Expected [S]
Location: file:test-ext-ent.xml(12,5)
Context: <EXAMPLE><P>

And with this one, it works (just because P contains PCDATA in its =
content !):

<?XML VERSION=3D"1.0" ?>
<!DOCTYPE EXAMPLE [
<!ELEMENT EXAMPLE (P+)>
<!ELEMENT P (#PCDATA | S+)><!-- <<=3D here -->
[Wodrich, Markus] That doesn't work, it is mixed content, I think you =
mean <!ELEMENT P (#PCDATA | S)*>.
[Wodrich, Markus] I don't have the answer for your question, but when =
you run MSXML 1.6 with java msxml -d1 example.xml
[Wodrich, Markus] you get this: =20
[Wodrich, Markus] DOCUMENT
|---XMLDECL VERSION=3D"1.0"
|---WHITESPACE 0xd 0xa
|---DOCTYPE NAME=3D"EXAMPLE"
| |---WHITESPACE 0xd 0xa
| |---ELEMENTDECL EXAMPLE (P)+
| |---WHITESPACE 0xd 0xa
| |---ELEMENTDECL P (#PCDATA|S)*
| |---COMMENT --
| | +---CDATA " <<=3D here "
| |---WHITESPACE 0xd 0xa
| |---ELEMENTDECL S (#PCDATA)*
| |---WHITESPACE 0xd 0xa
| |---COMMENT --
| | +---CDATA " ENTITY incs SYSTEM "inc-s.xml" "
| |---WHITESPACE 0xd 0xa
| +---INTENTITYDCL incs
| +---ELEMENT S
| |---PCDATA "A third in a new paragraph."
| +---PCDATA "A third in a new paragraph." =
<------------Here!!
|---WHITESPACE 0xd 0xa
|---ELEMENT EXAMPLE
| |---WHITESPACE 0xd 0xa
| |---ELEMENT P
| | |---ELEMENT S
| | | +---PCDATA "A sentence."
| | +---ELEMENT S
| | +---PCDATA "An another."
| |---WHITESPACE 0xd 0xa
| |---ELEMENT P
| | +---ENTITYREF incs "A third in a new paragraph. A third in a new =
paragraph." <----- and here too!!
| +---WHITESPACE 0xd 0xa
+---WHITESPACE 0xd 0xa

The ENTITY is doubled.

Markus

<!ELEMENT S (#PCDATA)>
<!ATTLIST S ID ID #IMPLIED>
<!-- ENTITY incs SYSTEM "inc-s.xml" -->
<!ENTITY incs "<S>A third in a new paragraph.</S>">
]>
<EXAMPLE>
<P><S ID=3D"s1">A sentence.</S><S ID=3D"s2">An another.</S></P>
<P>&incs;</P>
</EXAMPLE>

Is there something broken in the msxml kingdom ?

Pat.
--=20
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
bonhomme@loria.fr | Office : B.228
http://www.loria.fr/~bonhomme | Phone : 03 83 59 20 37
--------------------------------------------------------------
* Projet Aquarelle : http://aqua.inria.fr
* Serveur Silfide : http://www.loria.fr/Projet/Silfide
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D