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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user