summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/xml/cfx_xmlparser.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp
index cbfb949705..c7a81afc16 100644
--- a/core/fxcrt/xml/cfx_xmlparser.cpp
+++ b/core/fxcrt/xml/cfx_xmlparser.cpp
@@ -175,8 +175,6 @@ bool CFX_XMLParser::Parse() {
auto* instruction = static_cast<CFX_XMLInstruction*>(m_pChild);
if (!target_data.IsEmpty())
instruction->AppendData(target_data);
- if (!GetTextData().IsEmpty())
- instruction->AppendData(GetTextData());
}
break;
}
@@ -248,18 +246,27 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() {
}
break;
case FDE_XmlSyntaxState::Target:
- case FDE_XmlSyntaxState::Tag:
if (!IsXMLNameChar(ch, current_text_.empty())) {
if (current_text_.empty()) {
m_syntaxParserResult = FX_XmlSyntaxResult::Error;
return m_syntaxParserResult;
}
- if (m_syntaxParserState != FDE_XmlSyntaxState::Target)
- syntaxParserResult = FX_XmlSyntaxResult::TagName;
- else
- syntaxParserResult = FX_XmlSyntaxResult::TargetName;
+ syntaxParserResult = FX_XmlSyntaxResult::TargetName;
+ m_syntaxParserState = FDE_XmlSyntaxState::TargetData;
+ } else {
+ current_text_.push_back(ch);
+ m_Start++;
+ }
+ break;
+ case FDE_XmlSyntaxState::Tag:
+ if (!IsXMLNameChar(ch, current_text_.empty())) {
+ if (current_text_.empty()) {
+ m_syntaxParserResult = FX_XmlSyntaxResult::Error;
+ return m_syntaxParserResult;
+ }
+ syntaxParserResult = FX_XmlSyntaxResult::TagName;
m_syntaxParserState = FDE_XmlSyntaxState::AttriName;
} else {
current_text_.push_back(ch);
@@ -486,7 +493,6 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() {
break;
}
if (m_wQuotationMark == 0) {
- m_wQuotationMark = 0;
m_Start++;
syntaxParserResult = FX_XmlSyntaxResult::TargetData;
break;