By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

xhtml generation library

P: n/a

A few months ago, I received some good feedback and suggestions regarding
the tree container library I was working on. I'm in the process of
finishing a new
library for xhtml generation, called xhtml_gen, and was hoping to get some
on this new library.

The library generates well formed xhtml documents, and formats the raw
content with indenting
between the nested (block level) elements.
xhtml_gen uses the tree container library to store the element nodes in a
natural tree like structure,
which is transparent to the user.

There is just a handful of interface classes including xhtml_document<>,
stylesheet, and stylesheet_rule. The two template classes will accept a
template parameter of
xhtml_transitional, xhtml_frameset, or xhtml_strict, which are enumerations
for the element names.

A typedef is provided for the default document type (xhtml_strict), which
defines document, and element
as the two interface types to use.

Creating a simple xhtml_document is as easy as....

document doc;
element h1_elem(h1); // create an h1 element
h1_elem << "Sample xhtml Doc"; // insert text in h1 element
doc << h1_elem; // insert h1 element in doc

// lets use 2nd method to insert content, which returns an element iterator
element::iterator it = doc.insert(element(ul)); // create a user list
*it << (element(li) << "First Item"); // need these parenth
it = it->insert(element(li)); // it now points to list item element
*it << "Second Item";"c:\\my_xhtml_doc.htm");

Library documentation and downloads are at

Thanks in advance,

Mitch Haas

Jun 27 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.