Bug fix for CXMLReader

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Murphy
Posts: 290
Joined: Mon Dec 13, 2004 12:06 am
Location: United States
Contact:

Bug fix for CXMLReader

Post by Murphy »

The XML reader only accepts attribute values in double quotes even though the XML spec says single quotes should work too. I've made this small alteration to CXMLReader.cpp.

In CXMLReader::parseOpeningXMLElement(), you find the following code:

Code: Select all

// read the attribute value				
while(*P != L'\"')
	++P;

++P;
const wchar_t* attributeValueBegin = P;
				
while(*P != L'\"')
	++P;

const wchar_t* attributeValueEnd = P;
++P;
Change it to:

Code: Select all

// read the attribute value				
while( (*P != L'\"') && (*P != L'\'') )
	++P;
const wchar_t attributeQuote = *P;

++P;
const wchar_t* attributeValueBegin = P;
				
while(*P != attributeQuote)
	++P;

const wchar_t* attributeValueEnd = P;
++P;
Post Reply