Home  
Sunday, 05 February 2012  
Latest Forums
Boost HTXML Library PDF Print E-mail
(4 votes)
Written by Andreas Haberstroh   
Tuesday, 01 September 2009
New release of the Boost HTXML library, a cross-platform C++ library for reading and writing HTML and XML documents.

License

 Boost-HTXML is released under the Boost Software License.

Dependencies

Boost::HTXML requires Boost version 1.33 or later.

Currently compiled on the newer Boost version 1.40

Downloading

You must be registered to download the source.

Using  Boost-HTXML

The Boost-HTXML library is relatively simplistic in design. All read and write operations are based on streams.

#include <boost/htxml/document.hpp>
#include <iostream>

#include <fstream>
using namespace std;
int
 main(int argc, char* argv[])
{
   fstream ifile("index.html", ios_base::in);
   boost::htxml::document   htmlDOM;

   htmlDOM.read(ifile);

   htmlDOM.write(cout);

   return 0;
}


What Boost Libraries are Used ?

I've used a few of my favorite Boost libraries:

shared_ptr
Pretty much every element object is encapsulated as a shared_ptr. I like automagic clean up
multi_index Attributes and element references are placed in multi_index_containers. Makes life easy to look up objects.
hashEasier to search by a hash, and that is just what I do!
string_algoPretty cool library giving Perl like functionality for strings. I personally use the join function a few times.

 

 

Comments
Add NewSearch
Laali - running the example above (htm   | 91.98.209.230 | 2010-01-12 00:04:57
Can anyone please tell me what exactly should I do to run the example above ?
I want to read the html file and modify it and then generate a new html file (which is originally the first html file which I have modified some tags in it )
I have no idea how to do it ?which tarball should I download and what Steps should I follow to compile the sample above program ?

thanks in advance
Mernaz - I need a more complicated Exam   | 91.98.193.17 | 2010-01-12 22:36:08
Hi everybody ,
I just run the above test program .It just reads and writes the html document ,but I want to first modify the html file (for example the text in the html page )and then write it back to a new html file .
Can anyone plz tell me the solution ?


Mehrnaz .
softwareace - Support forms   | Super Administrator | 2010-01-12 22:38:02
Post your questions in the support forums please.
Write comment
Name:
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
 

Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved.

Last Updated ( Tuesday, 01 September 2009 )
 
Top