Пример #1
0
Element* XMLNodeHandlerBody::ElementStart(XMLParser* parser, const String& name, const XMLAttributes& attributes)
{
	ROCKET_ASSERT(name == "body");

	Element* element = parser->GetParseFrame()->element;

	// Check for and apply any template
	String template_name = attributes.Get<String>("template", "");
	if (!template_name.Empty())
	{
		element = XMLParseTools::ParseTemplate(element, template_name);
	}

	// Apply any attributes to the document
	ElementDocument* document = parser->GetParseFrame()->element->GetOwnerDocument();
	if (document)
		document->SetAttributes(&attributes);

	// Tell the parser to use the element handler for all children
	parser->PushDefaultHandler();
	
	return element;
}