mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-17 06:06:00 -06:00
Core: XML improvements
git-svn-id: svn://ultimatepp.org/upp/trunk@10451 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
6776b11c30
commit
89f951ec79
1 changed files with 12 additions and 5 deletions
|
|
@ -285,7 +285,7 @@ void XmlParser::Next()
|
|||
term[3] == 'C' && term[4] == 'D' && term[5] == 'A' && term[6] == 'T' && term[7] == 'A' &&
|
||||
term[8] == '[') { // ![CDATA[
|
||||
term += 9;
|
||||
LLOG("CDATA");
|
||||
DLOG("CDATA");
|
||||
for(;;) {
|
||||
if(!HasMore())
|
||||
throw XmlError("Unterminated CDATA");
|
||||
|
|
@ -979,8 +979,12 @@ static XmlNode sReadXmlNode(XmlParser& p, ParseXmlFilter *filter, dword style)
|
|||
m.CreateComment(p.ReadComment());
|
||||
return m;
|
||||
}
|
||||
m.CreateText(p.ReadText());
|
||||
m.Shrink();
|
||||
if(p.IsText()) {
|
||||
m.CreateText(p.ReadText());
|
||||
m.Shrink();
|
||||
return m;
|
||||
}
|
||||
p.ReadText(); // skip empty text
|
||||
return m;
|
||||
}
|
||||
|
||||
|
|
@ -990,8 +994,11 @@ XmlNode ParseXML(XmlParser& p, dword style, ParseXmlFilter *filter)
|
|||
{
|
||||
XmlNode r;
|
||||
while(!p.IsEof())
|
||||
if(!Ignore(p, style))
|
||||
r.Add() = sReadXmlNode(p, filter, style);
|
||||
if(!Ignore(p, style)) {
|
||||
XmlNode n = sReadXmlNode(p, filter, style);
|
||||
if(n.GetType() != XML_DOC) // tag was ignored
|
||||
r.Add() = pick(n);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue