9 и 16 марта, после более года разработки, состоялись выпуски 10.1.0 и 11.0.0 небольшой, простой и эффективной C++ библиотеки TinyXML2, предназначенной для парсинга XML и распространяемой по лицензии Zlib.
Список изменений:
- Устранена уязвимость CVE-2024-50615, связанная с проблемой разбора кодировок символов.
- Исправлены некоторые внутренние типы (
int -> size_t
), в связи с чем нарушена совместимость c ABI прежних версий. - Исправлены ошибки сборки и опечатки.
Пример использования:
{
XMLDocument doc;
doc.LoadFile( "dream.xml" );
// Structure of the XML file:
// - Element "PLAY" the root Element, which is the
// FirstChildElement of the Document
// - - Element "TITLE" child of the root PLAY Element
// - - - Text child of the TITLE Element
// Navigate to the title, using the convenience function,
// with a dangerous lack of error checking.
const char* title = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->GetText();
printf( "Name of play (1): %s\n", title );
// Text is just another Node to TinyXML-2. The more
// general way to get to the XMLText:
XMLText* textNode = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->FirstChild()->ToText();
title = textNode->Value();
printf( "Name of play (2): %s\n", title );
}