Xport Interface: document::insert

Inserts a markup object into the root of the document.

markup::iterator document::insert(1st Variety
  const markup& mkup
);
markup::iterator document::insert(2nd Variety
  const markup::const_iterator& pos
  const markup& mkup
);
markup::iterator document::insert(3rd Variety
  const stylesheet& ss
);

Parameters

mkup

A markup object to insert into the root of the document. The markup object can be a comment, processing instruction, or doctype declaration.

pos

An iterator which specifies the position in the called document where the markup object will be inserted.

ss

A stylesheet object to insert into the docuement as an embedded stylesheet.

Returns

Returns a markup iterator which points to the inserted element, if the insertion was successful, or end() if the insertion was unsuccessful.

Remarks

This operation is used to insert markup into the root of the document. The root of the document is the area outside of the html element. Valid markup outside the html element can include comments, processing instructions, and a doctype declaration. Any attempt to insert an element other than html in the root of the document will be unsuccessful. There is actually no need to insert the html element or doctype declaration in the document explicitly, since those markup objects are included automatically when constructing a document with the root_doc argument. This operation may be useful, however, to insert comments or processing instructions into the root of the document if desired. To insert content into the body of the element, call insert() on document::body().

The third variety may be especially useful, as it provides a convienient way to insert a stylesheet object into a document. The stylesheet will be inserted into a style element within the head element of the document.

Complexity

Logarithmic

Examples

Work Time Studio

Datasoft Solutions is proud to present their landmark product, Work Time Studio. Utilizing the tree container library, Work Time Studio provides unparalleled features in personal time, project and task management software. If you're looking for a way to increase your productivity, visit Work Time Studio's product website, and start being more productive today.