From Wang Rui, "I've added CDATA tag support to XmlParser so that we can keep user

data (e.g., GLSL shader texts) in XML files without parsing them. This
will be necessary for the coming-soon effect compositor submission.
:-)"
This commit is contained in:
Robert Osfield
2012-10-08 16:14:23 +00:00
parent 94e8c42569
commit 16de7e9f33

View File

@@ -217,6 +217,26 @@ bool XmlNode::read(Input& input)
input += end;
}
}
else if (input.match("<![CDATA["))
{
XmlNode* commentNode = new XmlNode;
commentNode->type = XmlNode::INFORMATION;
children.push_back(commentNode);
input += 9;
XmlNode::Input::size_type end = input.find("]]>");
commentNode->contents = input.substr(0, end);
if (end!=std::string::npos)
{
OSG_INFO<<"Valid infomation record ["<<commentNode->contents<<"]"<<std::endl;
input += (end+2);
}
else
{
OSG_NOTICE<<"Error: Unclosed infomation record ["<<commentNode->contents<<"]"<<std::endl;
input += end;
}
}
else if (input.match("<?"))
{
XmlNode* commentNode = new XmlNode;