Hi ,

According to standard, PE reference must not occur outside DTD.

Well-formedness constraint: In DTD

Parameter-entity references MUST NOT appear outside the DTD
<http://www.w3.org/TR/REC-xml/#dt-doctype> .

 

So,

If my xml document is as follows:

 

<?xml version="1.0"?>

<!DOCTYPE root [

     <!ELEMENT root (a, b)>

     <!ELEMENT a EMPTY>

     <!ELEMENT b (#PCDATA | c)*>

     <!ELEMENT c ANY>

     <!ENTITY inContent "<b>General entity reference in element
content</b>">

     <!ENTITY % paaa "wrong">

]>

<!--* content: element|CharData|Reference|CDSect|PI|CDSect|PI|Comment *-->

<root>

     <a/>

     <b>

          <!-- there is an empty element in the above line -->

          <c/> 

   CharData: content of b element

   %paaa; : PE reference should not be recognized in element content 

   <c>

               <?PIcontent anyProcessingInstruction?>

               <!-- Comment content -->

    &inContent;

    Charater reference: &#x41;

    CDSect in content: <![CDATA[
<html>markups<head>HEAD</head><body>nothing</body></html> ]]></c>

     </b>

</root>

<!--* test P43 *-->

--------------------------------------------------------

And here I have used PE reference paaa outside DTD , shouldn't it be a fatal
error.

Please clarify.

 

Regards,

Murali

 

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to