CMarkup AddSubDoc Method

bool CMarkup::AddSubDoc( MCD_CSTR szSubDoc );

The AddSubDoc method is called to add a markup string subdocument after the main position element. If there is no main position, the subdocument is added after the last element under the current parent position. After the subdocument is successfully added, the main position points to the containing element of the new subdocument.

The method returns true if the subdocument is well-formed and added successfully and the main position points to it.

See Subdocuments and Fragments of XML Documents.

CMarkup xml;
xml.AddElem( "DOC" );
xml.IntoElem();
xml.AddSubDoc( "<SUB>Hello World</SUB>\r\n" );
<DOC>
<SUB>Hello World</SUB>
</DOC>