PEP #: 11

TITLE: Merge-local: Adding Support for XML Character References

Version: 1.1

Authors: Roger Kumpf

State:  Accepted

Type: Functionality enhancement

Created: January 31, 2003

Version History:

VersionDateAuthorsReason
1.01/31/03Roger KumpfInitial Proposal
1.12/12/03Roger KumpfUpdated Status


Abstract: The XML specification defines Character References for specifying characters using their numerical equivalents. For example, the character '1' could be represented in XML as '1' or '1' using the decimal and hexadecimal formats, respectively. Pegasus does not currently support this XML construct.


Problem:

Pegasus does not currently support XML character references. The current behavior is to validate the format of these references, but leave them unprocessed. This behavior may result in unexpected failures and data corruption.

Solution:

I propose to add support for XML character references in Pegasus. This enhancement would entail code changes in the XmlParser::_substituteReferences() method to recognize and substitute XML character references in addition to the current support for character entities (such as '&').

In addition, I propose to add tests for this enhancement by extending the wbemexec test suite in the pegasus/test/wetest/static/ErrorXml directory.

Schedule:

ActionPlannedActualComment
PEP Submitted1/31/031/31/03
PEP Reviewed2/7/032/7/03
PEP Approved2/7/032/11/03
Code Committed2/14/032/11/03


Addendum:

This change has been implemented and submitted to the "local" branch. Following is the original COMMIT message associated with the submittal.

From: "Roger Kumpf" <roger_kumpf@hp.com>
Date: Wed, 4 Dec 2002 18:34:56 -0800
Subject: COMMIT-local: Added Support for XML Character References

I've committed support for XML character references in the "local" branch.

This enhancement allows character references to be correctly translated
into their character equivalents.  For example, '&#49;' and '&#x31;' would
both be translated to '1'.

This change has been tested on HP-UX, IA64 Linux, and Windows platforms.

Updated files:

    pegasus/src/Pegasus/Common/XmlParser.cpp
    pegasus/test/wetest/static/ErrorXml/Makefile

Added files:

    pegasus/test/wetest/static/ErrorXml/BadCharacterReference01.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference02.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference03.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference04.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference05.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference06.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference07.xml
    pegasus/test/wetest/static/ErrorXml/GoodCharacterReference01.xml
    pegasus/test/wetest/static/ErrorXml/GoodCharacterReference02.xml
    pegasus/test/wetest/static/ErrorXml/GoodCharacterReference03.xml
    pegasus/test/wetest/static/ErrorXml/GoodCharacterReference04.xml
    pegasus/test/wetest/static/ErrorXml/BadEntityReference01.xml
    pegasus/test/wetest/static/ErrorXml/BadEntityReference02.xml
    pegasus/test/wetest/static/ErrorXml/BadEntityReference03.xml
    pegasus/test/wetest/static/ErrorXml/GoodEntityReference01.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference01rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference02rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference03rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference04rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference05rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference06rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadCharacterReference07rspgood.xml
    pegasus/test/wetest/static/ErrorXml/GoodCharacterReference01rspgood.xml
    pegasus/test/wetest/static/ErrorXml/GoodCharacterReference02rspgood.xml
    pegasus/test/wetest/static/ErrorXml/GoodCharacterReference03rspgood.xml
    pegasus/test/wetest/static/ErrorXml/GoodCharacterReference04rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadEntityReference01rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadEntityReference02rspgood.xml
    pegasus/test/wetest/static/ErrorXml/BadEntityReference03rspgood.xml
    pegasus/test/wetest/static/ErrorXml/GoodEntityReference01rspgood.xml