CMarkup AddSubDoc Method
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.
CMarkup xml; xml.AddElem( "DOC" ); xml.IntoElem(); xml.AddSubDoc( "<SUB>Hello World</SUB>\r\n" );
<DOC> <SUB>Hello World</SUB> </DOC>
File write mode
If the subdocument consists of one element without child elements, then the element is kept as the current position and you can still modify attributes. However, if in file write mode the added subdocument has child elements then the current position goes to right after the subdocument.