[xml] XML : PE reference outside DTD

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.



If my xml document is as follows:


<?xml version="1.0"?>

<!DOCTYPE root [

     <!ELEMENT root (a, b)>


     <!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 *-->




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


   CharData: content of b element

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


               <?PIcontent anyProcessingInstruction?>

               <!-- Comment content -->


    Charater reference: &#x41;

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



<!--* test P43 *-->


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

Please clarify.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]