예제 #1
0
파일: tinyxml.cpp 프로젝트: oksangman/Ant
void XmlDocument::CopyTo( XmlDocument* target ) const
{
	XmlNode::CopyTo( target );

	target->error = error;
	target->errorId = errorId;
	target->errorDesc = errorDesc;
	target->tabsize = tabsize;
	target->errorLocation = errorLocation;
	target->useMicrosoftBOM = useMicrosoftBOM;

	XmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}	
}
예제 #2
0
파일: tinyxml.cpp 프로젝트: oksangman/Ant
void XmlElement::CopyTo( XmlElement* target ) const
{
	// superclass:
	XmlNode::CopyTo( target );

	// Element class: 
	// Clone the attributes, then clone the children.
	const XmlAttribute* attribute = 0;
	for(	attribute = attributeSet.First();
	attribute;
	attribute = attribute->Next() )
	{
		target->SetAttribute( attribute->Name(), attribute->Value() );
	}

	XmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}
}