diff options
Diffstat (limited to 'core/fxcrt/xml/cfx_xmlparser.cpp')
-rw-r--r-- | core/fxcrt/xml/cfx_xmlparser.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp index 55778d3204..651ebb41eb 100644 --- a/core/fxcrt/xml/cfx_xmlparser.cpp +++ b/core/fxcrt/xml/cfx_xmlparser.cpp @@ -242,14 +242,12 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() { m_Start++; m_syntaxParserState = FDE_XmlSyntaxState::CloseElement; } else if (ch == L'?') { - m_CurNodeType = FX_XMLNODE_Instruction; - m_XMLNodeTypeStack.push(m_CurNodeType); + m_XMLNodeTypeStack.push(FX_XMLNODE_Instruction); m_Start++; m_syntaxParserState = FDE_XmlSyntaxState::Target; syntaxParserResult = FX_XmlSyntaxResult::InstructionOpen; } else { - m_CurNodeType = FX_XMLNODE_Element; - m_XMLNodeTypeStack.push(m_CurNodeType); + m_XMLNodeTypeStack.push(FX_XMLNODE_Element); m_syntaxParserState = FDE_XmlSyntaxState::Tag; syntaxParserResult = FX_XmlSyntaxResult::ElementOpen; } @@ -280,12 +278,12 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() { } if (!IsXMLNameChar(ch, current_text_.empty())) { if (current_text_.empty()) { - if (m_CurNodeType == FX_XMLNODE_Element) { + if (m_XMLNodeTypeStack.top() == FX_XMLNODE_Element) { if (ch == L'>' || ch == L'/') { m_syntaxParserState = FDE_XmlSyntaxState::BreakElement; break; } - } else if (m_CurNodeType == FX_XMLNODE_Instruction) { + } else if (m_XMLNodeTypeStack.top() == FX_XMLNODE_Instruction) { if (ch == L'?') { m_syntaxParserState = FDE_XmlSyntaxState::CloseInstruction; m_Start++; @@ -297,7 +295,7 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() { m_syntaxParserResult = FX_XmlSyntaxResult::Error; return m_syntaxParserResult; } else { - if (m_CurNodeType == FX_XMLNODE_Instruction) { + if (m_XMLNodeTypeStack.top() == FX_XMLNODE_Instruction) { if (ch != '=' && !IsXMLWhiteSpace(ch)) { m_syntaxParserState = FDE_XmlSyntaxState::TargetData; break; @@ -317,7 +315,7 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() { break; } if (ch != L'=') { - if (m_CurNodeType == FX_XMLNODE_Instruction) { + if (m_XMLNodeTypeStack.top() == FX_XMLNODE_Instruction) { m_syntaxParserState = FDE_XmlSyntaxState::TargetData; break; } @@ -370,11 +368,6 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() { } m_XMLNodeTypeStack.pop(); - if (!m_XMLNodeTypeStack.empty()) - m_CurNodeType = m_XMLNodeTypeStack.top(); - else - m_CurNodeType = FX_XMLNODE_Unknown; - m_syntaxParserState = FDE_XmlSyntaxState::Text; syntaxParserResult = FX_XmlSyntaxResult::InstructionClose; } @@ -400,11 +393,6 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() { } m_XMLNodeTypeStack.pop(); - if (!m_XMLNodeTypeStack.empty()) - m_CurNodeType = m_XMLNodeTypeStack.top(); - else - m_CurNodeType = FX_XMLNODE_Unknown; - m_syntaxParserState = FDE_XmlSyntaxState::Text; syntaxParserResult = FX_XmlSyntaxResult::ElementClose; } else if (!IsXMLWhiteSpace(ch)) { |