- From: Mukul Gandhi <mukulg@s...>
- To: Roger L Costello <costello@m...>
- Date: Tue, 8 Jun 2021 09:50:03 +0530
Thanks, for sharing these insightful facts.
Particularly, an entity reference within XML PI and its result upon parsing, which I haven't thought about earlier.
On Mon, Jun 7, 2021 at 2:47 AM Roger L Costello < costello@m...> wrote: Are entities recognized in comments? For example, in this XML document is a comment which contains an entity:
<Document>
<!-- & -->
</Document>
Will an XML parser replace the entity & with its replacement text &, to yield this:
<Document>
<!-- & -->
</Document>
Are entities recognized in processing instructions? For example, in this XML document is a processing instruction which contains an entity:
<Document>
<?foo & ?>
</Document>
Will an XML parser replace the entity & with its replacement text &, to yield this:
<Document>
<?foo & ?>
</Document>
Scroll down to see the answers ........
No. No.
Entities are not recognized in comments nor processing instructions.
Thus, after parsing the comment and processing instruction still have the unaltered entity:
<Document>
<!-- & -->
</Document>
<Document>
<?foo & ?>
</Document>
--
- References:
- XML quiz
- From: Roger L Costello <costello@m...>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
|