From 369d12bcfb9e12799509a70566e1220d04d0e189 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 14 Sep 2010 10:47:43 -0700 Subject: fixed text contents parsing for LLSimpleXUIParser...each contiguous range of text is submitted as a new "value" element whenever an open/close tag is encountered --- indra/llxuixml/llxuiparser.cpp | 12 +++++++++--- indra/llxuixml/llxuiparser.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/llxuixml') diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index afc9b38246..e1ad9a5c71 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -1145,6 +1145,8 @@ void LLSimpleXUIParser::characterDataHandler(void *userData, const char *s, int void LLSimpleXUIParser::startElement(const char *name, const char **atts) { + processText(); + typedef boost::tokenizer > tokenizer; boost::char_separator sep("."); @@ -1238,8 +1240,7 @@ bool LLSimpleXUIParser::readAttributes(const char **atts) return any_parsed; } - -void LLSimpleXUIParser::endElement(const char *name) +void LLSimpleXUIParser::processText() { if (!mTextContents.empty()) { @@ -1250,9 +1251,14 @@ void LLSimpleXUIParser::endElement(const char *name) mCurAttributeValueBegin = mTextContents.c_str(); mOutputStack.back().first->submitValue(mNameStack, *this, mParseSilently); mNameStack.pop_back(); - mTextContents.clear(); } + mTextContents.clear(); } +} + +void LLSimpleXUIParser::endElement(const char *name) +{ + processText(); if (--mOutputStack.back().second == 0) { diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h index 2522128e03..5c613b0c69 100644 --- a/indra/llxuixml/llxuiparser.h +++ b/indra/llxuixml/llxuiparser.h @@ -218,6 +218,7 @@ private: void endElement(const char *name); void characterData(const char *s, int len); bool readAttributes(const char **atts); + void processText(); Parser::name_stack_t mNameStack; struct XML_ParserStruct* mParser; -- cgit v1.2.3