What is needed to get the entity reference expanded on line 7
1.<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 2.<!DOCTYPE myElement [ 3.<!ELEMENT myElement (#PCDATA)> 4.<!ENTITY % myEntity "Hey!"> 5.]> 6.<myElement> 7.%myEntity; How are you guys? 8.</myElement> = The document is both well formed and valid but the entity reference at line 7 will not be expanded.
% sign is used to refer to only Parameter Entities. PEs can be used only inside a DTD. The exacple you provided was attempting to declare and use a Parsed general entity which must use & sign and not %. That said, I am not sure why you think
The document is both well formed and valid but the entity reference at line 7 will not be expanded.
The above rules I mentioned are both Well-Formedness and Validity Constraints acc. to the Spec. p 32-33, Section 4. So IMO, the original document is not be well-formed. regds. - madhav
Take a Minute, Donate an Hour, Change a Life
Do not set lab on fire. Or this tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter