XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] XML quiz

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@mitre.org> wrote:
Are entities recognized in comments? For example, in this XML document is a comment which contains an entity:

<Document>
    <!-- &amp; -->
</Document>

Will an XML parser replace the entity &amp; 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 &amp; ?>
</Document>

Will an XML parser replace the entity &amp; 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>
    <!-- &amp; -->
</Document>

<Document>
    <?foo &amp; ?>
</Document>

 

--
Regards,
Mukul Gandhi


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS