[boost-doc-zh] r382 committed - 升级至1.42.0,第八批,more/, tools/ 目录,除 doc/ 目录以外全部升级完成,doc/ 目录稍后以 qbk/xml 文件...

  • From: boost-doc-zh@xxxxxxxxxxxxxx
  • To: boost-doc-zh-notify@xxxxxxxxxxxxx
  • Date: Tue, 09 Feb 2010 07:38:44 +0000

Revision: 382
Author: alai04
Date: Mon Feb  8 23:37:27 2010
Log: 升级至1.42.0,第八批,more/, tools/ 目录,除 doc/ 目录以外全部升级完 成,doc/ 目录稍后以 qbk/xml 文件生成
http://code.google.com/p/boost-doc-zh/source/detail?r=382

Added:
 /trunk/tools/bcp/Jamfile.v2
 /trunk/tools/bcp/add_dependent_lib.cpp
 /trunk/tools/bcp/add_path.cpp
 /trunk/tools/bcp/bcp.hpp
 /trunk/tools/bcp/bcp_imp.cpp
 /trunk/tools/bcp/bcp_imp.hpp
 /trunk/tools/bcp/copy_path.cpp
 /trunk/tools/bcp/doc
 /trunk/tools/bcp/doc/Jamfile.v2
 /trunk/tools/bcp/doc/bcp.qbk
 /trunk/tools/bcp/doc/html
 /trunk/tools/bcp/doc/html/index.html
 /trunk/tools/bcp/file_types.cpp
 /trunk/tools/bcp/fileview.cpp
 /trunk/tools/bcp/fileview.hpp
 /trunk/tools/bcp/licence_info.cpp
 /trunk/tools/bcp/licence_info.hpp
 /trunk/tools/bcp/main.cpp
 /trunk/tools/bcp/output_licence_info.cpp
 /trunk/tools/bcp/path_operations.cpp
 /trunk/tools/bcp/scan_cvs_path.cpp
 /trunk/tools/bcp/scan_licence.cpp
 /trunk/tools/boostbook/xsl
 /trunk/tools/boostbook/xsl/admon.xsl
 /trunk/tools/boostbook/xsl/annotation.xsl
 /trunk/tools/boostbook/xsl/callout.xsl
 /trunk/tools/boostbook/xsl/caramel
 /trunk/tools/boostbook/xsl/caramel/LICENSE
 /trunk/tools/boostbook/xsl/caramel/concept2docbook.xsl
 /trunk/tools/boostbook/xsl/caramel/cpp-operators.xml
 /trunk/tools/boostbook/xsl/caramel/unparser.xsl
 /trunk/tools/boostbook/xsl/chunk-common.xsl
 /trunk/tools/boostbook/xsl/docbook-layout.xsl
 /trunk/tools/boostbook/xsl/docbook.xsl
 /trunk/tools/boostbook/xsl/doxygen
 /trunk/tools/boostbook/xsl/doxygen/collect.xsl
 /trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl
 /trunk/tools/boostbook/xsl/dtd
 /trunk/tools/boostbook/xsl/dtd/dtd2boostbook.xsl
 /trunk/tools/boostbook/xsl/error.xsl
 /trunk/tools/boostbook/xsl/fo.xsl
 /trunk/tools/boostbook/xsl/function.xsl
 /trunk/tools/boostbook/xsl/global.xsl
 /trunk/tools/boostbook/xsl/html-help.xsl
 /trunk/tools/boostbook/xsl/html-single.xsl
 /trunk/tools/boostbook/xsl/html.xsl
 /trunk/tools/boostbook/xsl/index.xsl
 /trunk/tools/boostbook/xsl/library.xsl
 /trunk/tools/boostbook/xsl/lookup.xsl
 /trunk/tools/boostbook/xsl/macro.xsl
 /trunk/tools/boostbook/xsl/manpages.xsl
 /trunk/tools/boostbook/xsl/navbar.xsl
 /trunk/tools/boostbook/xsl/reference.xsl
 /trunk/tools/boostbook/xsl/relative-href.xsl
 /trunk/tools/boostbook/xsl/source-highlight.xsl
 /trunk/tools/boostbook/xsl/template.xsl
 /trunk/tools/boostbook/xsl/testing
 /trunk/tools/boostbook/xsl/testing/Jamfile.xsl
 /trunk/tools/boostbook/xsl/testing/testsuite.xsl
 /trunk/tools/boostbook/xsl/type.xsl
 /trunk/tools/boostbook/xsl/utility.xsl
 /trunk/tools/boostbook/xsl/xhtml.xsl
 /trunk/tools/boostbook/xsl/xref.xsl
 /trunk/tools/inspect/doc
 /trunk/tools/inspect/doc/build.jam
 /trunk/tools/inspect/doc/inspect.qbk
 /trunk/tools/regression/test/compile-fail_fail.cpp
 /trunk/tools/regression/test/compile-fail_pass.cpp
 /trunk/tools/regression/test/compile_fail.cpp
 /trunk/tools/regression/test/compile_pass.cpp
 /trunk/tools/regression/test/compile_warn.cpp
 /trunk/tools/regression/test/run-fail_compile-fail.cpp
 /trunk/tools/regression/test/run-fail_fail-warn.cpp
 /trunk/tools/regression/test/run-fail_fail.cpp
 /trunk/tools/regression/test/run-fail_pass.cpp
 /trunk/tools/regression/test/run-fail_warn.cpp
 /trunk/tools/regression/test/run_compile-fail.cpp
 /trunk/tools/regression/test/run_fail-note.cpp
 /trunk/tools/regression/test/run_fail-warn.cpp
 /trunk/tools/regression/test/run_fail.cpp
 /trunk/tools/regression/test/run_note.cpp
 /trunk/tools/regression/test/run_pass.cpp
 /trunk/tools/regression/test/run_warn-note.cpp
 /trunk/tools/regression/test/run_warn.cpp
Deleted:
 /trunk/tools/bcp/bcp.files
 /trunk/tools/quickbook/test/stub.xml
 /trunk/tools/regression/test/compile-fail~fail.cpp
 /trunk/tools/regression/test/compile-fail~pass.cpp
 /trunk/tools/regression/test/compile~fail.cpp
 /trunk/tools/regression/test/compile~pass.cpp
 /trunk/tools/regression/test/compile~warn.cpp
 /trunk/tools/regression/test/run-fail~compile-fail.cpp
 /trunk/tools/regression/test/run-fail~fail-warn.cpp
 /trunk/tools/regression/test/run-fail~fail.cpp
 /trunk/tools/regression/test/run-fail~pass.cpp
 /trunk/tools/regression/test/run-fail~warn.cpp
 /trunk/tools/regression/test/run~compile-fail.cpp
 /trunk/tools/regression/test/run~fail-note.cpp
 /trunk/tools/regression/test/run~fail-warn.cpp
 /trunk/tools/regression/test/run~fail.cpp
 /trunk/tools/regression/test/run~note.cpp
 /trunk/tools/regression/test/run~pass.cpp
 /trunk/tools/regression/test/run~warn-note.cpp
 /trunk/tools/regression/test/run~warn.cpp
Modified:
 /trunk/more/getting_started/index.html
 /trunk/more/getting_started/unix-variants.html
 /trunk/more/getting_started/windows.html
 /trunk/tools/bcp/index.html
 /trunk/tools/quickbook/doc/quickbook.qbk
 /trunk/tools/quickbook/test/stub.cpp
 /trunk/tools/regression/doc/index.html
 /trunk/tools/regression/src/compiler_status.cpp
 /trunk/tools/regression/src/detail/tiny_xml_test.txt
 /trunk/tools/regression/src/library_status.cpp
 /trunk/tools/regression/src/library_test.bat
 /trunk/tools/regression/src/library_test.sh
 /trunk/tools/regression/src/library_test_all.sh
 /trunk/tools/regression/src/regression.py
 /trunk/tools/regression/src/run_tests.sh
 /trunk/tools/regression/test/Jamfile.v2
 /trunk/tools/regression/test/test.bat

=======================================
--- /dev/null
+++ /trunk/tools/bcp/Jamfile.v2 Mon Feb  8 23:37:27 2010
@@ -0,0 +1,37 @@
+# (C) Copyright John Maddock 2006.
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+exe bcp
+    :
+ add_dependent_lib.cpp add_path.cpp bcp_imp.cpp copy_path.cpp file_types.cpp
+    fileview.cpp main.cpp path_operations.cpp scan_cvs_path.cpp
+    licence_info.cpp scan_licence.cpp output_licence_info.cpp
+    /boost/filesystem//boost_filesystem
+    /boost/regex//boost_regex
+    /boost/test//boost_prg_exec_monitor
+    :
+    :
+    release
+    ;
+
+install dist-bin
+    :
+    bcp
+    :
+    <install-type>EXE
+    <location>../../dist/bin
+    :
+    release
+    ;
+
+install dist-lib
+    :
+    bcp
+    :
+    <install-type>LIB
+    <location>../../dist/lib
+    :
+    release
+    ;
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/add_dependent_lib.cpp      Mon Feb  8 23:37:27 2010
@@ -0,0 +1,216 @@
+/*
+ *
+ * Copyright (c) 2009 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the following:
+ *    void bcp_implementation::add_path(const fs::path& p)
+ *    void bcp_implementation::add_directory(const fs::path& p)
+ *    void bcp_implementation::add_file(const fs::path& p)
+ * void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view)
+ */
+
+#include "bcp_imp.hpp"
+#include "fileview.hpp"
+#include <boost/regex.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/exception.hpp>
+#include <iostream>
+
+//
+// This file contains the code required to work out whether the source/header file being scanned
+// is actually dependent upon some library's source code or not.
+//
+
+static std::map<std::string, boost::regex> scanner;
+
+static std::map<std::string, std::set<std::string> > free_function_names;
+static std::map<std::string, std::set<std::string> > class_names;
+static std::map<std::string, std::set<std::string> > variable_names;
+
+static void init_library_scanner(const fs::path& p, bool cvs_mode, const std::string& libname, bool recurse = false)
+{
+   /*
+   if(free_function_names.count(libname) == 0)
+   {
+      free_function_names[libname] = "[\\x0]";
+      class_names[libname] = "[\\x0]";
+      variable_names[libname] = "[\\x0]";
+   }
+   */
+   //
+   // Don't add files created by build system:
+   //
+   if((p.leaf() == "bin") || (p.leaf() == "bin-stage"))
+      return;
+   //
+   // Don't add version control directories:
+   //
+   if((p.leaf() == "CVS") || (p.leaf() == ".svn"))
+      return;
+   //
+   // don't add directories not under version control:
+   //
+   if(cvs_mode && !fs::exists(p / "CVS/Entries"))
+      return;
+   if(cvs_mode && !fs::exists(p / ".svn/entries"))
+      return;
+   //
+   // Enumerate files and directories:
+   //
+   fs::directory_iterator i(p);
+   fs::directory_iterator j;
+   while(i != j)
+   {
+      if(fs::is_directory(*i))
+         init_library_scanner(*i, cvs_mode, libname, true);
+      if(bcp_implementation::is_source_file(*i))
+      {
+         static boost::regex function_scanner(
+            "(?|"                       // Branch reset group
+               "(?:\\<\\w+\\>[^>;{},:]*)"  // Return type
+               "(?:"
+                  "(\\<\\w+\\>)"           // Maybe class name
+                  "\\s*"
+                  "(?:<[^>;{]*>)?"         // Maybe template specialisation
+                  "::\\s*)?"
+               "(\\<(?!throw|if|while|for|catch)\\w+\\>)" // function name
+               "\\s*"
+               "\\("
+                  "[^\\(\\);{}]*"          // argument list
+               "\\)"
+               "\\s*"
+               "\\{"                       // start of definition
+            "|"
+               "(\\<\\w+\\>)"              // Maybe class name
+               "\\s*"
+               "(?:<[^>;{]*>)?"            // Maybe template specialisation
+               "::\\s*"
+ "~?\\1" // function name, same as class name
+               "\\s*"
+               "\\("
+                  "[^\\(\\);{}]*"          // argument list
+               "\\)"
+               "\\s*"
+               "\\{"                       // start of definition
+            ")"                            // end branch reset
+            );
+         fileview view(*i);
+ boost::regex_iterator<const char*> a(view.begin(), view.end(), function_scanner);
+         boost::regex_iterator<const char*> b;
+         while(a != b)
+         {
+            if((*a)[1].matched)
+            {
+               std::string n = a->str(1);
+               class_names[libname].insert(n);
+            }
+            else
+            {
+               std::string n = a->str(2);
+               free_function_names[libname].insert(n);
+            }
+            ++a;
+         }
+      }
+      ++i;
+   }
+
+   if(recurse == false)
+   {
+      //
+      // Build the regular expressions:
+      //
+      const char* e1 =
+         "^(?>[[:blank:]]*)(?!#)[^;{}\\r\\n]*"
+         "(?|"
+         "(?:class|struct)[^:;{}#]*"
+         "(";
+      // list of class names goes here...
+      const char* e2 =
+         ")\\s*(?:<[^;{>]*>\\s*)?(?::[^;{]*)?\\{"
+         "|"
+         "\\<(?!return)\\w+\\>[^:;{}#=<>!~%.\\w]*(";
+         // List of function names goes here...
+      const char* e3 =
+         ")\\s*\\([^;()]*\\)\\s*;)";
+
+      std::string class_name_list;
+ std::set<std::string>::const_iterator i = class_names[libname].begin(), j = class_names[libname].end();
+      if(i != j)
+      {
+         class_name_list = *i;
+         ++i;
+         while(i != j)
+         {
+            class_name_list += "|" + *i;
+            ++i;
+         }
+      }
+      else
+      {
+         class_name_list = "[\\x0]";
+      }
+      std::string function_name_list;
+      i = free_function_names[libname].begin();
+      j = free_function_names[libname].end();
+      if(i != j)
+      {
+         function_name_list = *i;
+         ++i;
+         while(i != j)
+         {
+            function_name_list += "|" + *i;
+            ++i;
+         }
+      }
+      else
+      {
+         function_name_list = "[\\x0]";
+      }
+
+ scanner[libname] = boost::regex(e1 + class_name_list + e2 + function_name_list + e3);
+   }
+}
+
+void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view)
+{
+   //
+   // if the boost library libname has source associated with it
+   // then add the source to our list:
+   //
+   if(fs::exists(m_boost_path / "libs" / libname / "src"))
+   {
+      if(!m_dependencies.count(fs::path("libs") / libname / "src"))
+      {
+         if(scanner.count(libname) == 0)
+ init_library_scanner(m_boost_path / "libs" / libname / "src", m_cvs_mode, libname);
+         boost::cmatch what;
+         if(regex_search(view.begin(), view.end(), what, scanner[libname]))
+         {
+ std::cout << "INFO: tracking source dependencies of library " << libname + << " due to presence of \"" << what << "\" in file " << p << std::endl;
+            //std::cout << "Full text match was: " << what << std::endl;
+ m_dependencies[fs::path("libs") / libname / "src"] = p; // set up dependency tree
+            add_path(fs::path("libs") / libname / "src");
+
+            if(fs::exists(m_boost_path / "libs" / libname / "build"))
+            {
+ if(!m_dependencies.count(fs::path("libs") / libname / "build"))
+               {
+ m_dependencies[fs::path("libs") / libname / "build"] = p; // set up dependency tree
+                  add_path(fs::path("libs") / libname / "build");
+                  //m_dependencies[fs::path("boost-build.jam")] = p;
+                  //add_path(fs::path("boost-build.jam"));
+                  m_dependencies[fs::path("Jamroot")] = p;
+                  add_path(fs::path("Jamroot"));
+                  //m_dependencies[fs::path("tools/build")] = p;
+                  //add_path(fs::path("tools/build"));
+               }
+            }
+         }
+      }
+   }
+}
=======================================
--- /dev/null
+++ /trunk/tools/bcp/add_path.cpp       Mon Feb  8 23:37:27 2010
@@ -0,0 +1,518 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the following:
+ *    void bcp_implementation::add_path(const fs::path& p)
+ *    void bcp_implementation::add_directory(const fs::path& p)
+ *    void bcp_implementation::add_file(const fs::path& p)
+ * void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view)
+ */
+
+#include "bcp_imp.hpp"
+#include "fileview.hpp"
+#include <boost/regex.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/exception.hpp>
+#include <iostream>
+
+
+void bcp_implementation::add_path(const fs::path& p)
+{
+   fs::path normalized_path = p;
+    normalized_path.normalize();
+   if(fs::exists(m_boost_path / normalized_path))
+   {
+      if(fs::is_directory(m_boost_path / normalized_path))
+         add_directory(normalized_path);
+      else
+         add_file(normalized_path);
+   }
+   else
+   {
+ std::cerr << "CAUTION: dependent file " << p.string() << " does not exist." << std::endl; + std::cerr << " Found while scanning file " << m_dependencies[p].string() << std::endl;
+   }
+}
+
+void bcp_implementation::add_directory(const fs::path& p)
+{
+   //
+   // Don't add files created by build system:
+   //
+   if((p.leaf() == "bin") || (p.leaf() == "bin-stage"))
+      return;
+   //
+   // Don't add version control directories:
+   //
+   if((p.leaf() == "CVS") || (p.leaf() == ".svn"))
+      return;
+   //
+   // don't add directories not under version control:
+   //
+   if(m_cvs_mode && !fs::exists(m_boost_path / p / "CVS/Entries"))
+      return;
+   if(m_svn_mode && !fs::exists(m_boost_path / p / ".svn/entries"))
+      return;
+   //
+   // enermerate files and directories:
+   //
+   fs::directory_iterator i(m_boost_path / p);
+   fs::directory_iterator j;
+   while(i != j)
+   {
+      //
+      // we need to convert *i back into
+      // a relative path, what follows is a hack:
+      //
+      std::string s(i->string());
+      if(m_boost_path.string().size())
+         s.erase(0, m_boost_path.string().size() + 1);
+      if(!m_dependencies.count(fs::path(s)))
+      {
+         m_dependencies[fs::path(s)] = p; // set up dependency tree
+         add_path(fs::path(s));
+      }
+      ++i;
+   }
+}
+
+void bcp_implementation::add_file(const fs::path& p)
+{
+   //
+   // if the file does not exist in cvs then don't do anything with it:
+   //
+ if((m_cvs_mode || m_svn_mode) && (m_cvs_paths.find(p) == m_cvs_paths.end()))
+      return;
+   //
+   // if we've already seen the file return:
+   //
+   if(m_copy_paths.find(p) != m_copy_paths.end())
+      return;
+   //
+   // add the file to our list:
+   //
+   m_copy_paths.insert(p);
+   //
+   // if this is a source file, scan for dependencies:
+   //
+   if(is_source_file(p))
+   {
+      add_file_dependencies(p, false);
+   }
+ if(is_jam_file(p) && m_namespace_name.size() && ((std::distance(p.begin(), p.end()) < 3) || (*p.begin() != "tools") || (*++p.begin() != "build")))
+   {
+      //
+      // We're doing a rename of namespaces and library names
+      // so scan for names of libraries:
+      //
+      static const boost::regex e(
+         "\\<lib\\s+(boost\\w+)\\s+[:;]"
+         );
+
+      fileview view(m_boost_path / p);
+ boost::regex_token_iterator<const char*> i(view.begin(), view.end(), e, 1);
+      boost::regex_token_iterator<const char*> j;
+      while(i != j)
+      {
+         m_lib_names.insert(*i);
+         ++i;
+      }
+ static const std::pair<fs::path, std::string> specials_library_names[] = { + std::pair<fs::path, std::string>("libs/python/build/Jamfile.v2", "boost_python"), + std::pair<fs::path, std::string>("libs/python/build/Jamfile.v2", "boost_python3"),
+      };
+
+ for(unsigned int n = 0; n < (sizeof(specials_library_names)/sizeof(specials_library_names[0])); ++n)
+      {
+         if(0 == compare_paths(specials_library_names[n].first, p))
+         {
+            m_lib_names.insert(specials_library_names[n].second);
+         }
+      }
+   }
+   //
+   // if this is a html file, scan for dependencies:
+   //
+   if(is_html_file(p))
+   {
+      static const boost::regex e(
+         "<(?:img[^>]*src=|link[^>]*href=)(\"[^\"]+\"|\\w+)[^>]*>"
+         );
+
+      fileview view(m_boost_path / p);
+ boost::regex_token_iterator<const char*> i(view.begin(), view.end(), e, 1);
+      boost::regex_token_iterator<const char*> j;
+      while(i != j)
+      {
+         //
+         // extract the dependent name:
+         //
+         std::string s(*i);
+         if(s[0] == '\"')
+         {
+            // remove quotes:
+            assert(s.size() > 2);
+            s.erase(0, 1);
+            s.erase(s.size() - 1);
+         }
+         //
+         // Remove any target suffix:
+         //
+         std::string::size_type n = s.find('#');
+         if(n != std::string::npos)
+         {
+            s.erase(n);
+         }
+         //
+         // if the name starts with ./ remove it
+         // or we'll get an error:
+         if(s.compare(0, 2, "./") == 0)
+            s.erase(0, 2);
+         if(s.find(':') == std::string::npos)
+         {
+            // only concatonate if it's a relative path
+            // rather than a URL:
+            fs::path dep(p.branch_path() / s);
+            if(!m_dependencies.count(dep))
+            {
+               m_dependencies[dep] = p; // set up dependency tree
+               add_path(dep);
+            }
+         }
+         ++i;
+      }
+   }
+   //
+   // now scan for "special" dependencies:
+   // anything that we can't automatically detect...
+   //
+static const std::pair<fs::path, fs::path>
+   specials[] = {
+      std::pair<fs::path, fs::path>("boost/config.hpp", "boost/config"),
+ std::pair<fs::path, fs::path>("tools/build/allyourbase.jam", "Jamrules"), + std::pair<fs::path, fs::path>("tools/build/allyourbase.jam", "project-root.jam"), + std::pair<fs::path, fs::path>("tools/build/allyourbase.jam", "boost-build.jam"), + std::pair<fs::path, fs::path>("tools/build/v1/allyourbase.jam", "Jamrules"), + std::pair<fs::path, fs::path>("tools/build/v1/allyourbase.jam", "project-root.jam"), + std::pair<fs::path, fs::path>("tools/build/v1/allyourbase.jam", "boost-build.jam"), + std::pair<fs::path, fs::path>("tools/build/v2/boost-build.jam", "Jamrules"), + std::pair<fs::path, fs::path>("tools/build/v2/boost-build.jam", "project-root.jam"), + std::pair<fs::path, fs::path>("tools/build/v2/boost-build.jam", "boost-build.jam"), + std::pair<fs::path, fs::path>("tools/build/v2/boost-build.jam", "Jamfile.v2"), + std::pair<fs::path, fs::path>("boost/preprocessor/iterate.hpp", "boost/preprocessor/iteration"), + std::pair<fs::path, fs::path>("boost/preprocessor/slot/slot.hpp", "boost/preprocessor/slot/detail"), + std::pair<fs::path, fs::path>("boost/function.hpp", "boost/function/detail"), + std::pair<fs::path, fs::path>("boost/regex/config.hpp", "boost/regex/user.hpp"), + std::pair<fs::path, fs::path>("boost/signals/signal_template.hpp", "boost/function"), + std::pair<fs::path, fs::path>("boost/mpl/list.hpp", "boost/mpl/list"), + std::pair<fs::path, fs::path>("boost/mpl/list_c.hpp", "boost/mpl/list"), + std::pair<fs::path, fs::path>("boost/mpl/vector.hpp", "boost/mpl/vector"), + std::pair<fs::path, fs::path>("boost/mpl/deque.hpp", "boost/mpl/vector"), + std::pair<fs::path, fs::path>("boost/mpl/vector_c.hpp", "boost/mpl/vector"),
+      std::pair<fs::path, fs::path>("boost/mpl/map.hpp", "boost/mpl/map"),
+      std::pair<fs::path, fs::path>("boost/mpl/set.hpp", "boost/mpl/set"),
+ std::pair<fs::path, fs::path>("boost/mpl/set_c.hpp", "boost/mpl/set"), + std::pair<fs::path, fs::path>("boost/mpl/aux_/include_preprocessed.hpp", "boost/mpl/aux_/preprocessed"), + std::pair<fs::path, fs::path>("boost/mpl/vector/aux_/include_preprocessed.hpp", "boost/mpl/vector/aux_/preprocessed"), + std::pair<fs::path, fs::path>("boost/mpl/set/aux_/include_preprocessed.hpp", "boost/mpl/set/aux_/preprocessed"), + std::pair<fs::path, fs::path>("boost/mpl/map/aux_/include_preprocessed.hpp", "boost/mpl/map/aux_/preprocessed"), + std::pair<fs::path, fs::path>("boost/mpl/list/aux_/include_preprocessed.hpp", "boost/mpl/list/aux_/preprocessed"), + std::pair<fs::path, fs::path>("libs/graph/src/python/visitor.hpp", "libs/graph/src/python"), + std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/test/src"), + std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/test/build"), + std::pair<fs::path, fs::path>("boost/typeof.hpp", "boost/typeof/incr_registration_group.hpp"), + std::pair<fs::path, fs::path>("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail/pp_cc_loop"), + std::pair<fs::path, fs::path>("boost/function_types/components.hpp", "boost/function_types/detail/components_impl"), + std::pair<fs::path, fs::path>("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail"), + std::pair<fs::path, fs::path>("boost/math/tools/rational.hpp", "boost/math/tools/detail"), + std::pair<fs::path, fs::path>("boost/proto/repeat.hpp", "boost/proto/detail/local.hpp"), + std::pair<fs::path, fs::path>("boost/signals/signal_template.hpp", "boost/function"), + std::pair<fs::path, fs::path>("boost/preprocessor/slot/counter.hpp", "boost/preprocessor/slot/detail/counter.hpp"), + std::pair<fs::path, fs::path>("boost/graph/distributed/detail/tag_allocator.hpp", "libs/graph_parallel"), + std::pair<fs::path, fs::path>("boost/graph/distributed/mpi_process_group.hpp", "libs/graph_parallel"),
+   };
+
+   for(unsigned int n = 0; n < (sizeof(specials)/sizeof(specials[0])); ++n)
+   {
+      if(0 == compare_paths(specials[n].first, p))
+      {
+         if(!m_dependencies.count(specials[n].second))
+         {
+ m_dependencies[specials[n].second] = p; // set up dependency tree
+            add_path(specials[n].second);
+         }
+      }
+   }
+
+}
+
+void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile)
+{
+   static const boost::regex e(
+      
"^[[:blank:]]*(?://@bcp[[:blank:]]+([^\\n]*)\n)?#[[:blank:]]*include[[:blank:]]*[\"<]([^\">]+)[\">]"
+      );
+
+   if(!m_dependencies.count(p))
+      m_dependencies[p] = p; // set terminal dependency
+
+   fileview view;
+   if(scanfile)
+      view.open(p);
+   else
+      view.open(m_boost_path / p);
+   if(m_license_mode && !scanfile)
+      scan_license(p, view);
+   const int subs[] = { 1, 2 };
+ boost::regex_token_iterator<const char*> i(view.begin(), view.end(), e, subs);
+   boost::regex_token_iterator<const char*> j;
+   while(i != j)
+   {
+      //
+      // *i contains the name of the include file,
+      // check first for a file of that name in the
+      // same directory as the file we are scanning,
+      // and if that fails, then check the boost-root:
+      //
+      fs::path include_file;
+      try{
+         std::string discart_message = *i;
+         ++i;
+         if(discart_message.size())
+         {
+            // The include is optional and should be discarded:
+ std::cout << "Optional functionality won't be copied: " << discart_message << std::endl; + std::cout << "Add the file " << *i << " to the list of dependencies to extract to copy this functionality." << std::endl;
+            ++i;
+            continue;
+         }
+         include_file = i->str();
+      }
+      catch(const fs::filesystem_error&)
+      {
+ std::cerr << "Can't parse filename " << *i << " included by file " << p.string() << std::endl;
+         ++i;
+         continue;
+      }
+      fs::path test_file(m_boost_path / p.branch_path() / include_file);
+ if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.branch_path().string() != "boost"))
+      {
+         if(!m_dependencies.count(p.branch_path() / include_file))
+         {
+            m_dependencies[p.branch_path() / include_file] = p;
+            add_path(p.branch_path() / include_file);
+         }
+      }
+      else if(fs::exists(m_boost_path / include_file))
+      {
+         if(!m_dependencies.count(include_file))
+         {
+            m_dependencies[include_file] = p;
+            add_path(include_file);
+         }
+      }
+      ++i;
+   }
+   //
+   // Now we need to scan for Boost.Preprocessor includes that
+   // are included via preprocessor iteration:
+   //
+ static const boost::regex ppfiles("^[[:blank:]]*#[[:blank:]]*define[[:blank:]]+(?:BOOST_PP_FILENAME| BOOST_PP_ITERATION_PARAMS| BOOST_PP_INDIRECT_SELF)[^\\n]+?[\"<]([^\">]+)[\">]"); + i = boost::regex_token_iterator<const char*>(view.begin(), view.end(), ppfiles, 1);
+   while(i != j)
+   {
+      //
+      // *i contains the name of the include file,
+      // check first for a file of that name in the
+      // same directory as the file we are scanning,
+      // and if that fails, then check the boost-root:
+      //
+      fs::path include_file;
+      try{
+         include_file = i->str();
+      }
+      catch(const fs::filesystem_error&)
+      {
+ std::cerr << "Can't parse filename " << *i << " included by file " << p.string() << std::endl;
+         ++i;
+         continue;
+      }
+      fs::path test_file(m_boost_path / p.branch_path() / include_file);
+ if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.branch_path().string() != "boost"))
+      {
+         if(!m_dependencies.count(p.branch_path() / include_file))
+         {
+            m_dependencies[p.branch_path() / include_file] = p;
+            add_path(p.branch_path() / include_file);
+         }
+      }
+      else if(fs::exists(m_boost_path / include_file))
+      {
+         if(!m_dependencies.count(include_file))
+         {
+            m_dependencies[include_file] = p;
+            add_path(include_file);
+         }
+      }
+      else
+      {
+ std::cerr << "CAUTION: Boost.Preprocessor iterated file " << include_file.string() << " does not exist." << std::endl;
+      }
+      ++i;
+   }
+
+   //
+   // Scan for any #include MACRO includes that we don't recognise.
+   //
+   // Begin by declaring all of the macros that get #included that
+   // we know about and are correctly handled as special cases:
+   //
+   static const std::string known_macros[] = {
+      "AUX778076_INCLUDE_STRING",
+      
"BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/AUX778076_PREPROCESSED_HEADER)",
+      "BOOST_USER_CONFIG",
+      "BOOST_COMPILER_CONFIG",
+      "BOOST_STDLIB_CONFIG",
+      "BOOST_PLATFORM_CONFIG",
+      "BOOST_PP_FILENAME_1",
+      "BOOST_PP_ITERATION_PARAMS_1",
+      "BOOST_PP_FILENAME_2",
+      "BOOST_PP_ITERATION_PARAMS_2",
+      "BOOST_PP_FILENAME_3",
+      "BOOST_PP_ITERATION_PARAMS_3",
+      "BOOST_PP_FILENAME_4",
+      "BOOST_PP_ITERATION_PARAMS_4",
+      "BOOST_PP_FILENAME_5",
+      "BOOST_PP_ITERATION_PARAMS_5",
+      "BOOST_PP_INDIRECT_SELF",
+      "BOOST_PP_INCLUDE_SELF()",
+      "BOOST_PP_ITERATE",
+      "BOOST_PP_LOCAL_ITERATE",
+      "BOOST_PP_ITERATE()",
+      "BOOST_PP_LOCAL_ITERATE()",
+      "BOOST_PP_ASSIGN_SLOT(1)",
+      "BOOST_PP_ASSIGN_SLOT(2)",
+      "BOOST_PP_ASSIGN_SLOT(3)",
+      "BOOST_PP_ASSIGN_SLOT(4)",
+      "BOOST_PP_ASSIGN_SLOT(5)",
+      "BOOST_ABI_PREFIX",
+      "BOOST_ABI_SUFFIX",
+      
"BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/AUX_PREPROCESSED_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_C_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/map/aux_/preprocessed/AUX778076_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/map/AUX778076_MAP_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/set/aux_/preprocessed/AUX778076_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/set/AUX778076_SET_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/set/AUX778076_SET_C_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_HEADER)",
+      
"BOOST_PP_STRINGIZE(boost/mpl/vector/aux_/preprocessed/AUX778076_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_DEQUE_HEADER)",
+      "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_C_HEADER)",
+      "BOOST_REGEX_USER_CONFIG",
+      "BGL_PYTHON_EVENTS_HEADER",
+      "B1",
+      "B2",
+      "BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()",
+      "BOOST_SLIST_HEADER",
+      "BOOST_HASH_SET_HEADER",
+      "BOOST_HASH_MAP_HEADER",
+      "BOOST_INTRUSIVE_INVARIANT_ASSERT_INCLUDE",
+      "BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE",
+      "BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE",
+      "BOOST_FT_loop",
+      "BOOST_FT_AL_PREPROCESSED",
+      "BOOST_FT_AL_INCLUDE_FILE",
+      "__FILE__",
+      "BOOST_FT_cc_file",
+      "BOOST_FT_variate_file",
+      "BOOST_USER_CONFIG",
+      "BOOST_HEADER()",
+      "BOOST_TR1_STD_HEADER(utility)",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(tuple))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(random))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(array))",
+      "BOOST_TR1_HEADER(cmath)",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(complex))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(functional))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(memory))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(regex))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(type_traits))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(unordered_map))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(unordered_set))",
+      "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(utility))",
+      "BOOST_PROTO_LOCAL_ITERATE()",
+      "BOOST_SIGNAL_FUNCTION_N_HEADER",
+      "BOOST_PP_UPDATE_COUNTER()",
+  };
+
+ static const boost::regex indirect_includes("^[[:blank:]]*#[[:blank:]]*include[[:blank:]]+([^\"<][^\n]*?)[[:blank:]]*$"); + i = boost::regex_token_iterator<const char*>(view.begin(), view.end(), indirect_includes, 1);
+   while(i != j)
+   {
+ const std::string* known_macros_end = known_macros + sizeof(known_macros)/sizeof(known_macros[0]); + if(known_macros_end == std::find(known_macros, known_macros_end, i->str()))
+      {
+ std::cerr << "CAUTION: don't know how to trace depenencies through macro: \"" << *i << "\" in file: " << p.string() << std::endl;
+      }
+      ++i;
+   }
+   //
+   // if the file contains a cpp_main / unit_test_main / test_main
+   // it is dependent upon Boost.test even if it doesn't
+   // include any of the Boost.test headers directly.
+   //
+ static const boost::regex m("^\\s*int\\s+(?:cpp_main|test_main| unit_test_main)");
+   boost::cmatch what;
+   if(boost::regex_search(view.begin(), view.end(), what, m))
+   {
+      add_dependent_lib("test", p, view);
+   }
+   if(!scanfile)
+   {
+      //
+      // grab the name of the library to which the header belongs,
+      // and if that library has source then add the source to our
+      // list:
+      //
+      // this regex catches boost/libname.hpp or boost/libname/whatever:
+      //
+      static const boost::regex lib1("boost/([^\\./]+)(?!detail).*");
+      boost::smatch swhat;
+      if(boost::regex_match(p.string(), swhat, lib1))
+      {
+         add_dependent_lib(swhat.str(1), p, view);
+      }
+      //
+ // and this one catches boost/x/y/whatever (for example numeric/ublas):
+      //
+      static const boost::regex lib2("boost/([^/]+/[^/]+)/(?!detail).*");
+      if(boost::regex_match(p.string(), swhat, lib2))
+      {
+         add_dependent_lib(swhat.str(1), p, view);
+      }
+   }
+   if(m_list_namespaces)
+   {
+      //
+      // scan for top level namespaces and add to our list:
+      //
+      static const boost::regex namespace_scanner(
+         
"^(?<!\\\\\\n)[[:blank:]]*+namespace\\s++(\\w++)\\s++(\\{[^{}]*(?:(?2)[^{}]*)*\\})"
+         );
+ i = boost::regex_token_iterator<const char*>(view.begin(), view.end(), namespace_scanner, 1);
+      while(i != j)
+      {
+         if(m_top_namespaces.count(*i) == 0)
+         {
+            //std::cout << *i << " (Found in " << p << ")" << std::endl;
+            m_top_namespaces[*i] = p;
+         }
+         ++i;
+      }
+   }
+}
=======================================
--- /dev/null
+++ /trunk/tools/bcp/bcp.hpp    Mon Feb  8 23:37:27 2010
@@ -0,0 +1,41 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+#include <boost/shared_ptr.hpp>
+
+class bcp_application;
+typedef boost::shared_ptr<bcp_application> pbcp_application;
+
+class bcp_application
+{
+public:
+   virtual ~bcp_application();
+
+   virtual void enable_list_mode() = 0;
+   virtual void enable_summary_list_mode() = 0;
+   virtual void enable_cvs_mode() = 0;
+   virtual void enable_svn_mode() = 0;
+   virtual void enable_unix_lines() = 0;
+   virtual void enable_scan_mode() = 0;
+   virtual void enable_license_mode() = 0;
+   virtual void enable_bsl_convert_mode() = 0;
+   virtual void enable_bsl_summary_mode() = 0;
+   virtual void set_boost_path(const char* p) = 0;
+   virtual void set_destination(const char* p) = 0;
+   virtual void add_module(const char* p) = 0;
+   virtual void set_namespace(const char* name) = 0;
+   virtual void set_namespace_alias(bool) = 0;
+   virtual void set_namespace_list(bool) = 0;
+
+   virtual int run() = 0;
+
+   static pbcp_application create();
+};
+
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/bcp_imp.cpp        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,302 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the bcp_implementation virtuals.
+ */
+
+#include "bcp_imp.hpp"
+#include "licence_info.hpp"
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <iostream>
+#include <stdexcept>
+#include <boost/regex.hpp>
+#include <string>
+
+bcp_implementation::bcp_implementation()
+ : m_list_mode(false), m_list_summary_mode(false), m_license_mode(false), m_cvs_mode(false), + m_svn_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false), + m_bsl_summary_mode(false), m_namespace_alias(false), m_list_namespaces(false)
+{
+}
+
+bcp_implementation::~bcp_implementation()
+{
+}
+
+bcp_application::~bcp_application()
+{
+}
+
+void bcp_implementation::enable_list_mode()
+{
+   m_list_mode = true;
+}
+
+void bcp_implementation::enable_summary_list_mode()
+{
+   m_list_mode = true;
+   m_list_summary_mode = true;
+}
+
+void bcp_implementation::enable_cvs_mode()
+{
+   m_cvs_mode = true;
+}
+
+void bcp_implementation::enable_svn_mode()
+{
+   m_svn_mode = true;
+}
+
+void bcp_implementation::enable_scan_mode()
+{
+   m_scan_mode = true;
+}
+
+void bcp_implementation::enable_license_mode()
+{
+   m_license_mode = true;
+}
+
+void bcp_implementation::enable_bsl_convert_mode()
+{
+   m_bsl_convert_mode = true;
+}
+
+void bcp_implementation::enable_bsl_summary_mode()
+{
+   m_bsl_summary_mode = true;
+}
+
+void bcp_implementation::enable_unix_lines()
+{
+   m_unix_lines = true;
+}
+
+void bcp_implementation::set_boost_path(const char* p)
+{
+   // Hack to strip trailing slashes from the path
+   m_boost_path = (fs::path(p, fs::native) / "boost").parent_path();
+   fs::path check = m_boost_path / "boost" / "version.hpp";
+   if(!fs::exists(check))
+   {
+ std::string s = "The Boost path appears to have been incorrectly set: could not find boost/version.hpp in ";
+      s += m_boost_path.string();
+      std::runtime_error e(s);
+      throw e;
+   }
+}
+
+void bcp_implementation::set_destination(const char* p)
+{
+   m_dest_path = fs::path(p, fs::native);
+}
+
+void bcp_implementation::add_module(const char* p)
+{
+   m_module_list.push_back(p);
+}
+
+void bcp_implementation::set_namespace(const char* name)
+{
+   m_namespace_name = name;
+}
+
+void bcp_implementation::set_namespace_alias(bool b)
+{
+   m_namespace_alias = b;
+}
+
+void bcp_implementation::set_namespace_list(bool b)
+{
+   m_list_namespaces = b;
+   m_list_mode = b;
+}
+
+fs::path get_short_path(const fs::path& p)
+{
+   // truncate path no more than "x/y":
+   std::string s = p.string();
+   std::string::size_type n = s.find('/');
+   if(n != std::string::npos)
+   {
+      n = s.find('/', n+1);
+      if(n != std::string::npos)
+         s.erase(n);
+   }
+   return s;
+}
+
+int bcp_implementation::run()
+{
+   //
+   // check output path is OK:
+   //
+   if(!m_list_mode && !m_license_mode && !fs::exists(m_dest_path))
+   {
+      std::string msg("Destination path does not exist: ");
+      msg.append(m_dest_path.native_file_string());
+      std::runtime_error e(msg);
+      boost::throw_exception(e);
+   }
+   //
+   // Check Boost path is OK if it hasn't been checked already:
+   //
+   if(m_boost_path == "")
+   {
+      set_boost_path("");
+   }
+   // start by building a list of permitted files
+   // if m_cvs_mode is true:
+   if(m_cvs_mode)
+   {
+ std::cerr << "CAUTION: Boost is no longer in CVS, cvs mode may not work anymore!!!" << std::endl;
+      scan_cvs_path(fs::path());
+   }
+   if(m_svn_mode)
+   {
+      scan_svn_path(fs::path());
+   }
+   //
+   // if in license mode, try to load more/blanket_permission.txt
+   //
+ fs::path blanket_permission(m_boost_path / "more" / "blanket-permission.txt");
+   if (fs::exists(blanket_permission)) {
+     fs::ifstream in(blanket_permission);
+     std::string line;
+     while (std::getline(in, line)) {
+       static const boost::regex e("([^(]+)\\(");
+       boost::smatch result;
+       if (boost::regex_search(line, result, e))
+         m_bsl_authors.insert(format_authors_name(result[1]));
+     }
+   }
+
+   //
+   // scan through modules looking for the equivalent
+   // file to add to our list:
+   //
+   std::list<std::string>::const_iterator i = m_module_list.begin();
+   std::list<std::string>::const_iterator j = m_module_list.end();
+   while(i != j)
+   {
+      //
+      // convert *i to a path - could be native or portable:
+      //
+      fs::path module;
+      fs::path exmodule;
+      try{
+         module = fs::path(*i);
+         exmodule = fs::path(*i + ".hpp");
+      }
+      catch(...)
+      {
+         module = fs::path(*i, fs::native);
+         exmodule = fs::path(*i + ".hpp", fs::native);
+      }
+
+      if(m_scan_mode)
+      {
+         // in scan mode each module must be a real file:
+         add_file_dependencies(module, true);
+      }
+      else
+      {
+         int count = 0;
+         if(fs::exists(m_boost_path / "tools" / module))
+         {
+            add_path(fs::path("tools") / module);
+            ++count;
+         }
+         if(fs::exists(m_boost_path / "libs" / module))
+         {
+            add_path(fs::path("libs") / module);
+            ++count;
+         }
+         if(fs::exists(m_boost_path / "boost" / module))
+         {
+            add_path(fs::path("boost") / module);
+            ++count;
+         }
+         if(fs::exists(m_boost_path / "boost" / exmodule))
+         {
+            add_path(fs::path("boost") / exmodule);
+            ++count;
+         }
+         if(fs::exists(m_boost_path / module))
+         {
+            add_path(module);
+            ++count;
+         }
+      }
+      ++i;
+   }
+   //
+   // now perform output:
+   //
+   if(m_list_namespaces)
+   {
+      // List the namespaces, in two lists, headers and source files
+      // first, then everything else afterwards:
+      //
+ boost::regex important_file("boost/.*| libs/[^/]*/(?:[^/]*/)?/src/.*");
+      std::map<std::string, fs::path>::const_iterator i, j;
+      i = m_top_namespaces.begin();
+      j = m_top_namespaces.end();
+ std::cout << "\n\nThe top level namespaces found for header and source files were:\n";
+      while(i != j)
+      {
+         if(regex_match(i->second.string(), important_file))
+ std::cout << i->first << " (from " << i->second << ")" << std::endl;
+         ++i;
+      }
+
+      i = m_top_namespaces.begin();
+ std::cout << "\n\nThe top level namespaces found for all other source files were:\n";
+      while(i != j)
+      {
+         if(!regex_match(i->second.string(), important_file))
+ std::cout << i->first << " (from " << i->second << ")" << std::endl;
+         ++i;
+      }
+      return 0;
+   }
+   std::set<fs::path, path_less>::iterator m, n;
+   std::set<fs::path, path_less> short_paths;
+   m = m_copy_paths.begin();
+   n = m_copy_paths.end();
+   if(!m_license_mode)
+   {
+      while(m != n)
+      {
+         if(m_list_summary_mode)
+         {
+            fs::path p = get_short_path(*m);
+            if(short_paths.find(p) == short_paths.end())
+            {
+               short_paths.insert(p);
+               std::cout << p.string() << "\n";
+            }
+         }
+         else if(m_list_mode)
+            std::cout << m->string() << "\n";
+         else
+            copy_path(*m);
+         ++m;
+      }
+   }
+   else
+      output_license_info();
+   return 0;
+}
+
+pbcp_application bcp_application::create()
+{
+ pbcp_application result(static_cast<bcp_application*>(new bcp_implementation()));
+   return result;
+}
=======================================
--- /dev/null
+++ /trunk/tools/bcp/bcp_imp.hpp        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,118 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+#include "bcp.hpp"
+#include <string>
+#include <cstring>
+#include <list>
+#include <set>
+#include <map>
+#include <boost/filesystem/path.hpp>
+
+namespace fs = boost::filesystem;
+
+class fileview;
+
+//
+//path operations:
+//
+int compare_paths(const fs::path& a, const fs::path& b);
+inline bool equal_paths(const fs::path& a, const fs::path& b)
+{ return compare_paths(a, b) == 0; }
+
+struct path_less
+{
+   bool operator()(const fs::path& a, const fs::path& b)const
+   { return compare_paths(a, b) < 0; }
+};
+
+struct license_data
+{
+   std::set<fs::path, path_less> files;
+   std::set<std::string>         authors;
+};
+
+class bcp_implementation
+   : public bcp_application
+{
+public:
+   bcp_implementation();
+   ~bcp_implementation();
+   static bool is_source_file(const fs::path& p);
+   static bool is_html_file(const fs::path& p);
+   static bool is_jam_file(const fs::path& p);
+private:
+   //
+   // the following are the overridden virtuals from the base class:
+   //
+   void enable_list_mode();
+   void enable_summary_list_mode();
+   void enable_cvs_mode();
+   void enable_svn_mode();
+   void enable_unix_lines();
+   void enable_scan_mode();
+   void enable_license_mode();
+   void enable_bsl_convert_mode();
+   void enable_bsl_summary_mode();
+   void set_boost_path(const char* p);
+   void set_destination(const char* p);
+   void add_module(const char* p);
+   void set_namespace(const char* name);
+   void set_namespace_alias(bool);
+   void set_namespace_list(bool);
+
+   virtual int run();
+
+   // internal helper functions:
+   bool is_binary_file(const fs::path& p);
+   void scan_cvs_path(const fs::path& p);
+   void scan_svn_path(const fs::path& p);
+   void add_path(const fs::path& p);
+   void add_directory(const fs::path& p);
+   void add_file(const fs::path& p);
+   void copy_path(const fs::path& p);
+   void add_file_dependencies(const fs::path& p, bool scanfile);
+ void add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view);
+   void create_path(const fs::path& p);
+   // license code:
+   void scan_license(const fs::path& p, const fileview& v);
+   void output_license_info();
+
+   std::list<std::string> m_module_list; // the modules to process
+   bool m_list_mode;                     // list files only
+   bool m_list_summary_mode;             // list file summary only
+ bool m_license_mode; // generate license information for files listed
+   bool m_cvs_mode;                      // check cvs for files
+   bool m_svn_mode;                      // check svn for files
+   bool m_unix_lines;                    // fix line endings
+   bool m_scan_mode;                     // scan non-boost files.
+   bool m_bsl_convert_mode;              // try to convert to the BSL
+   bool m_bsl_summary_mode;              // summarise BSL issues only
+ bool m_namespace_alias; // make "boost" a namespace alias when doing a namespace rename. + bool m_list_namespaces; // list all the top level namespaces found.
+   fs::path m_boost_path;                // the path to the boost root
+   fs::path m_dest_path;                 // the path to copy to
+ std::map<fs::path, bool, path_less> m_cvs_paths; // valid files under cvs control + std::set<fs::path, path_less> m_copy_paths; // list of files to copy + std::map<int, license_data> m_license_data; // licenses in use + std::set<fs::path, path_less> m_unknown_licenses; // files with no known license + std::set<fs::path, path_less> m_unknown_authors; // files with no known copyright/author + std::set<fs::path, path_less> m_can_migrate_to_bsl; // files that can migrate to the BSL + std::set<fs::path, path_less> m_cannot_migrate_to_bsl; // files that cannot migrate to the BSL + std::set<std::string> m_bsl_authors; // authors giving blanket permission to use the BSL + std::set<std::string> m_authors_for_bsl_migration; // authors we need for BSL migration
+   std::map<fs::path, std::pair<std::string, std::string>, path_less>
+ m_converted_to_bsl; + std::map<std::string, std::set<fs::path, path_less> > m_author_data; // all the authors + std::map<fs::path, fs::path, path_less> m_dependencies; // dependency information + std::string m_namespace_name; // namespace rename. + std::set<std::string> m_lib_names; // List of library binary names + std::map<std::string, fs::path> m_top_namespaces; // List of top level namespace names
+};
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/copy_path.cpp      Mon Feb  8 23:37:27 2010
@@ -0,0 +1,205 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the following:
+ *    void bcp_implementation::copy_path(const fs::path& p)
+ *    void bcp_implementation::create_path(const fs::path& p)
+ */
+
+#include "bcp_imp.hpp"
+#include "fileview.hpp"
+#include <boost/filesystem/operations.hpp>
+#include <boost/regex.hpp>
+#include <fstream>
+#include <iterator>
+#include <algorithm>
+#include <iostream>
+
+struct get_new_library_name
+{
+   get_new_library_name(const std::string& n) : m_new_name(n) {}
+   template <class I>
+   std::string operator()(const boost::match_results<I>& what)
+   {
+      std::string s = what[0];
+      std::string::size_type n = s.find("boost");
+      if(n == std::string::npos)
+      {
+         s.insert(0, m_new_name);
+      }
+      else
+      {
+         s.replace(n, 5, m_new_name);
+      }
+      return s;
+   }
+private:
+   std::string m_new_name;
+};
+
+void bcp_implementation::copy_path(const fs::path& p)
+{
+   assert(!fs::is_directory(m_boost_path / p));
+   if(fs::exists(m_dest_path / p))
+   {
+ std::cout << "Copying (and overwriting) file: " << p.string() << "\n";
+     fs::remove(m_dest_path / p);
+   }
+   else
+      std::cout << "Copying file: " << p.string() << "\n";
+   //
+   // create the path to the new file if it doesn't already exist:
+   //
+   create_path(p.branch_path());
+   //
+   // do text based copy if requested:
+   //
+   if(m_namespace_name.size() && m_lib_names.size() && is_jam_file(p))
+   {
+      static std::vector<char> v1, v2;
+      v1.clear();
+      v2.clear();
+      std::ifstream is((m_boost_path / p).native_file_string().c_str());
+ std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1));
+
+      static boost::regex libname_matcher;
+      if(libname_matcher.empty())
+      {
+         std::string re = "\\<";
+         re += *m_lib_names.begin();
+ for(std::set<std::string>::const_iterator i = ++m_lib_names.begin(); i != m_lib_names.end(); ++i)
+         {
+            re += "|" + *i;
+         }
+         re += "\\>";
+         libname_matcher.assign(re);
+      }
+
+ regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), libname_matcher, get_new_library_name(m_namespace_name));
+      std::swap(v1, v2);
+      v2.clear();
+
+      std::ofstream os;
+      if(m_unix_lines)
+ os.open((m_dest_path / p).native_file_string().c_str(), std::ios_base::binary | std::ios_base::out);
+      else
+ os.open((m_dest_path / p).native_file_string().c_str(), std::ios_base::out);
+      os.write(&*v1.begin(), v1.size());
+      os.close();
+   }
+   else if(m_namespace_name.size() && is_source_file(p))
+   {
+      //
+      // v1 hold the current content, v2 is temp buffer.
+      // Each time we do a search and replace the new content
+      // ends up in v2: we then swap v1 and v2, and clear v2.
+      //
+      static std::vector<char> v1, v2;
+      v1.clear();
+      v2.clear();
+      std::ifstream is((m_boost_path / p).native_file_string().c_str());
+ std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1));
+
+      static const boost::regex namespace_matcher(
+         "(?|"
+            "(namespace\\s+)boost(_\\w+)?"
+         "|"
+            "(namespace\\s+)(adstl|phoenix|rapidxml)\\>"
+         "|"
+            "()boost((?:_\\w+)?\\s*(?:::|,|\\)))"
+         "|"
+            "()((?:adstl|phoenix|rapidxml)\\s*(?:::|,|\\)))"
+         "|"
+            "(namespace\\s+\\w+\\s*=\\s*(?:::\\s*)?)boost(_\\w+)?"
+         "|"
+ "(namespace\\s+\\w+\\s*=\\s*(?:::\\s*)?)(adstl|phoenix| rapidxml)\\>"
+         "|"
+            "(^\\s*#\\s*define[^\\n]+)boost((?:_\\w+)?\\s*)$"
+         "|"
+            "(^\\s*#\\s*define[^\\n]+)((?:adstl|phoenix|rapidxml)\\s*)$"
+         ")"
+         );
+
+ regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_matcher, "$1" + m_namespace_name + "$2");
+      std::swap(v1, v2);
+      v2.clear();
+
+      if(m_namespace_alias)
+      {
+         static const boost::regex namespace_alias(
+            /*
+            "namespace\\s+" + m_namespace_name +
+            "\\s*"
+            "("
+               "\\{"
+               "(?:"
+                  "(?>[^\\{\\}/]+)"
+                  "(?>"
+                     "(?:"
+                        "(?1)"
+                        "|//[^\\n]+$"
+                        "|/[^/]"
+                        "|(?:^\\s*#[^\\n]*"
+                           "(?:(?<=\\\\)\\n[^\\n]*)*)"
+                     ")"
+                     "[^\\{\\}]+"
+                  ")*"
+               ")*"
+               "\\}"
+            ")"
+            */
+            /*
+            "(namespace\\s+" + m_namespace_name +
+            "\\s*\\{.*"
+            "\\})([^\\{\\};]*)\\z"
+            */
+            "namespace\\s+" + m_namespace_name +
+            "\\s*\\{"
+            );
+ regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_alias, + "namespace " + m_namespace_name + "{} namespace boost = " + m_namespace_name + "; namespace " + m_namespace_name + "{");
+         std::swap(v1, v2);
+         v2.clear();
+      }
+
+      std::ofstream os;
+      if(m_unix_lines)
+ os.open((m_dest_path / p).native_file_string().c_str(), std::ios_base::binary | std::ios_base::out);
+      else
+ os.open((m_dest_path / p).native_file_string().c_str(), std::ios_base::out);
+      os.write(&*v1.begin(), v1.size());
+      os.close();
+   }
+   else if(m_unix_lines && !is_binary_file(p))
+   {
+      std::ifstream is((m_boost_path / p).native_file_string().c_str());
+      std::istreambuf_iterator<char> isi(is);
+      std::istreambuf_iterator<char> end;
+
+ std::ofstream os((m_dest_path / p).native_file_string().c_str(), std::ios_base::binary | std::ios_base::out);
+      std::ostreambuf_iterator<char> osi(os);
+
+      std::copy(isi, end, osi);
+   }
+   else
+   {
+      // binary copy:
+      fs::copy_file(m_boost_path / p, m_dest_path / p);
+   }
+}
+
+void bcp_implementation::create_path(const fs::path& p)
+{
+   if(!fs::exists(m_dest_path / p))
+   {
+      // recurse then create the path:
+      create_path(p.branch_path());
+      fs::create_directory(m_dest_path / p);
+   }
+}
+
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/doc/Jamfile.v2     Mon Feb  8 23:37:27 2010
@@ -0,0 +1,22 @@
+
+# Copyright John Maddock 2005. Use, modification, and distribution are
+# subject to the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+using quickbook ;
+
+xml bcp : bcp.qbk ;
+boostbook standalone
+    :
+        bcp
+    :
+        # How far down we chunk nested sections, basically all of them:
+        <xsl:param>chunk.section.depth=0
+        # Path for links to Boost:
+        <xsl:param>boost.root=../../../..
+        # Path for libraries index:
+        <xsl:param>boost.libraries=../../../../libs/libraries.htm
+        # Use the main Boost stylesheet:
+        <xsl:param>html.stylesheet=../../../../doc/html/boostbook.css
+   ;
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/doc/bcp.qbk        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,209 @@
+
+[article BCP
+    [quickbook 1.4]
+    [copyright 2209 John Maddock]
+    [purpose Regular Expressions]
+    [license
+        Distributed under the Boost Software License, Version 1.0.
+        (See accompanying file LICENSE_1_0.txt or copy at
+        [@http://www.boost.org/LICENSE_1_0.txt])
+    ]
+    [authors [Maddock, John]]
+    [category text]
+    [/last-revision $Date: 2008-02-21 12:58:15 +0000 (Thu, 21 Feb 2008) $]
+]
+
+[section:overview Overview]
+
+The bcp utility is a tool for extracting subsets of Boost, it's useful for Boost authors who want to distribute +their library separately from Boost, and for Boost users who want to distribute a subset of Boost with their application.
+
+bcp can also report on which parts of Boost your code is dependent on, and what licences are used by those dependencies.
+
+[endsect]
+
+[section:examples Examples]
+
+[pre
+bcp scoped_ptr /foo
+]
+
+Copies boost/scoped_ptr.hpp and dependencies to /foo.
+
+[pre
+bcp boost/regex.hpp /foo
+]
+
+Copies boost/regex.hpp and all dependencies including the regex source code (in libs/regex/src) and +build files (in libs/regex/build) to /foo. Does not copy the regex documentation, test, or example code.
+
+[pre
+bcp regex /foo
+]
+
+Copies the full regex lib (in libs/regex) including dependencies (such as the boost.test source required
+by the regex test programs) to /foo.
+
+[pre
+bcp --namespace=myboost --namespace-alias regex config build /foo
+]
+
+Copies the full regex lib (in libs\/regex) plus the config lib (libs\/config) and the build system (tools\/build) +to \/foo including all the dependencies. Also renames the boost namespace to /myboost/ and changes the filenames +of binary libraries to begin with the prefix "myboost" rather than "boost". The --namespace-alias option makes
+`namespace boost` an alias of the new name.
+
+[pre
+bcp --scan --boost=/boost foo.cpp bar.cpp boost
+]
+
+Scans the [non-boost] files foo.cpp and bar.cpp for boost dependencies and copies those dependencies to the sub-directory boost.
+
+[pre
+bcp --report regex.hpp boost-regex-report.html
+]
+
+Creates a HTML report called boost-regex-report.html for the boost module regex.hpp. The report contains license information, author details, and file dependencies.
+
+[endsect]
+
+[section:syntax Syntax]
+
+[section:main Behaviour Selection]
+
+[pre
+bcp --list \[options\] module-list
+]
+
+Outputs a list of all the files in module-list including dependencies.
+
+[pre
+bcp \[options\] module-list output-path
+]
+
+Copies all the files found in module-list to output-path
+
+[pre
+bcp --report \[options\] module-list html-file
+]
+
+Outputs a html report file containing:
+
+* All the licenses in effect, plus the files using each license, and the copyright holders using each license. +* Any files with no recognizable license (please report these to the boost mailing lists). +* Any files with no recognizable copyright holders (please report these to the boost mailing lists).
+* All the copyright holders and the files on which they hold copyright.
+* File dependency information - indicates the reason for the inclusion of any particular file in the dependencies found.
+
+[endsect]
+
+[section:options Options]
+
+[pre
+--boost=path
+]
+
+Sets the location of the boost tree to path. If this option is not provided then the current path is assumed to be
+the root directory of the Boost tree.
+
+[pre --namespace=newname ]
+
+When copying files, all occurances of the boost namespace will get renamed to "newname". Also
+renames Boost binaries to use "newname" rather than "boost" as a prefix.
+
+Often used in conjunction with the --namespace-alias option, this allows two different Boost versions to be
+used in the same program, but not in the same translation unit.
+
+[pre --namespace-alias]
+
+When used in conjunction with the --namespace option, then `namespace boost` will be declared as an alias +of the new namespace name. This allows existing code that relies on Boost code being in `namespace boost` +to compile unchanged, while retaining the "strong versioning" that can be achieved with a namespace change.
+
+[pre
+--scan
+]
+
+Treats the module list as a list of (probably non-boost) files to scan for boost dependencies, +the files listed in the module list are not copied (or listed), only the boost files upon which they depend.
+
+[pre
+--svn
+]
+
+Only copy files under svn version control.
+
+[pre
+--unix-lines
+]
+
+Make sure that all copied files use Unix style line endings.
+
+[endsect]
+
+[section:module module-list]
+
+When the --scan option is not used then a list of boost files or library names to copy, this can be:
+
+# The name of a tool: for example "build" will find "tools/build".
+# The name of a library: for example "regex".
+# The title of a header: for example "scoped_ptr" will find "boost/scoped_ptr.hpp". +# The name of a header: for example "scoped_ptr.hpp" will find "boost/scoped_ptr.hpp".
+# The name of a file: for example "boost/regex.hpp".
+
+When the --scan option is used, then a list of (probably non-boost) files to scan for boost dependencies,
+the files in the module list are not therefore copied/listed.
+
+[endsect]
+
+[section:output output-path]
+
+The path to which files will be copied (this path must exist).
+
+[endsect]
+
+[section Dependencies]
+
+File dependencies are found as follows:
+
+* C++ source files are scanned for #includes, all #includes present in the boost source tree will then be scanned for
+their dependencies and so on.
+* C++ source files are associated with the name of a library, if that library has source code
+(and possibly build data), then include that source in the dependencies.
+* C++ source files are checked for dependencies on Boost.test (for example to see if they use cpp_main as an entry point). +* HTML files are scanned for immediate dependencies (images and style sheets, but not links).
+
+It should be noted that in practice bcp can produce a rather "fat" list of dependencies, reasons for this include: +* It searches for library names first, so using "regex" as a name will give you everything in the +libs/regex directory and everything that depends on. This can be a long list as all the regex test and example +programs will get scanned for their dependencies. If you want a more minimal list, then try using the +names of the headers you are actually including, or use the --scan option to scan your source code. +* If you include the header of a library with separate source, then you get that libraries source and all +it's dependencies. This is deliberate and in general those extra dependencies are needed. +* When you include a header, bcp doesn't know what compiler you're using, so it follows all +possible preprocessor paths. If you're distributing a subset of Boost with you're application then that
+is what you want to have happen in general.
+
+The last point above can result in a substantial increase in the number of headers found compared to most +peoples expectations. For example bcp finds 274 header dependencies for boost/shared_ptr.hpp: by +running bcp in report mode we can see why all these headers have been found as dependencies:
+
+* All of the Config library headers get included (52 headers, would be about 6 for one compiler only). +* A lot of MPL and type traits code that includes workarounds for broken compilers that you may or may not need. +Tracing back through the code shows that most of these aren't needed unless the user has +defined BOOST_SP_USE_QUICK_ALLOCATOR, however bcp isn't aware of whether that preprocessor path will be +taken or not, so the headers get included just in case. This adds about 48 headers (type traits), plus another 49 from MPL. +* The Preprocessor library gets used heavily by MPL: this adds another 96 headers. +* The Shared Pointer library contains a lot of platform specific code, split up into around 22 headers:
+normally your compiler would need only a couple of these files.
+
+As you can see the number of dependencies found are much larger than those used by any single compiler, +however if you want to distribute a subset of Boost that's usable in any configuration, by any compiler, +on any platform then that's exactly what you need. If you want to figure out which Boost headers are +being used by your specific compiler then the best way to find out is to prepocess the code and scan +the output for boost header includes. You should be aware that the result will be very platform and compiler +specific, and may not contain all the headers needed if you so much as change a compiler switch
+(for example turn on threading support).
+
+[endsect]
+[endsect]
=======================================
--- /dev/null
+++ /trunk/tools/bcp/doc/html/index.html        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,344 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>BCP</title>
+<link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
+<link rel="home" href="index.html" title="BCP">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
+<td align="center"><a href="../../../../index.html">Home</a></td>
+<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../more/index.htm">More</a></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"></div>
+<div class="article" lang="en">
+<div class="titlepage">
+<div>
+<div><h2 class="title">
+<a name="bcp"></a>BCP</h2></div>
+<div><div class="authorgroup"><div class="author"><h3 class="author">
+<span class="firstname">John</span> <span class="surname">Maddock</span>
+</h3></div></div></div>
+<div><p class="copyright">Copyright &#169; 2209 John Maddock</p></div>
+<div><div class="legalnotice">
+<a name="id774375"></a><p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+      </p>
+</div></div>
+</div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="index.html#bcp.overview"> Overview</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.examples"> Examples</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax"> Syntax</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#bcp.syntax.main"> Behaviour Selection</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax.options"> Options</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax.module"> module-list</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax.output"> output-path</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax.dependencies">Dependencies</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="bcp.overview"></a><a class="link" href="index.html#bcp.overview" title="Overview"> Overview</a>
+</h2></div></div></div>
+<p>
+ The bcp utility is a tool for extracting subsets of Boost, it's useful for + Boost authors who want to distribute their library separately from Boost, and + for Boost users who want to distribute a subset of Boost with their application.
+    </p>
+<p>
+ bcp can also report on which parts of Boost your code is dependent on, and
+      what licences are used by those dependencies.
+    </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="bcp.examples"></a><a class="link" href="index.html#bcp.examples" title="Examples"> Examples</a>
+</h2></div></div></div>
+<pre class="programlisting">bcp scoped_ptr /foo
+</pre>
+<p>
+      Copies boost/scoped_ptr.hpp and dependencies to /foo.
+    </p>
+<pre class="programlisting">bcp boost/regex.hpp /foo
+</pre>
+<p>
+ Copies boost/regex.hpp and all dependencies including the regex source code + (in libs/regex/src) and build files (in libs/regex/build) to /foo. Does not
+      copy the regex documentation, test, or example code.
+    </p>
+<pre class="programlisting">bcp regex /foo
+</pre>
+<p>
+ Copies the full regex lib (in libs/regex) including dependencies (such as the
+      boost.test source required by the regex test programs) to /foo.
+    </p>
+<pre class="programlisting">bcp --namespace=myboost --namespace-alias regex config build /foo
+</pre>
+<p>
+ Copies the full regex lib (in libs/regex) plus the config lib (libs/config) + and the build system (tools/build) to /foo including all the dependencies. + Also renames the boost namespace to <span class="emphasis"><em>myboost</em></span> and changes
+      the filenames of binary libraries to begin with the prefix "myboost"
+ rather than "boost". The --namespace-alias option makes <code class="computeroutput"><span class="keyword">namespace</span> <span class="identifier">boost</span></code>
+      an alias of the new name.
+    </p>
+<pre class="programlisting">bcp --scan --boost=/boost foo.cpp bar.cpp boost
+</pre>
+<p>
+ Scans the [non-boost] files foo.cpp and bar.cpp for boost dependencies and
+      copies those dependencies to the sub-directory boost.
+    </p>
+<pre class="programlisting">bcp --report regex.hpp boost-regex-report.html
+</pre>
+<p>
+ Creates a HTML report called boost-regex-report.html for the boost module regex.hpp. + The report contains license information, author details, and file dependencies.
+    </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="bcp.syntax"></a><a class="link" href="index.html#bcp.syntax" title="Syntax"> Syntax</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#bcp.syntax.main"> Behaviour Selection</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax.options"> Options</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax.module"> module-list</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax.output"> output-path</a></span></dt> +<dt><span class="section"><a href="index.html#bcp.syntax.dependencies">Dependencies</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="bcp.syntax.main"></a><a class="link" href="index.html#bcp.syntax.main" title="Behaviour Selection"> Behaviour Selection</a>
+</h3></div></div></div>
+<pre class="programlisting">bcp --list [options] module-list
+</pre>
+<p>
+ Outputs a list of all the files in module-list including dependencies.
+      </p>
+<pre class="programlisting">bcp [options] module-list output-path
+</pre>
+<p>
+        Copies all the files found in module-list to output-path
+      </p>
+<pre class="programlisting">bcp --report [options] module-list html-file
+</pre>
+<p>
+        Outputs a html report file containing:
+      </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ All the licenses in effect, plus the files using each license, and the
+          copyright holders using each license.
+        </li>
+<li>
+ Any files with no recognizable license (please report these to the boost
+          mailing lists).
+        </li>
+<li>
+ Any files with no recognizable copyright holders (please report these to
+          the boost mailing lists).
+        </li>
+<li>
+ All the copyright holders and the files on which they hold copyright.
+        </li>
+<li>
+ File dependency information - indicates the reason for the inclusion of
+          any particular file in the dependencies found.
+        </li>
+</ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="bcp.syntax.options"></a><a class="link" href="index.html#bcp.syntax.options" title="Options"> Options</a>
+</h3></div></div></div>
+<pre class="programlisting">--boost=path
+</pre>
+<p>
+ Sets the location of the boost tree to path. If this option is not provided + then the current path is assumed to be the root directory of the Boost tree.
+      </p>
+<pre class="programlisting">--namespace=newname </pre>
+<p>
+ When copying files, all occurances of the boost namespace will get renamed
+        to "newname". Also renames Boost binaries to use "newname"
+        rather than "boost" as a prefix.
+      </p>
+<p>
+ Often used in conjunction with the --namespace-alias option, this allows + two different Boost versions to be used in the same program, but not in the
+        same translation unit.
+      </p>
+<pre class="programlisting">--namespace-alias</pre>
+<p>
+ When used in conjunction with the --namespace option, then <code class="computeroutput"><span class="keyword">namespace</span> <span class="identifier">boost</span></code> + will be declared as an alias of the new namespace name. This allows existing + code that relies on Boost code being in <code class="computeroutput"><span class="keyword">namespace</span> + <span class="identifier">boost</span></code> to compile unchanged, while + retaining the "strong versioning" that can be achieved with a namespace
+        change.
+      </p>
+<pre class="programlisting">--scan
+</pre>
+<p>
+ Treats the module list as a list of (probably non-boost) files to scan for + boost dependencies, the files listed in the module list are not copied (or
+        listed), only the boost files upon which they depend.
+      </p>
+<pre class="programlisting">--svn
+</pre>
+<p>
+        Only copy files under svn version control.
+      </p>
+<pre class="programlisting">--unix-lines
+</pre>
+<p>
+        Make sure that all copied files use Unix style line endings.
+      </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="bcp.syntax.module"></a><a class="link" href="index.html#bcp.syntax.module" title="module-list"> module-list</a>
+</h3></div></div></div>
+<p>
+ When the --scan option is not used then a list of boost files or library
+        names to copy, this can be:
+      </p>
+<div class="orderedlist"><ol type="1">
+<li>
+          The name of a tool: for example "build" will find "tools/build".
+        </li>
+<li>
+          The name of a library: for example "regex".
+        </li>
+<li>
+ The title of a header: for example "scoped_ptr" will find "boost/scoped_ptr.hpp".
+        </li>
+<li>
+          The name of a header: for example "scoped_ptr.hpp" will find
+          "boost/scoped_ptr.hpp".
+        </li>
+<li>
+          The name of a file: for example "boost/regex.hpp".
+        </li>
+</ol></div>
+<p>
+ When the --scan option is used, then a list of (probably non-boost) files + to scan for boost dependencies, the files in the module list are not therefore
+        copied/listed.
+      </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="bcp.syntax.output"></a><a class="link" href="index.html#bcp.syntax.output" title="output-path"> output-path</a>
+</h3></div></div></div>
+<p>
+        The path to which files will be copied (this path must exist).
+      </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="bcp.syntax.dependencies"></a><a class="link" href="index.html#bcp.syntax.dependencies" title="Dependencies">Dependencies</a>
+</h3></div></div></div>
+<p>
+        File dependencies are found as follows:
+      </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ C++ source files are scanned for #includes, all #includes present in the + boost source tree will then be scanned for their dependencies and so on.
+        </li>
+<li>
+ C++ source files are associated with the name of a library, if that library + has source code (and possibly build data), then include that source in
+          the dependencies.
+        </li>
+<li>
+ C++ source files are checked for dependencies on Boost.test (for example
+          to see if they use cpp_main as an entry point).
+        </li>
+<li>
+ HTML files are scanned for immediate dependencies (images and style sheets,
+          but not links).
+        </li>
+</ul></div>
+<p>
+        It should be noted that in practice bcp can produce a rather "fat"
+ list of dependencies, reasons for this include: * It searches for library
+        names first, so using "regex" as a name will give you everything
+ in the libs/regex directory and everything that depends on. This can be a + long list as all the regex test and example programs will get scanned for + their dependencies. If you want a more minimal list, then try using the names + of the headers you are actually including, or use the --scan option to scan + your source code. * If you include the header of a library with separate + source, then you get that libraries source and all it's dependencies. This + is deliberate and in general those extra dependencies are needed. * When + you include a header, bcp doesn't know what compiler you're using, so it + follows all possible preprocessor paths. If you're distributing a subset + of Boost with you're application then that is what you want to have happen
+        in general.
+      </p>
+<p>
+ The last point above can result in a substantial increase in the number of + headers found compared to most peoples expectations. For example bcp finds + 274 header dependencies for boost/shared_ptr.hpp: by running bcp in report + mode we can see why all these headers have been found as dependencies:
+      </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ All of the Config library headers get included (52 headers, would be about
+          6 for one compiler only).
+        </li>
+<li>
+ A lot of MPL and type traits code that includes workarounds for broken + compilers that you may or may not need. Tracing back through the code shows + that most of these aren't needed unless the user has defined BOOST_SP_USE_QUICK_ALLOCATOR, + however bcp isn't aware of whether that preprocessor path will be taken + or not, so the headers get included just in case. This adds about 48 headers
+          (type traits), plus another 49 from MPL.
+        </li>
+<li>
+ The Preprocessor library gets used heavily by MPL: this adds another 96
+          headers.
+        </li>
+<li>
+ The Shared Pointer library contains a lot of platform specific code, split + up into around 22 headers: normally your compiler would need only a couple
+          of these files.
+        </li>
+</ul></div>
+<p>
+ As you can see the number of dependencies found are much larger than those + used by any single compiler, however if you want to distribute a subset of + Boost that's usable in any configuration, by any compiler, on any platform + then that's exactly what you need. If you want to figure out which Boost + headers are being used by your specific compiler then the best way to find + out is to prepocess the code and scan the output for boost header includes. + You should be aware that the result will be very platform and compiler specific, + and may not contain all the headers needed if you so much as change a compiler
+        switch (for example turn on threading support).
+      </p>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<td align="left"><p><small>Last revised: December 28, 2009 at 13:24:19 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"></div>
+</body>
+</html>
=======================================
--- /dev/null
+++ /trunk/tools/bcp/file_types.cpp     Mon Feb  8 23:37:27 2010
@@ -0,0 +1,72 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the following:
+ *    void bcp_implementation::is_source_file(const fs::path& p)
+ *    void bcp_implementation::is_html_file(const fs::path& p)
+ *    void bcp_implementation::is_binary_file(const fs::path& p)
+ */
+
+#include "bcp_imp.hpp"
+#include <boost/regex.hpp>
+
+bool bcp_implementation::is_source_file(const fs::path& p)
+{
+   static const boost::regex e(
+      ".*\\."
+      "(?:"
+         "c|cxx|h|hxx|inc|inl|.?pp|yy?"
+      ")",
+      boost::regex::perl | boost::regex::icase
+      );
+   return boost::regex_match(p.filename(), e);
+}
+
+bool bcp_implementation::is_html_file(const fs::path& p)
+{
+   static const boost::regex e(
+      ".*\\."
+      "(?:"
+         "html?|css"
+      ")"
+      );
+   return boost::regex_match(p.filename(), e);
+}
+
+bool bcp_implementation::is_binary_file(const fs::path& p)
+{
+   if(m_cvs_mode || m_svn_mode)
+   {
+ std::map<fs::path, bool, path_less>::iterator pos = m_cvs_paths.find(p);
+      if(pos != m_cvs_paths.end()) return pos->second;
+   }
+   static const boost::regex e(
+      ".*\\."
+      "(?:"
+         "c|cxx|cpp|h|hxx|hpp|inc|html?|css|mak|in"
+      ")"
+      "|"
+      "(Jamfile|makefile|configure)",
+      boost::regex::perl | boost::regex::icase);
+   return !boost::regex_match(p.leaf(), e);
+
+}
+
+bool bcp_implementation::is_jam_file(const fs::path& p)
+{
+   static const boost::regex e(
+      ".*\\."
+      "(?:"
+         "jam|v2"
+      ")"
+      "|"
+      "(Jamfile|Jamroot)\\.?",
+      boost::regex::perl | boost::regex::icase
+      );
+   return boost::regex_match(p.filename(), e);
+}
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/fileview.cpp       Mon Feb  8 23:37:27 2010
@@ -0,0 +1,142 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the fileview class
+ */
+
+#include "fileview.hpp"
+#include <vector>
+#include <algorithm>
+#include <string>
+#include <fstream>
+#include <istream>
+#include <stdexcept>
+
+struct fileview::implementation
+{
+   std::vector<char> m_data;
+};
+
+
+// construct:
+fileview::fileview()
+{
+   pimpl.reset(new implementation());
+}
+
+fileview::fileview(const boost::filesystem::path& p)
+{
+   pimpl.reset(new implementation());
+   open(p);
+}
+
+fileview::~fileview()
+{
+}
+
+fileview::fileview(const fileview& that)
+{
+}
+
+fileview& fileview::operator=(const fileview& that)
+{
+   pimpl = that.pimpl;
+   return *this;
+}
+
+void fileview::close()
+{
+   cow();
+   pimpl->m_data.clear();
+}
+
+void fileview::open(const boost::filesystem::path& p)
+{
+   cow();
+   std::ifstream is(p.native_file_string().c_str());
+   if(!is)
+   {
+      std::string msg("Bad file name: ");
+      msg += p.native_file_string();
+      std::runtime_error e(msg);
+      boost::throw_exception(e);
+   }
+   std::istreambuf_iterator<char> in(is);
+   std::istreambuf_iterator<char> end;
+   std::copy(in, end, std::back_inserter(pimpl->m_data));
+}
+
+// iterators:
+fileview::const_iterator         fileview::begin() const
+{
+   return &(pimpl->m_data[0]);
+}
+
+fileview::const_iterator         fileview::end() const
+{
+   return begin() + pimpl->m_data.size();
+}
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+fileview::const_reverse_iterator fileview::rbegin() const
+{
+   return const_reverse_iterator(end());
+}
+
+fileview::const_reverse_iterator fileview::rend() const
+{
+   return const_reverse_iterator(begin());
+}
+#endif
+
+// capacity:
+fileview::size_type fileview::size() const
+{
+   return pimpl->m_data.size();
+}
+
+fileview::size_type fileview::max_size() const
+{
+   return pimpl->m_data.max_size();
+}
+
+bool      fileview::empty() const
+{
+   return pimpl->m_data.empty();
+}
+
+// element access:
+fileview::const_reference fileview::operator[](fileview::size_type n) const
+{
+   return pimpl->m_data[n];
+}
+
+fileview::const_reference fileview::at(size_type n) const
+{
+   return pimpl->m_data.at(n);
+}
+
+fileview::const_reference fileview::front() const
+{
+   return pimpl->m_data.front();
+}
+
+fileview::const_reference fileview::back() const
+{
+   return pimpl->m_data.back();
+}
+
+void fileview::swap(fileview& that)
+{
+   pimpl.swap(that.pimpl);
+}
+
+void fileview::cow()
+{
+   if(!pimpl.unique())
+      pimpl.reset(new implementation(*pimpl));
+}
=======================================
--- /dev/null
+++ /trunk/tools/bcp/fileview.hpp       Mon Feb  8 23:37:27 2010
@@ -0,0 +1,66 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+#include <boost/shared_ptr.hpp>
+#include <boost/filesystem/path.hpp>
+
+class fileview
+{
+public:
+   // types:
+   typedef const char&                               reference;
+   typedef reference                                 const_reference;
+ typedef const char* iterator; // See _lib.container.requirements_ + typedef iterator const_iterator; // See _lib.container.requirements_
+   typedef std::size_t                               size_type;
+   typedef std::ptrdiff_t                            difference_type;
+   typedef char                                      value_type;
+   typedef const char*                               pointer;
+   typedef pointer                                   const_pointer;
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+   typedef std::reverse_iterator<iterator>           reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+#endif
+
+   // construct:
+   fileview();
+   fileview(const boost::filesystem::path& p);
+   ~fileview();
+   fileview(const fileview& that);
+   fileview& operator=(const fileview& that);
+   void close();
+   void open(const boost::filesystem::path& p);
+
+   // iterators:
+   const_iterator         begin() const;
+   const_iterator         end() const;
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+   const_reverse_iterator rbegin() const;
+   const_reverse_iterator rend() const;
+#endif
+
+   // capacity:
+   size_type size() const;
+   size_type max_size() const;
+   bool      empty() const;
+
+   // element access:
+   const_reference operator[](size_type n) const;
+   const_reference at(size_type n) const;
+   const_reference front() const;
+   const_reference back() const;
+   void            swap(fileview& that);
+
+private:
+   void cow();
+   struct implementation;
+   boost::shared_ptr<implementation> pimpl;
+};
+
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/licence_info.cpp   Mon Feb  8 23:37:27 2010
@@ -0,0 +1,721 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ *  boostinspect:noascii
+ */
+
+#include "licence_info.hpp"
+
+
+std::pair<const license_info*, int> get_licenses()
+{
+   static const char* generic_author_sig =
+      "(?:"
+         "(?:"
+            "Copyright|\\(c\\)|\xA9"
+         ")[[:blank:]]+"
+      "){1,2}"
+      "(?:"
+         "\\d[^[:alpha:]]+"
+            "([[:alpha:]]"
+               "(?:"
+ "(?!Use\\b|Permission\\b|All\\b|<P|(?:-\\s*)\\w+(?:://|@)| \\\\"
+               ")[^\\n\\d]"
+            ")+"
+         ")"
+         "|"
+            "([[:alpha:]][^\\n\\d]+"
+               "(?:\\n[^\\n\\d]+"
+            ")??"
+         ")(?:19|20)\\d{2}"
+      ")"
+      "|"
+      "Authors:[[:blank:]]+"
+         "([[:alpha:]][^\\n\\d]+"
+      "|"
+      "((?:The|This) code is considered to be in the public domain)"
+      ")";
+
+   static const char* generic_author_format =
+      "(?1$1)(?2$2)(?3$3)(?4Public Domain)";
+
+   static const license_info licenses[] =
+   {
+      license_info( boost::regex("distributed\\W+under"
+ "(\\W+the)?[^\"[:word:]]+Boost\\W+Software\\W+License\\W+Version\\W+1.0", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Boost Software License, Version 1.0"
+         ,
+         "<P>Copyright (c) <I>Date</I> <I>Author</I></P>"
+         "<P>Distributed under the "
+         "Boost Software License, Version 1.0. (See accompanying file "
+ "LICENSE_1_0.txt or copy at <a href=\"http://www.boost.org/LICENSE_1_0.txt\";>http://www.boost.org/LICENSE_1_0.txt)</a></P>"
+       )
+      ,
+ license_info( boost::regex("Use\\W+\\modification\\W+and\\W+distribution(\\W+is| \\W+are)\\W+subject\\W+to" + "(\\W+the)?[^\"[:word:]]+Boost\\W+Software\\W+License\\W+Version\\W+1.0", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Boost Software License, Version 1.0 (variant #1)"
+         ,
+         "<P>Copyright (c) <I>Date</I> <I>Author</I></P>"
+         "<P>Use, modification and distribution is subject to the "
+         "Boost Software License, Version 1.0. (See accompanying file "
+ "LICENSE_1_0.txt or copy at <a href=\"http://www.boost.org/LICENSE_1_0.txt\";>http://www.boost.org/LICENSE_1_0.txt)</a></P>"
+       )
+      ,
+      license_info( boost::regex("(?!is)\\w\\w\\W+subject\\W+to"
+ "(\\W+the)?[^\"[:word:]]+Boost\\W+Software\\W+License\\W+Version\\W+1.0", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Boost Software License, Version 1.0 (variant #2)"
+         ,
+         "<P>Copyright (c) <I>Date</I> <I>Author</I></P>"
+         "<P>Subject to the "
+         "Boost Software License, Version 1.0. (See accompanying file "
+ "LICENSE_1_0.txt or copy at <a href=\"http://www.boost.org/LICENSE_1_0.txt\";>http://www.boost.org/LICENSE_1_0.txt)</a></P>"
+       )
+      ,
+ license_info( boost::regex("Copyright\\W+(c)\\W+2001\\W+2002\\W+Python\\W+Software\\W+Foundation\\W+All\\W+Rights\\W+Reserved", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Python Software License"
+         ,
+         "<p>Copyright (c) 2001, 2002 Python Software Foundation;</p>"
+         "<P>All Rights Reserved</P>"
+       )
+      ,
+ license_info( boost::regex("Permission\\W+to\\W+use\\W+copy\\W+modify\\W+distribute\\W+and\\W+sell\\W+this\\W+software\\W+and\\W+its\\W+documentation"
+         
"\\W+for\\W+any\\W+purpose\\W+is\\W+hereby\\W+granted\\W+without\\W+fee"
+         
"\\W+provided\\W+that\\W+the\\W+above\\W+copyright\\W+notice\\W+appears?\\W+in\\W+all\\W+copies\\W+and"
+ "\\W+that\\W+both\\W+(the| that)\\W+copyright\\W+notice\\W+and\\W+this\\W+permission\\W+notice\\W+appears?" + "\\W+in\\W+supporting\\W+documentation[^<>]{1, 100}\\W+no\\W+representations"
+         
"\\W+(are\\W+made\\W+)?about\\W+the\\W+suitability\\W+of\\W+this\\W+software\\W+for\\W+any\\W+purpose"
+         
"\\W+It\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty"
+         , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "SGI Style License"
+         ,
+         "<P>Copyright (c) <I>Date</I><BR>"
+         "<I>Author</I><BR>"
+         "<BR>"
+ "Permission to use, copy, modify, distribute and sell this software " + "and its documentation for any purpose is hereby granted without fee, " + "provided that the above copyright notice appear in all copies and " + "that both that copyright notice and this permission notice appear " + "in supporting documentation. <I>Author</I> makes no representations "
+         "about the suitability of this software for any purpose. "
+ "It is provided \"as is\" without express or implied warranty.</P>"
+       )
+      ,
+ license_info( boost::regex("Permission\\W+to\\W+use\\W+copy\\W+modify\\W+distribute\\W+and\\W+sell\\W+this\\W+software"
+         
"\\W+for\\W+any\\W+purpose\\W+is\\W+hereby\\W+granted\\W+without\\W+fee"
+         
"\\W+provided\\W+that\\W+the\\W+above\\W+copyright\\W+notice\\W+appears?\\W+in\\W+all\\W+copies\\W+and"
+ "\\W+that\\W+both\\W+(the| that)\\W+copyright\\W+notice\\W+and\\W+this\\W+permission\\W+notice\\W+appears?" + "\\W+in\\W+supporting\\W+documentation[^<>]{1, 100}\\W+no\\W+representations"
+         
"\\W+(are\\W+made\\W+)?about\\W+the\\W+suitability\\W+of\\W+this\\W+software\\W+for\\W+any\\W+purpose"
+ "\\W+It\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express(ed)?\\W+or\\W+implied\\W+warranty", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #1"
+         ,
+         "<P>Copyright (c) <I>Date</I><BR>"
+         "<I>Author</I><BR>"
+         "<BR>"
+ "Permission to use, copy, modify, distribute and sell this software "
+         "for any purpose is hereby granted without fee, "
+ "provided that the above copyright notice appear in all copies and " + "that both that copyright notice and this permission notice appears? " + "in supporting documentation. <I>Author</I> makes no representations "
+         "about the suitability of this software for any purpose. "
+ "It is provided \"as is\" without express or implied warranty.</P>"
+       )
+      ,
+      license_info(
+         boost::regex(
+            
"Permission\\W+to\\W+copy\\W+use\\W+modify\\W+sell\\W+and\\W+distribute\\W+this\\W+software"
+            
"\\W+is\\W+granted\\W+provided\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies"
+            
"\\W+This\\W+software\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied"
+            
"\\W+warranty\\W+and\\W+with\\W+no\\W+claim\\W+as\\W+to\\W+its\\W+suitability\\W+for\\W+any\\W+purpose"
+            , boost::regex::perl | boost::regex::icase
+         )
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #2"
+         ,
+         "<P>Copyright (c) <I>Date</I> <I>Author</I>.<BR><BR>\n"
+ "Permission to copy, use, modify, sell and distribute this software<BR>\n" + "is granted provided this copyright notice appears in all copies.<BR>\n" + "This software is provided \"as is\" without express or implied<BR>\n" + "warranty, and with no claim as to its suitability for any purpose.</P>\n"
+       )
+      ,
+      license_info(
+         boost::regex(
+            
"Permission\\W+to\\W+copy\\W+use[^\"[:word:]]+modify\\W+sell\\W+and\\W+distribute\\W+this\\W+software\\W+is\\W+granted\\W+provided"
+            
"\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies\\W+This\\W+software\\W+is"
+            
"\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty\\W+and\\W+with"
+            
"\\W+no\\W+claim\\W+at\\W+to\\W+its\\W+suitability\\W+for\\W+any\\W+purpose"
+            , boost::regex::perl | boost::regex::icase
+         )
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #3"
+         ,
+ "<P>(C) Copyright <I>Author</I> <I>Date</I>. Permission to copy, use, "
+         "modify, sell, and distribute this software is granted provided "
+         "this copyright notice appears in all copies.  This software is "
+ "provided \"as is\" without express or implied warranty, and with "
+         "no claim at to its suitability for any purpose.</p>\n"
+       )
+      ,
+ license_info( boost::regex("Permission\\W+to\\W+copy\\W+use\\W+sell\\W+and\\W+distribute\\W+this\\W+software\\W+is\\W+granted"
+                     
"\\W+provided\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies"
+                     
"\\W+Permission\\W+to\\W+modify\\W+the\\W+code\\W+and\\W+to\\W+distribute\\W+modified\\W+code\\W+is\\W+granted"
+                     
"\\W+provided\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies\\W+and\\W+a\\W+notice"
+                     
"\\W+that\\W+the\\W+code\\W+was\\W+modified\\W+is\\W+included\\W+with\\W+the\\W+copyright\\W+notice"
+                     
"\\W+This\\W+software\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty\\W+and\\W+with\\W+no\\W+claim\\W+as\\W+to\\W+its\\W+suitability\\W+for\\W+any\\W+purpose"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #4"
+         ,
+         "<P>Copyright (C) <I>Date Author</I><BR>"
+         "<BR>"
+ "Permission to copy, use, sell and distribute this software is granted\n"
+         "provided this copyright notice appears in all copies.\n"
+ "Permission to modify the code and to distribute modified code is granted\n" + "provided this copyright notice appears in all copies, and a notice\n" + "that the code was modified is included with the copyright notice.</P>\n" + "<P>This software is provided \"as is\" without express or implied warranty,\n"
+         "and with no claim as to its suitability for any purpose.</P>"
+       )
+      ,
+ license_info( boost::regex("This\\W+file\\W+is\\W+part\\W+of\\W+the\\W+(Boost\\W+Graph| Generic\\W+Graph\\W+Component)\\W+Library"
+                     
"\\W+You\\W+should\\W+have\\W+received\\W+a\\W+copy\\W+of\\W+the\\W+License\\W+Agreement\\W+for\\W+the"
+ "\\W+(Boost| Generic)\\W+Graph\\W+(Component\\W+)?Library\\W+along\\W+with\\W+the\\W+software;\\W+see\\W+the\\W+file\\W+LICENSE"
+                     
"(\\W+If\\W+not\\W+contact\\W+Office\\W+of\\W+Research\\W+University\\W+of\\W+Notre\\W+Dame\\W+Notre"
+                     "\\W+Dame\\W+IN\\W+46556)?"
+ "\\W+Permission\\W+to\\W+modify\\W+the\\W+code\\W+and\\W+to\\W+distribute(\\W+modified| \\W+the)\\W+code\\W+is" + "\\W+granted\\W+provided\\W+the\\W+text\\W+of\\W+this\\W+NOTICE\\W+is\\W+retained\\W+a\\W+notice\\W+(that| if)"
+                     
"\\W+the\\W+code\\W+was\\W+modified\\W+is\\W+included\\W+with\\W+the\\W+above\\W+COPYRIGHT\\W+NOTICE\\W+and"
+                     
"\\W+with\\W+the\\W+COPYRIGHT\\W+NOTICE\\W+in\\W+the\\W+LICENSE\\W+file\\W+and\\W+that\\W+the\\W+LICENSE"
+                     
"\\W+file\\W+is\\W+distributed\\W+with\\W+the\\W+modified\\W+code\\W+"
+                     
"\\W+LICENSOR\\W+MAKES\\W+NO\\W+REPRESENTATIONS\\W+OR\\W+WARRANTIES\\W+EXPRESS\\W+OR\\W+IMPLIED"
+                     
"\\W+By\\W+way\\W+of\\W+example\\W+but\\W+not\\W+limitation\\W+Licensor\\W+MAKES\\W+NO"
+                     
"\\W+REPRESENTATIONS\\W+OR\\W+WARRANTIES\\W+OF\\W+MERCHANTABILITY\\W+OR\\W+FITNESS\\W+FOR\\W+ANY"
+                     
"\\W+PARTICULAR\\W+PURPOSE\\W+OR\\W+THAT\\W+THE\\W+USE\\W+OF\\W+THE\\W+LICENSED\\W+SOFTWARE\\W+COMPONENTS"
+                     
"\\W+OR\\W+DOCUMENTATION\\W+WILL\\W+NOT\\W+INFRINGE\\W+ANY\\W+PATENTS\\W+COPYRIGHTS\\W+TRADEMARKS"
+                     "\\W+OR\\W+OTHER\\W+RIGHTS"
+            , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Boost.Graph license (Notre Dame)"
+         ,
+         "<P>Copyright <I>Date</I> University of Notre Dame.<BR>"
+         "Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek</P>"
+         "<P>This file is part of the Boost Graph Library</P>"
+ "<P>You should have received a copy of the <A href=\"http://www.boost.org/libs/graph/LICENCE\";>License Agreement</a> for the " + "Boost Graph Library along with the software; see the file <A href=\"http://www.boost.org/libs/graph/LICENCE\";>LICENSE</a>. " + "If not, contact Office of Research, University of Notre Dame, Notre "
+         "Dame, IN 46556.</P>"
+ "<P>Permission to modify the code and to distribute modified code is " + "granted, provided the text of this NOTICE is retained, a notice that " + "the code was modified is included with the above COPYRIGHT NOTICE and " + "with the COPYRIGHT NOTICE in the <A href=\"http://www.boost.org/libs/graph/LICENCE\";>LICENSE</a> file, and that the <A href=\"http://www.boost.org/libs/graph/LICENCE\";>LICENSE</a> "
+         "file is distributed with the modified code.</P>"
+ "<P>LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.<BR> "
+         "By way of example, but not limitation, Licensor MAKES NO "
+ "REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY " + "PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS " + "OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS "
+         "OR OTHER RIGHTS.</P>"
+       )
+      ,
+ license_info( boost::regex("This\\W+file\\W+is\\W+part\\W+of\\W+the\\W+(Boost\\W+Graph| Generic\\W+Graph\\W+Component)\\W+Library"
+                     
"\\W+You\\W+should\\W+have\\W+received\\W+a\\W+copy\\W+of\\W+the\\W+License\\W+Agreement\\W+for\\W+the"
+ "\\W+(Boost| Generic)\\W+Graph\\W+(Component\\W+)?Library\\W+along\\W+with\\W+the\\W+software;\\W+see\\W+the\\W+file\\W+LICENSE"
+                     
"(\\W+If\\W+not\\W+contact\\W+Office\\W+of\\W+Research\\W+Indiana\\W+University\\W+Bloomington\\W+IN\\W+47405)?"
+ "\\W+Permission\\W+to\\W+modify\\W+the\\W+code\\W+and\\W+to\\W+distribute(\\W+modified| \\W+the)\\W+code\\W+is" + "\\W+granted\\W+provided\\W+the\\W+text\\W+of\\W+this\\W+NOTICE\\W+is\\W+retained\\W+a\\W+notice\\W+(that| if)"
+                     
"\\W+the\\W+code\\W+was\\W+modified\\W+is\\W+included\\W+with\\W+the\\W+above\\W+COPYRIGHT\\W+NOTICE\\W+and"
+                     
"\\W+with\\W+the\\W+COPYRIGHT\\W+NOTICE\\W+in\\W+the\\W+LICENSE\\W+file\\W+and\\W+that\\W+the\\W+LICENSE"
+                     
"\\W+file\\W+is\\W+distributed\\W+with\\W+the\\W+modified\\W+code\\W+"
+                     
"\\W+LICENSOR\\W+MAKES\\W+NO\\W+REPRESENTATIONS\\W+OR\\W+WARRANTIES\\W+EXPRESS\\W+OR\\W+IMPLIED"
+                     
"\\W+By\\W+way\\W+of\\W+example\\W+but\\W+not\\W+limitation\\W+Licensor\\W+MAKES\\W+NO"
+                     
"\\W+REPRESENTATIONS\\W+OR\\W+WARRANTIES\\W+OF\\W+MERCHANTABILITY\\W+OR\\W+FITNESS\\W+FOR\\W+ANY"
+                     
"\\W+PARTICULAR\\W+PURPOSE\\W+OR\\W+THAT\\W+THE\\W+USE\\W+OF\\W+THE\\W+LICENSED\\W+SOFTWARE\\W+COMPONENTS"
+                     
"\\W+OR\\W+DOCUMENTATION\\W+WILL\\W+NOT\\W+INFRINGE\\W+ANY\\W+PATENTS\\W+COPYRIGHTS\\W+TRADEMARKS"
+                     "\\W+OR\\W+OTHER\\W+RIGHTS"
+            , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Boost.Graph license (Indiana University)"
+         ,
+         "<P>Copyright <I>Date</I> Indiana University.<BR>"
+         "Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek</P>"
+         "<P>This file is part of the Boost Graph Library</P>"
+ "<P>You should have received a copy of the <A href=\"http://www.boost.org/libs/graph/LICENCE\";>License Agreement</a> for the " + "Boost Graph Library along with the software; see the file <A href=\"http://www.boost.org/libs/graph/LICENCE\";>LICENSE</a>. " + "If not, contact Office of Research, Indiana University, Bloomington,"
+         "IN 47404.</P>"
+ "<P>Permission to modify the code and to distribute modified code is " + "granted, provided the text of this NOTICE is retained, a notice that " + "the code was modified is included with the above COPYRIGHT NOTICE and " + "with the COPYRIGHT NOTICE in the <A href=\"http://www.boost.org/libs/graph/LICENCE\";>LICENSE</a> file, and that the <A href=\"http://www.boost.org/libs/graph/LICENCE\";>LICENSE</a> "
+         "file is distributed with the modified code.</P>"
+ "<P>LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.<BR> "
+         "By way of example, but not limitation, Licensor MAKES NO "
+ "REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY " + "PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS " + "OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS "
+         "OR OTHER RIGHTS.</P>"
+       )
+      ,
+ license_info( boost::regex("Permission\\W+to\\W+copy\\W+use\\W+modify\\W+sell\\W+and\\W+distribute\\W+this\\W+software\\W+is"
+                     
"[^\"[:word:]]+granted\\W+provided\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies\\W+and"
+                     
"\\W+modified\\W+version\\W+are\\W+clearly\\W+marked\\W+as\\W+such\\W+This\\W+software\\W+is\\W+provided"
+                     
"\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty\\W+and\\W+with\\W+no\\W+claim\\W+as\\W+to\\W+its"
+                     "\\W+suitability\\W+for\\W+any\\W+purpose"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #5"
+         ,
+         "<P>Copyright (C) <I>Date Author</I></P>"
+ "<p>Permission to copy, use, modify, sell and distribute this software is " + "granted, provided this copyright notice appears in all copies and " + "modified version are clearly marked as such. This software is provided " + "\"as is\" without express or implied warranty, and with no claim as to its "
+         "suitability for any purpose.</P>"
+       )
+      ,
+ license_info( boost::regex("This\\W+file\\W+can\\W+be\\W+redistributed\\W+and\\W+or\\W+modified\\W+under\\W+the\\W+terms\\W+found"
+                     "\\W+in\\W+copyright\\W+html"
+                     
"\\W+This\\W+software\\W+and\\W+its\\W+documentation\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or"
+                     
"\\W+implied\\W+warranty\\W+and\\W+with\\W+no\\W+claim\\W+as\\W+to\\W+its\\W+suitability\\W+for\\W+any\\W+purpose"
+            , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Boost.Pool license"
+         ,
+ "<P>This file can be redistributed and/or modified under the terms found " + "in <a href=\"http://www.boost.org/libs/pool/doc/copyright.html\";>copyright.html</a></P>\n" + "<P>This software and its documentation is provided \"as is\" without express or " + "implied warranty, and with no claim as to its suitability for any purpose</P>"
+       )
+      ,
+ license_info(boost::regex("Permission\\W+to\\W+use\\W+copy\\W+modify\\W+sell\\W+and\\W+distribute\\W+this\\W+software"
+                     
"\\W+is\\W+hereby\\W+granted\\W+without\\W+fee\\W+provided\\W+that\\W+the\\W+above\\W+copyright\\W+notice"
+                     
"\\W+appears\\W+in\\W+all\\W+copies\\W+and\\W+that\\W+both\\W+that\\W+copyright\\W+notice\\W+and\\W+this"
+                     
"\\W+permission\\W+notice\\W+appear\\W+in\\W+supporting\\W+documentation"
+ "[^<>]{1,100}\\W+(make\\W+any\\W+representation| makes\\W+no\\W+representations)\\W+about\\W+the\\W+suitability\\W+of\\W+this"
+                     
"\\W+software\\W+for\\W+any\\W+purpose\\W+It\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or"
+                     "\\W+implied\\W+warranty"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #6"
+         ,
+         "<P>Copyright <I>Author Data</I></P>"
+ "<P>Permission to use, copy, modify, sell, and distribute this software " + "is hereby granted without fee provided that the above copyright notice " + "appears in all copies and that both that copyright notice and this "
+         "permission notice appear in supporting documentation, "
+ "<I>Author</I> makes no representations about the suitability of this " + "software for any purpose. It is provided \"as is\" without express or "
+         "implied warranty.</P>"
+       )
+      ,
+      license_info( boost::regex("Permission\\W+to\\W+copy"
+                     
"[^\"[:word:]]+use\\W+modify\\W+sell\\W+and\\W+distribute\\W+this\\W+software\\W+is\\W+granted\\W+provided"
+                     
"\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies\\W+of\\W+the\\W+source\\W+This"
+                     
"\\W+software\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty"
+                     
"\\W+and\\W+with\\W+no\\W+claim\\W+as\\W+to\\W+its\\W+suitability\\W+for\\W+any\\W+purpose"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #7"
+         ,
+         "<P>Copyright <I>Author Date</I>. Permission to copy, "
+ "use, modify, sell and distribute this software is granted provided "
+         "this copyright notice appears in all copies of the source. This "
+ "software is provided \"as is\" without express or implied warranty, "
+         "and with no claim as to its suitability for any purpose."
+       )
+      ,
+ license_info(boost::regex("This\\W+software\\W+is\\W+provided\\W+as-is\\W+without\\W+any\\W+express\\W+or\\W+implied"
+      
"\\W+warranty\\W+In\\W+no\\W+event\\W+will\\W+the\\W+copyright\\W+holder\\W+be\\W+held\\W+liable\\W+for"
+      
"\\W+any\\W+damages\\W+arising\\W+from\\W+the\\W+use\\W+of\\W+this\\W+software"
+      
"\\W+Permission\\W+is\\W+granted\\W+to\\W+anyone\\W+to\\W+use\\W+this\\W+software\\W+for\\W+any\\W+purpose"
+      
"\\W+including\\W+commercial\\W+applications\\W+and\\W+to\\W+alter\\W+it\\W+and\\W+redistribute"
+      "\\W+it\\W+freely\\W+subject\\W+to\\W+the\\W+following\\W+restrictions:"
+      
"\\W+1\\W+The\\W+origin\\W+of\\W+this\\W+software\\W+must\\W+not\\W+be\\W+misrepresented;\\W+you\\W+must"
+      
"\\W+not\\W+claim\\W+that\\W+you\\W+wrote\\W+the\\W+original\\W+software\\W+If\\W+you\\W+use\\W+this"
+      
"\\W+software\\W+in\\W+a\\W+product\\W+an\\W+acknowledgment\\W+in\\W+the\\W+product\\W+documentation"
+      "\\W+would\\W+be\\W+appreciated\\W+but\\W+is\\W+not\\W+required"
+      
"\\W+2\\W+Altered\\W+source\\W+versions\\W+must\\W+be\\W+plainly\\W+marked\\W+as\\W+such\\W+and\\W+must"
+      
"\\W+not\\W+be\\W+misrepresented\\W+as\\W+being\\W+the\\W+original\\W+software"
+      
"\\W+3\\W+This\\W+notice\\W+may\\W+not\\W+be\\W+removed\\W+or\\W+altered\\W+from\\W+any\\W+source"
+      "\\W+distribution"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #8"
+         ,
+         "<P>Phoenix V0.9<BR>Copyright (c) <I>Date</I> Joel de Guzman</P>"
+ "<P>This software is provided 'as-is', without any express or implied " + "warranty. In no event will the copyright holder be held liable for "
+         "any damages arising from the use of this software.</P>"
+ "<P>Permission is granted to anyone to use this software for any purpose, " + "including commercial applications, and to alter it and redistribute "
+         "it freely, subject to the following restrictions:</P>"
+ "<P>1. The origin of this software must not be misrepresented; you must "
+         "not claim that you wrote the original software. If you use this "
+ "software in a product, an acknowledgment in the product documentation "
+         "would be appreciated but is not required.</P>"
+ "2. Altered source versions must be plainly marked as such, and must "
+         "not be misrepresented as being the original software. </P>"
+ "<P>3. This notice may not be removed or altered from any source "
+         "distribution. "
+       )
+      ,
+ license_info( boost::regex("Permission\\W+to\\W+use\\W+copy\\W+modify\\W+sell\\W+and\\W+distribute\\W+this\\W+software"
+                     
"\\W+is\\W+hereby\\W+granted\\W+without\\W+fee\\W+provided\\W+that\\W+the\\W+above\\W+copyright\\W+notice"
+                     
"\\W+appears\\W+in\\W+all\\W+copies\\W+and\\W+that\\W+both\\W+that\\W+copyright\\W+notice\\W+and\\W+this"
+                     
"\\W+permission\\W+notice\\W+appear\\W+in\\W+supporting\\W+documentation"
+                     
"\\W+None\\W+of\\W+the\\W+above\\W+authors\\W+nor.{1,100}make\\W+any"
+                     
"\\W+representation\\W+about\\W+the\\W+suitability\\W+of\\W+this\\W+software\\W+for\\W+any"
+                     
"\\W+purpose\\W+It\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #9"
+         ,
+         "<P>Copyright <I> Author Date</I><BR>"
+ "Permission to use, copy, modify, sell, and distribute this software " + "is hereby granted without fee provided that the above copyright notice " + "appears in all copies and that both that copyright notice and this "
+         "permission notice appear in supporting documentation, <BR>"
+ "None of the above authors nor <I>Author's Organisation</I> make any "
+         "representation about the suitability of this software for any "
+ "purpose. It is provided \"as is\" without express or implied warranty."
+       )
+      ,
+ license_info( boost::regex("Permission\\W+to\\W+use\\W+copy\\W+modify\\W+and\\W+distribute\\W+this\\W+software\\W+for\\W+any"
+                     
"\\W+purpose\\W+is\\W+hereby\\W+granted\\W+without\\W+fee\\W+provided\\W+that\\W+this\\W+copyright\\W+and"
+                     
"\\W+permissions\\W+notice\\W+appear\\W+in\\W+all\\W+copies\\W+and\\W+derivatives"
+                     
"\\W+This\\W+software\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #10"
+         ,
+         "<P>Copyright <I>Author Date</I>. All rights reserved.</P>"
+ "<P>Permission to use, copy, modify, and distribute this software for any " + "purpose is hereby granted without fee, provided that this copyright and "
+         "permissions notice appear in all copies and derivatives.</P>"
+ "<P>This software is provided \"as is\" without express or implied warranty.</P>"
+       )
+      ,
+ license_info( boost::regex("This\\W+material\\W+is\\W+provided\\W+as\\W+is\\W+with\\W+absolutely\\W+no\\W+warranty\\W+expressed"
+                     
"\\W+or\\W+implied\\W+Any\\W+use\\W+is\\W+at\\W+your\\W+own\\W+risk"
+                     
"\\W+Permission\\W+to\\W+use\\W+or\\W+copy\\W+this\\W+software\\W+for\\W+any\\W+purpose\\W+is\\W+hereby\\W+granted"
+                     
"\\W+without\\W+fee\\W+provided\\W+the\\W+above\\W+notices\\W+are\\W+retained\\W+on\\W+all\\W+copies"
+                     
"\\W+Permission\\W+to\\W+modify\\W+the\\W+code\\W+and\\W+to\\W+distribute\\W+modified\\W+code\\W+is\\W+granted"
+                     
"\\W+provided\\W+the\\W+above\\W+notices\\W+are\\W+retained\\W+and\\W+a\\W+notice\\W+that\\W+the\\W+code\\W+was"
+                     
"\\W+modified\\W+is\\W+included\\W+with\\W+the\\W+above\\W+copyright\\W+notice"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #11"
+         ,
+ "<P>This material is provided \"as is\", with absolutely no warranty expressed "
+         "or implied. Any use is at your own risk.</P>"
+ "<P>Permission to use or copy this software for any purpose is hereby granted " + "without fee, provided the above notices are retained on all copies. " + "Permission to modify the code and to distribute modified code is granted, " + "provided the above notices are retained, and a notice that the code was "
+         "modified is included with the above copyright notice.</P>"
+       )
+      ,
+ license_info( boost::regex("Permission\\W+to\\W+copy\\W+use\\W+and\\W+distribute\\W+this\\W+software\\W+is\\W+granted\\W+provided"
+                     
"\\W+that\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies"
+                     
"\\W+Permission\\W+to\\W+modify\\W+the\\W+code\\W+and\\W+to\\W+distribute\\W+modified\\W+code\\W+is\\W+granted"
+                     
"\\W+provided\\W+that\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies\\W+and\\W+a\\W+notice"
+                     
"\\W+that\\W+the\\W+code\\W+was\\W+modified\\W+is\\W+included\\W+with\\W+the\\W+copyright\\W+notice"
+                     
"\\W+This\\W+software\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty\\W+and"
+                     
"\\W+with\\W+no\\W+claim\\W+as\\W+to\\W+its\\W+suitability\\W+for\\W+any\\W+purpose"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #12"
+         ,
+ "<P>Copyright (C) <I>Date Author</I></P><P>Permission to copy, use, and distribute this software is granted, provided "
+         "that this copyright notice appears in all copies.<BR>"
+ "Permission to modify the code and to distribute modified code is granted, " + "provided that this copyright notice appears in all copies, and a notice " + "that the code was modified is included with the copyright notice.</P>" + "<P>This software is provided \"as is\" without express or implied warranty, and "
+         "with no claim as to its suitability for any purpose.</P>"
+       )
+      ,
+ license_info( boost::regex("Permission\\W+to\\W+copy\\W+and\\W+use\\W+this\\W+software\\W+is\\W+granted"
+                                 
"\\W+provided\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies"
+                                 
"\\W+Permission\\W+to\\W+modify\\W+the\\W+code\\W+and\\W+to\\W+distribute\\W+modified\\W+code\\W+is\\W+granted"
+                                 
"\\W+provided\\W+this\\W+copyright\\W+notice\\W+appears\\W+in\\W+all\\W+copies\\W+and\\W+a\\W+notice"
+                                 
"\\W+that\\W+the\\W+code\\W+was\\W+modified\\W+is\\W+included\\W+with\\W+the\\W+copyright\\W+notice"
+                                 
"\\W+This\\W+software\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty"
+                                 
"\\W+and\\W+with\\W+no\\W+claim\\W+as\\W+to\\W+its\\W+suitability\\W+for\\W+any\\W+purpose"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #13"
+         ,
+         "<P>Copyright (C) <I>Date Author</I></P>"
+         "<P>Permission to copy and use this software is granted, "
+         "provided this copyright notice appears in all copies. "
+ "Permission to modify the code and to distribute modified code is granted, " + "provided this copyright notice appears in all copies, and a notice " + "that the code was modified is included with the copyright notice.</P>" + "<P>This software is provided \"as is\" without express or implied warranty, "
+         "and with no claim as to its suitability for any purpose.</P>"
+       )
+      ,
+ license_info( boost::regex("Copyright\\W+Kevlin\\W+Henney\\W+2000\\W+All\\W+rights\\W+reserved\\W+"
+                                 
"Permission\\W+to\\W+use\\W+copy\\W+modify\\W+and\\W+distribute\\W+this\\W+software\\W+for\\W+any"
+                                 
"\\W+purpose\\W+is\\W+hereby\\W+granted\\W+without\\W+fee\\W+provided\\W+that\\W+this\\W+copyright\\W+and"
+                                 
"\\W+permissions\\W+notice\\W+appear\\W+in\\W+all\\W+copies\\W+and\\W+derivatives\\W+and\\W+that\\W+no"
+                                 
"\\W+charge\\W+may\\W+be\\W+made\\W+for\\W+the\\W+software\\W+and\\W+its\\W+documentation\\W+except\\W+to\\W+cover"
+                                 "\\W+cost\\W+of\\W+distribution"
+                                 
"\\W+This\\W+software\\W+is\\W+provided\\W+as\\W+is\\W+without\\W+express\\W+or\\W+implied\\W+warranty\\W+"
+                     , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Old style Boost license #14"
+         ,
+         "<P>Copyright The Author, The Date. All rights reserved.</P>"
+ "<P>Permission to use, copy, modify, and distribute this software for any" + " purpose is hereby granted without fee, provided that this copyright and" + " permissions notice appear in all copies and derivatives, and that no" + " charge may be made for the software and its documentation except to cover"
+         " cost of distribution.</P>"
+ "<P>This software is provided \"as is\" without express or implied warranty.</P>"
+       )
+      ,
+ license_info( boost::regex("preprocessed\\W+version\\W+of\\W+boost/mpl/.*\\.hpp\\W+header\\W+see\\W+the\\W+original\\W+for\\W+copyright\\W+information", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "SGI Style Licence (MPL preprocessed file)"
+         ,
+         "<P>Copyright (c) <I>Date</I><BR>"
+         "<I>Author</I><BR>"
+         "<BR>"
+ "Permission to use, copy, modify, distribute and sell this software " + "and its documentation for any purpose is hereby granted without fee, " + "provided that the above copyright notice appear in all copies and " + "that both that copyright notice and this permission notice appear " + "in supporting documentation. <I>Author</I> makes no representations "
+         "about the suitability of this software for any purpose. "
+ "It is provided \"as is\" without express or implied warranty.</P>"
+       )
+      ,
+      license_info( boost::regex(
+            "This\\W+file\\W+is\\W+part\\W+of\\W+jam\\W+"
+            
"License\\W+is\\W+hereby\\W+granted\\W+to\\W+use\\W+this\\W+software\\W+and\\W+distribute\\W+it\\W+"
+            
"freely\\W+as\\W+long\\W+as\\W+this\\W+copyright\\W+notice\\W+is\\W+retained\\W+and\\W+modifications\\W+"
+            "are\\W+clearly\\W+marked\\W+"
+            "ALL\\W+WARRANTIES\\W+ARE\\W+HEREBY\\W+DISCLAIMED"
+            "|"
+            
"This\\W+file\\W+is\\W+part\\W+of\\W+Jam\\W+see\\W+jam\\.c\\W+for\\W+Copyright\\W+information"
+            "|This file has been donated to Jam"
+ "|Generated by mkjambase from Jambase" , boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig + std::string("| (Craig\\W+W\\W+McPheeters\\W+Alias\\W+Wavefront)|(Generated by mkjambase from Jambase)"), boost::regex::perl | boost::regex::icase)
+         ,
+ generic_author_format + std::string("(?4Craig W. McPheeters, Alias|Wavefront)(?5Christopher Seiwald and Perforce Software, Inc)")
+         ,
+         "Perforce Jam License"
+         ,
+ "<P>Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.</P>"
+         "<P>This file is part of jam.</P>"
+ "<P>License is hereby granted to use this software and distribute it " + "freely, as long as this copyright notice is retained and modifications "
+         " are clearly marked.</P>"
+         "<P>ALL WARRANTIES ARE HEREBY DISCLAIMED</P>"
+       )
+      ,
+      license_info( boost::regex(
+            
"Permission\\W+is\\W+granted\\W+to\\W+anyone\\W+to\\W+use\\W+this\\W+software\\W+for\\W+any\\W+"
+            
"purpose\\W+on\\W+any\\W+computer\\W+system\\W+and\\W+to\\W+redistribute\\W+it\\W+freely\\W+"
+            "subject\\W+to\\W+the\\W+following\\W+restrictions\\W+"
+            
"1\\W+The\\W+author\\W+is\\W+not\\W+responsible\\W+for\\W+the\\W+consequences\\W+of\\W+use\\W+of\\W+"
+            
"this\\W+software\\W+no\\W+matter\\W+how\\W+awful\\W+even\\W+if\\W+they\\W+arise\\W+"
+            "from\\W+defects\\W+in\\W+it\\W+"
+            
"2\\W+The\\W+origin\\W+of\\W+this\\W+software\\W+must\\W+not\\W+be\\W+misrepresented\\W+either\\W+"
+            "by\\W+explicit\\W+claim\\W+or\\W+by\\W+omission\\W+"
+            
"3\\W+Altered\\W+versions\\W+must\\W+be\\W+plainly\\W+marked\\W+as\\W+such\\W+and\\W+must\\W+not\\W+"
+            
"be\\W+misrepresented\\W+as\\W+being\\W+the\\W+original\\W+software"
+ "|Definitions\\W+etc\\W+for\\W+regexp\\W+3\\W+routines", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig + std::string("| (Definitions\\W+etc\\W+for\\W+regexp\\W+3\\W+routines)"), boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format + std::string("(?4University of Toronto)")
+         ,
+         "BSD Regex License"
+         ,
+         "<P>Copyright (c) 1986 by University of Toronto.</P>"
+ "<P>Written by Henry Spencer. Not derived from licensed software.</P>"
+         "<P>Permission is granted to anyone to use this software for any"
+         "purpose on any computer system, and to redistribute it freely,"
+         "subject to the following restrictions:</P>"
+         "<P>The author is not responsible for the consequences of use of"
+         "this software, no matter how awful, even if they arise"
+         "from defects in it.</P>"
+ "<p>The origin of this software must not be misrepresented, either"
+         "by explicit claim or by omission.</p>"
+         "<p>Altered versions must be plainly marked as such, and must not"
+         "be misrepresented as being the original software.</P>"
+       )
+      ,
+      license_info( boost::regex(
+            
"Skeleton\\W+parser\\W+for\\W+Yacc\\W+like\\W+parsing\\W+with\\W+Bison\\W+"
+            "Copyright.{0,100}Free\\W+Software\\W+Foundation\\W+Inc\\W+"
+         
"\\W+This\\W+program\\W+is\\W+free\\W+software\\W+you\\W+can\\W+redistribute\\W+it\\W+and\\W+or\\W+modify\\W+"
+         
"it\\W+under\\W+the\\W+terms\\W+of\\W+the\\W+GNU\\W+General\\W+Public\\W+License\\W+as\\W+published\\W+by\\W+"
+         
"the\\W+Free\\W+Software\\W+Foundation\\W+either\\W+version\\W+2\\W+or\\W+at\\W+your\\W+option\\W+"
+         "any\\W+later\\W+version"
+         "|"
+ // this part matches the start of jamgramtab.h which is under the same licence
+         // but bison does not output it's usual licence declaration:
+ "\\{\\s*\"!\"\\s*,\\s*_BANG_t\\s*\\}", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig + std::string("| (\\{\\s*\"!\"\\s*,\\s*_BANG_t\\s*\\})"), boost::regex::perl | boost::regex::icase)
+         ,
+ generic_author_format + std::string("(?4Free Software Foundation, Inc)")
+         ,
+         "GNU Parser Licence"
+         ,
+         "<P>Skeleton parser for Yacc-like parsing with Bison,<BR>"
+ "Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.</P>" + "<P>This program is free software; you can redistribute it and/or modify" + "it under the terms of the GNU General Public License as published by" + "the Free Software Foundation; either version 2, or (at your option)"
+         "any later version.</P>"
+ "<P>This program is distributed in the hope that it will be useful,"
+         "but WITHOUT ANY WARRANTY; without even the implied warranty of"
+         "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the"
+         "GNU General Public License for more details.</P>"
+ "<P>You should have received a copy of the GNU General Public License"
+         "along with this program; if not, write to the Free Software"
+         "Foundation, Inc., 59 Temple Place - Suite 330,"
+         "Boston, MA 02111-1307, USA.</P>"
+ "<P>As a special exception, when this file is copied by Bison into a" + "Bison output file, you may use that output file without restriction."
+         "This special exception was added by the Free Software Foundation"
+         "in version 1.24 of Bison.</P>"
+       )
+      ,
+      license_info( boost::regex(
+ "(?:The| This)\\W+code\\W+is\\W+considered\\W+to\\W+be\\W+in\\W+the\\W+public\\W+domain", boost::regex::perl | boost::regex::icase)
+         ,
+ boost::regex(generic_author_sig, boost::regex::perl | boost::regex::icase)
+         ,
+         generic_author_format
+         ,
+         "Public Domain"
+         ,
+ "<P>The code has no license terms, it has been explicity placed in the\n"
+         "public domain by it's author(s).</P>"
+       )
+      ,
+   };
+ return std::pair<const license_info*, int>(licenses, sizeof(licenses)/sizeof(licenses[0]));
+}
+
+std::string format_authors_name(const std::string& name)
+{
+   // put name into a consistent format, so that we don't get too much
+ // of a proliferation of names (lots of versions of the same basic form).
+
+   static const boost::regex e("(^)?[^-(<a-zA-ZÀ-þ]+(([(<].*)?$)?");
+   static const char* formatter = "(?1:(?2: ))";
+
+ return boost::regex_replace(name, e, formatter, boost::match_default | boost::format_all);
+}
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/licence_info.hpp   Mon Feb  8 23:37:27 2010
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+#include <boost/regex.hpp>
+#include <utility>
+
+struct license_info
+{
+   boost::regex license_signature;
+   boost::regex copyright_signature;
+   std::string  copyright_formatter;
+   std::string  license_name;
+   std::string  license_text;
+   //
+   // we should really be able to initialize license_info as an
+   // aggregate, but some compilers reject this, so use a constructor
+   //instead:
+   //
+   license_info(const boost::regex& e1,
+            const boost::regex& e2,
+            const std::string& s1,
+            const std::string& s2,
+            const std::string& s3)
+            : license_signature(e1),
+              copyright_signature(e2),
+              copyright_formatter(s1),
+              license_name(s2),
+              license_text(s3){}
+};
+
+std::pair<const license_info*, int> get_licenses();
+
+std::string format_authors_name(const std::string& name);
=======================================
--- /dev/null
+++ /trunk/tools/bcp/main.cpp   Mon Feb  8 23:37:27 2010
@@ -0,0 +1,182 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the cpp_main entry point
+ */
+
+
+#include <iostream>
+#include <cstring>
+#include <string>
+#include <list>
+#include <boost/filesystem/path.hpp>
+#include <boost/version.hpp>
+#include "bcp.hpp"
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std{
+   using ::strcmp;
+   using ::strncmp;
+}
+#endif
+
+void show_usage()
+{
+   std::cout <<
+      "Usage:\n"
+      "   bcp --list [options] module-list\n"
+      "   bcp --list-short [options] module-list\n"
+      "   bcp --report [options] module-list html-file\n"
+      "   bcp [options] module-list output-path\n"
+      "\n"
+      "Options:\n"
+      "   --boost=path     sets the location of the boost tree to path\n"
+ " --scan treat the module list as a list of (possibly non-boost)\n"
+      "                    files to scan for boost dependencies\n"
+      "   --svn            only copy files under cvs version control\n"
+ " --unix-lines make sure that all copied files use Unix style line endings\n" + " --namespace=name rename the boost namespace to name (also changes library names).\n" + " --namespace-alias Makes namespace boost an alias of the namespace set with --namespace.\n"
+      "\n"
+ "module-list: a list of boost files or library names to copy\n" + "html-file: the name of a html file to which the report will be written\n"
+      "output-path:         the path to which files will be copied\n";
+}
+
+bool filesystem_name_check( const std::string & name )
+{
+   return true;
+}
+
+int cpp_main(int argc, char* argv[])
+{
+   //
+   // Before anything else replace Boost.filesystem's file
+   // name checker with one that does nothing (we only deal
+   // with files that already exist, if they're not portable
+   // names it's too late for us to do anything about it).
+   //
+   boost::filesystem::path::default_name_check(filesystem_name_check);
+   //
+   // without arguments just show help:
+   //
+   if(argc < 2)
+   {
+ std::cout << "Error: insufficient arguments, don't know what to do." << std::endl;
+      show_usage();
+      return 0;
+   }
+   //
+   // create the application object:
+   //
+   pbcp_application papp(bcp_application::create());
+   //
+   // work through args, and tell the application
+   // object what ir needs to do:
+   //
+   bool list_mode = false;
+   std::list<const char*> positional_args;
+   for(int i = 1; i < argc; ++i)
+   {
+      if(0 == std::strcmp("-h", argv[i])
+         || 0 == std::strcmp("--help", argv[i]))
+      {
+         show_usage();
+         return 0;
+      }
+      if(0 == std::strcmp("-v", argv[i])
+         || 0 == std::strcmp("--version", argv[i]))
+      {
+ std::cout << "bcp " << (BOOST_VERSION / 100000) << "." << (BOOST_VERSION / 100 % 1000) << "." << (BOOST_VERSION % 100) << std::endl;
+         std::cout << __DATE__ << std::endl;
+         return 0;
+      }
+      else if(0 == std::strcmp("--list", argv[i]))
+      {
+         list_mode = true;
+         papp->enable_list_mode();
+      }
+      else if(0 == std::strcmp("--list-short", argv[i]))
+      {
+         list_mode = true;
+         papp->enable_summary_list_mode();
+      }
+      else if(0 == std::strcmp("--report", argv[i]))
+      {
+         papp->enable_license_mode();
+      }
+      else if(0 == std::strcmp("--cvs", argv[i]))
+      {
+         papp->enable_cvs_mode();
+      }
+      else if(0 == std::strcmp("--svn", argv[i]))
+      {
+         papp->enable_svn_mode();
+      }
+      else if(0 == std::strcmp("--scan", argv[i]))
+      {
+         papp->enable_scan_mode();
+      }
+      else if(0 == std::strcmp("--bsl-convert", argv[i]))
+      {
+         papp->enable_bsl_convert_mode();
+      }
+      else if(0 == std::strcmp("--bsl-summary", argv[i]))
+      {
+         papp->enable_bsl_summary_mode();
+      }
+      else if(0 == std::strcmp("--unix-lines", argv[i]))
+      {
+         papp->enable_unix_lines();
+      }
+      else if(0 == std::strncmp("--boost=", argv[i], 8))
+      {
+         papp->set_boost_path(argv[i] + 8);
+      }
+      else if(0 == std::strncmp("--namespace=", argv[i], 12))
+      {
+         papp->set_namespace(argv[i] + 12);
+      }
+      else if(0 == std::strncmp("--namespace-alias", argv[i], 17))
+      {
+         papp->set_namespace_alias(true);
+      }
+      else if(0 == std::strncmp("--list-namespaces", argv[i], 17))
+      {
+         list_mode = true;
+         papp->set_namespace_list(true);
+      }
+      else if(argv[i][0] == '-')
+      {
+         std::cout << "Error: Unknown argument " << argv[i] << std::endl;
+         show_usage();
+         return 1;
+      }
+      else
+      {
+         positional_args.push_back(argv[i]);
+      }
+   }
+   //
+   // Handle positional args last:
+   //
+   for(std::list<const char*>::const_iterator i = positional_args.begin();
+      i != positional_args.end(); ++i)
+   {
+      if(!list_mode && (i == --positional_args.end()))
+         papp->set_destination(*i);
+      else
+         papp->add_module(*i);
+   }
+   //
+   // run the application object:
+   //
+   return papp->run();
+}
+
+
+
=======================================
--- /dev/null
+++ /trunk/tools/bcp/output_licence_info.cpp    Mon Feb  8 23:37:27 2010
@@ -0,0 +1,408 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+#include "licence_info.hpp"
+#include "bcp_imp.hpp"
+#include "fileview.hpp"
+#include <fstream>
+#include <iomanip>
+#include <cstring>
+#include <stdexcept>
+#include <boost/lexical_cast.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/throw_exception.hpp>
+
+//
+// split_path is a small helper for outputting a path name,
+// complete with a link to that path:
+//
+struct split_path
+{
+   const fs::path& root;
+   const fs::path& file;
+   split_path(const fs::path& r, const fs::path& f)
+      : root(r), file(f){}
+};
+
+std::ostream& operator << (std::ostream& os, const split_path& p)
+{
+ os << "<a href=\"" << (p.root / p.file).string() << "\">" << p.file.string() << "</a>";
+   return os;
+}
+
+std::string make_link_target(const std::string& s)
+{
+   // convert an arbitrary string into something suitable
+   // for an <a> name:
+   std::string result;
+   for(unsigned i = 0; i < s.size(); ++i)
+   {
+ result.append(1, static_cast<std::string::value_type>(std::isalnum(s[i]) ? s[i] : '_'));
+   }
+   return result;
+}
+
+
+void bcp_implementation::output_license_info()
+{
+   std::pair<const license_info*, int> licenses = get_licenses();
+
+   std::map<int, license_data>::const_iterator i, j;
+   i = m_license_data.begin();
+   j = m_license_data.end();
+
+   std::ofstream os(m_dest_path.native_file_string().c_str());
+   if(!os)
+   {
+      std::string msg("Error opening ");
+      msg += m_dest_path.string();
+      msg += " for output.";
+      std::runtime_error e(msg);
+      boost::throw_exception(e);
+   }
+   os <<
+      "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+      "<html>\n"
+      "<head>\n"
+      "<title>Boost Licence Dependency Information";
+   if(m_module_list.size() == 1)
+   {
+      os << " for " << *(m_module_list.begin());
+   }
+   os <<
+      "</title>\n"
+      "</head>\n"
+      "<body>\n"
+      "<H1>Boost Licence Dependency Information";
+   if(m_module_list.size() == 1)
+   {
+      os << " for " << *(m_module_list.begin());
+   }
+   os <<
+      "</H1>\n"
+      "<H2>Contents</h2>\n"
+      "<pre><a href=\"#input\">Input Information</a>\n";
+   if(!m_bsl_summary_mode)
+      os << "<a href=\"#summary\">Licence Summary</a>\n";
+   os << "<a href=\"#details\">Licence Details</a>\n";
+
+   while(i != j)
+   {
+      // title:
+ os << " <A href=\"#" << make_link_target(licenses.first[i->first].license_name)
+         << "\">" << licenses.first[i->first].license_name << "</a>\n";
+      ++i;
+   }
+
+   os << "<a href=\"#files\">Files with no recognised license</a>\n"
+ "<a href=\"#authors\">Files with no recognised copyright holder</a>\n";
+   if(!m_bsl_summary_mode)
+   {
+      os <<
+      "Moving to the Boost Software License...\n"
+ " <a href=\"#bsl-converted\">Files that can be automatically converted to the Boost Software License</a>\n" + " <a href=\"#to-bsl\">Files that can be manually converted to the Boost Software License</a>\n" + " <a href=\"#not-to-bsl\">Files that can <b>NOT</b> be moved to the Boost Software License</a>\n" + " <a href=\"#need-bsl-authors\">Authors we need to move to the Boost Software License</a>\n"
+      "<a href=\"#copyright\">Copyright Holder Information</a>\n";
+   }
+   os <<
+      "<a href=\"#depend\">File Dependency Information</a>\n"
+      "</pre>";
+
+   //
+   // input Information:
+   //
+   os << "<a name=\"input\"></a><h2>Input Information</h2>\n";
+   if(m_scan_mode)
+ os << "<P>The following files were scanned for boost dependencies:<BR>";
+   else
+      os << "<P>The following Boost modules were checked:<BR>";
+
+   std::list<std::string>::const_iterator si = m_module_list.begin();
+   std::list<std::string>::const_iterator sj = m_module_list.end();
+   while(si != sj)
+   {
+      os << *si << "<BR>";
+      ++si;
+   }
+ os << "</p><p>The Boost path was: <code>" << m_boost_path.string() << "</code></P>";
+   //
+   // extract the boost version number from the boost directory tree,
+   // not from this app (which may have been built from a previous
+   // version):
+   //
+   fileview version_file(m_boost_path / "boost/version.hpp");
+   static const boost::regex version_regex(
+      
"^[[:blank:]]*#[[:blank:]]*define[[:blank:]]+BOOST_VERSION[[:blank:]]+(\\d+)");
+   boost::cmatch what;
+ if(boost::regex_search(version_file.begin(), version_file.end(), what, version_regex))
+   {
+      int version = boost::lexical_cast<int>(what.str(1));
+ os << "<p>The Boost version is: " << version / 100000 << "." << version / 100 % 1000 << "." << version % 100 << "</P>\n";
+   }
+
+   //
+   // output each license:
+   //
+   i = m_license_data.begin();
+   j = m_license_data.end();
+   if(!m_bsl_summary_mode)
+   {
+      //
+      // start with the summary:
+      //
+      os << "<a name=\"summary\"></a><h2>Licence Summary</h2>\n";
+      while(i != j)
+      {
+         // title:
+         os <<
+            "<H3>" << licenses.first[i->first].license_name << "</H3>\n";
+         // license text:
+ os << "<BLOCKQUOTE>" << licenses.first[i->first].license_text << "</BLOCKQUOTE>";
+         // Copyright holders:
+         os << "<P>This license is used by " << i->second.authors.size()
+            << " authors and " << i->second.files.size()
+ << " files <a href=\"#" << make_link_target(licenses.first[i->first].license_name) << "\">(see details)</a>";
+         os << "</P></BLOCKQUOTE>\n";
+         ++i;
+      }
+   }
+   //
+   // and now the details:
+   //
+   i = m_license_data.begin();
+   j = m_license_data.end();
+   int license_index = 0;
+   os << "<a name=\"details\"></a><h2>Licence Details</h2>\n";
+   while(i != j)
+   {
+      // title:
+      os <<
+ "<H3><A name=\"" << make_link_target(licenses.first[i->first].license_name) + << "\"></a>" << licenses.first[i->first].license_name << "</H3>\n";
+      // license text:
+ os << "<BLOCKQUOTE>" << licenses.first[i->first].license_text << "</BLOCKQUOTE>";
+      if(!m_bsl_summary_mode || (license_index >= 3))
+      {
+         // Copyright holders:
+ os << "<P>This license is used by the following " << i->second.authors.size() << " copyright holders:</P>\n<BLOCKQUOTE><P>";
+         std::set<std::string>::const_iterator x, y;
+         x = i->second.authors.begin();
+         y = i->second.authors.end();
+         while(x != y)
+         {
+            os << *x << "<BR>\n";
+            ++x;
+         }
+         os << "</P></BLOCKQUOTE>\n";
+         // Files using this license:
+ os << "<P>This license applies to the following " << i->second.files.size() << " files:</P>\n<BLOCKQUOTE><P>";
+         std::set<fs::path, path_less>::const_iterator m, n;
+         m = i->second.files.begin();
+         n = i->second.files.end();
+         while(m != n)
+         {
+            os << split_path(m_boost_path, *m) << "<br>\n";
+            ++m;
+         }
+         os << "</P></BLOCKQUOTE>\n";
+      }
+      else
+      {
+ os << "<P>This license is used by " << i->second.authors.size() << " authors (list omitted for brevity).</P>\n"; + os << "<P>This license applies to " << i->second.files.size() << " files (list omitted for brevity).</P>\n";
+      }
+      ++license_index;
+      ++i;
+   }
+   //
+   // Output list of files not found to be under license control:
+   //
+ os << "<h2><a name=\"files\"></a>Files With No Recognisable Licence</h2>\n" + "<P>The following " << m_unknown_licenses.size() << " files had no recognisable license information:</P><BLOCKQUOTE><P>\n";
+   std::set<fs::path, path_less>::const_iterator i2, j2;
+   i2 = m_unknown_licenses.begin();
+   j2 = m_unknown_licenses.end();
+   while(i2 != j2)
+   {
+      os << split_path(m_boost_path, *i2) << "<br>\n";
+      ++i2;
+   }
+   os << "</p></BLOCKQUOTE>";
+   //
+   // Output list of files with no found copyright holder:
+   //
+ os << "<h2><a name=\"authors\"></a>Files With No Recognisable Copyright Holder</h2>\n" + "<P>The following " << m_unknown_authors.size() << " files had no recognisable copyright holder:</P>\n<BLOCKQUOTE><P>";
+   i2 = m_unknown_authors.begin();
+   j2 = m_unknown_authors.end();
+   while(i2 != j2)
+   {
+      os << split_path(m_boost_path, *i2) << "<br>\n";
+      ++i2;
+   }
+   os << "</p></BLOCKQUOTE>";
+   if(!m_bsl_summary_mode)
+   {
+      //
+      // Output list of files that have been moved over to the Boost
+      // Software License, along with enough information for human
+      // verification.
+      //
+ os << "<h2><a name=\"bsl-converted\"></a>Files that can be automatically converted to the Boost Software License</h2>\n" + << "<P>The following " << m_converted_to_bsl.size() << " files can be automatically converted to the Boost Software License, but require manual verification before they can be committed to CVS:</P>\n";
+      if (!m_converted_to_bsl.empty())
+      {
+ typedef std::map<fs::path, std::pair<std::string, std::string>, path_less>
+            ::const_iterator conv_iterator;
+         conv_iterator i = m_converted_to_bsl.begin(),
+                        ie = m_converted_to_bsl.end();
+         int file_num = 1;
+         while (i != ie)
+         {
+ os << "<P>[" << file_num << "] File: <tt>" << split_path(m_boost_path, i->first)
+               << "</tt><br>\n<table border=\"1\">\n  <tr>\n    <td><pre>"
+               << i->second.first << "</pre></td>\n    <td><pre>"
+               << i->second.second << "</pre></td>\n  </tr>\n</table>\n";
+            ++i;
+            ++file_num;
+         }
+      }
+      //
+ // Output list of files that could be moved over to the Boost Software License
+      //
+ os << "<h2><a name=\"to-bsl\"></a>Files that could be converted to the Boost Software License</h2>\n" + "<P>The following " << m_can_migrate_to_bsl.size() << " files could be manually converted to the Boost Software License, but have not yet been:</P>\n<BLOCKQUOTE><P>";
+      i2 = m_can_migrate_to_bsl.begin();
+      j2 = m_can_migrate_to_bsl.end();
+      while(i2 != j2)
+      {
+         os << split_path(m_boost_path, *i2) << "<br>\n";
+         ++i2;
+      }
+      os << "</p></BLOCKQUOTE>";
+      //
+ // Output list of files that can not be moved over to the Boost Software License
+      //
+ os << "<h2><a name=\"not-to-bsl\"></a>Files that can NOT be converted to the Boost Software License</h2>\n" + "<P>The following " << m_cannot_migrate_to_bsl.size() << " files cannot be converted to the Boost Software License because we need the permission of more authors:</P>\n<BLOCKQUOTE><P>";
+      i2 = m_cannot_migrate_to_bsl.begin();
+      j2 = m_cannot_migrate_to_bsl.end();
+      while(i2 != j2)
+      {
+         os << split_path(m_boost_path, *i2) << "<br>\n";
+         ++i2;
+      }
+      os << "</p></BLOCKQUOTE>";
+      //
+ // Output list of authors that we need permission for to move to the BSL
+      //
+ os << "<h2><a name=\"need-bsl-authors\"></a>Authors we need for the BSL</h2>\n" + "<P>Permission of the following authors is needed before we can convert to the Boost Software License. The list of authors that have given their permission is contained in <code>more/blanket-permission.txt</code>.</P>\n<BLOCKQUOTE><P>"; + std::copy(m_authors_for_bsl_migration.begin(), m_authors_for_bsl_migration.end(),
+               std::ostream_iterator<std::string>(os, "<br>\n"));
+      os << "</p></BLOCKQUOTE>";
+      //
+      // output a table of copyright information:
+      //
+ os << "<H2><a name=\"copyright\"></a>Copyright Holder Information</H2><table border=\"1\">\n"; + std::map<std::string, std::set<fs::path, path_less>
::const_iterator ad, ead;
+      ad = m_author_data.begin();
+      ead = m_author_data.end();
+      while(ad != ead)
+      {
+         os << "<tr><td>" << ad->first << "</td><td>";
+         std::set<fs::path, path_less>::const_iterator fi, efi;
+         fi = ad->second.begin();
+         efi = ad->second.end();
+         while(fi != efi)
+         {
+            os << split_path(m_boost_path, *fi) << " ";
+            ++fi;
+         }
+         os << "</td></tr>\n";
+         ++ad;
+      }
+      os << "</table>\n";
+   }
+
+   //
+   // output file dependency information:
+   //
+ os << "<H2><a name=\"depend\"></a>File Dependency Information</H2><BLOCKQUOTE><pre>\n";
+   std::map<fs::path, fs::path, path_less>::const_iterator dep, last_dep;
+   std::set<fs::path, path_less>::const_iterator fi, efi;
+   fi = m_copy_paths.begin();
+   efi = m_copy_paths.end();
+ // if in summary mode, just figure out the "bad" files and print those only:
+   std::set<fs::path, path_less> bad_paths;
+   if(m_bsl_summary_mode)
+   {
+ bad_paths.insert(m_unknown_licenses.begin(), m_unknown_licenses.end());
+      bad_paths.insert(m_unknown_authors.begin(), m_unknown_authors.end());
+ bad_paths.insert(m_can_migrate_to_bsl.begin(), m_can_migrate_to_bsl.end()); + bad_paths.insert(m_cannot_migrate_to_bsl.begin(), m_cannot_migrate_to_bsl.end()); + typedef std::map<fs::path, std::pair<std::string, std::string>, path_less>
+         ::const_iterator conv_iterator;
+      conv_iterator i = m_converted_to_bsl.begin(),
+                     ie = m_converted_to_bsl.end();
+      while(i != ie)
+      {
+         bad_paths.insert(i->first);
+         ++i;
+      }
+      fi = bad_paths.begin();
+      efi = bad_paths.end();
+      os << "<P>For brevity, only files not under the BSL are shown</P>\n";
+   }
+   while(fi != efi)
+   {
+      os << split_path(m_boost_path, *fi);
+      dep = m_dependencies.find(*fi);
+      last_dep = m_dependencies.end();
+      std::set<fs::path, path_less> seen_deps;
+      if (dep != last_dep)
+        while(true)
+          {
+            os << " -> ";
+            if(fs::exists(m_boost_path / dep->second))
+              os << split_path(m_boost_path, dep->second);
+            else if(fs::exists(dep->second))
+              os << split_path(fs::path(), dep->second);
+            else
+              os << dep->second.string();
+            if(seen_deps.find(dep->second) != seen_deps.end())
+              {
+                os << " <I>(Circular dependency!)</I>";
+                break; // circular dependency!!!
+              }
+            seen_deps.insert(dep->second);
+            last_dep = dep;
+            dep = m_dependencies.find(dep->second);
+ if((dep == m_dependencies.end()) || (0 == compare_paths(dep->second, last_dep->second)))
+              break;
+          }
+      os << "\n";
+      ++fi;
+   }
+   os << "</pre></BLOCKQUOTE>\n";
+
+   os << "</body></html>\n";
+
+   if(!os)
+   {
+      std::string msg("Error writing to ");
+      msg += m_dest_path.string();
+      msg += ".";
+      std::runtime_error e(msg);
+      boost::throw_exception(e);
+   }
+
+}
=======================================
--- /dev/null
+++ /trunk/tools/bcp/path_operations.cpp        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,41 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements path comparisons
+ */
+
+
+#include "bcp_imp.hpp"
+#include <cctype>
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std{
+   using ::tolower;
+}
+#endif
+
+
+int compare_paths(const fs::path& a, const fs::path& b)
+{
+   const std::string& as = a.string();
+   const std::string& bs = b.string();
+   std::string::const_iterator i, j, k, l;
+   i = as.begin();
+   j = as.end();
+   k = bs.begin();
+   l = bs.end();
+   while(i != j)
+   {
+      if(k == l)
+         return -1;
+      int r = std::tolower(*i) - std::tolower(*k);
+      if(r) return r;
+      ++i;
+      ++k;
+   }
+   return (k == l) ? 0 : 1;
+}
=======================================
--- /dev/null
+++ /trunk/tools/bcp/scan_cvs_path.cpp  Mon Feb  8 23:37:27 2010
@@ -0,0 +1,147 @@
+/*
+ *
+ * Copyright (c) 2003-7 John Maddock
+ * Copyright (c) 2007 Bjorn Roald
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * This file implements the following:
+ *    void bcp_implementation::scan_cvs_path(const fs::path& p)
+ */
+
+
+
+#include "bcp_imp.hpp"
+#include "fileview.hpp"
+#include <boost/regex.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/detail/workaround.hpp>
+#include <iostream>
+
+void bcp_implementation::scan_cvs_path(const fs::path& p)
+{
+   //
+   // scan through the cvs admin files to build a list
+   // of all the files under cvs version control
+   // and whether they are text or binary:
+   //
+   static const char* file_list[] = { "CVS/Entries", "CVS/Entries.Log" };
+ static const boost::regex file_expression("^(?:A\\s+)?/([^/\\n]+)/[^/\\n]*/[^/\\n]*/[^k/\\n]*(kb[^/\\n]*)?/[^/\\n]*");
+   static const boost::regex dir_expression("^(?:A\\s+)?D/([^/\\n]+)/");
+   static const int file_subs[] = {1,2,};
+
+ for(int entry = 0; entry < sizeof(file_list)/sizeof(file_list[0]); ++entry)
+   {
+      fs::path entries(m_boost_path / p / file_list[entry]);
+      if(fs::exists(entries))
+      {
+         fileview view(entries);
+ boost::regex_token_iterator<const char*> i(view.begin(), view.end(), dir_expression, 1);
+         boost::regex_token_iterator<const char*> j;
+         while(i != j)
+         {
+            fs::path recursion_dir(p / i->str());
+            scan_cvs_path(recursion_dir);
+            ++i;
+         }
+ #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570))
+         std::vector<int> v(file_subs, file_subs + 2);
+ i = boost::regex_token_iterator<const char*>(view.begin(), view.end(), file_expression, v);
+   #else
+ i = boost::regex_token_iterator<const char*>(view.begin(), view.end(), file_expression, file_subs);
+   #endif
+         while(i != j)
+         {
+            fs::path file = p / i->str();
+            ++i;
+            bool binary = i->length() ? true : false;
+            ++i;
+            m_cvs_paths[file] = binary;
+         }
+
+      }
+   }
+}
+
+void bcp_implementation::scan_svn_path(const fs::path& p)
+{
+   //
+   // scan through the svn entries files to build a list
+   // of all the files under svn version control
+   // and whether they are text or binary:
+   //
+   static const boost::regex entry_expression("^\\f([^\\f]*)");
+ static const boost::regex entry_line_expression("\\n[[:blank:]]*([^\\n]*)");
+   //    static const boost::regex
+ // mime_type_expression("\\nsvn:mime-type\\nV [[digit]]*\\n([^/]*)[^\\n]*");
+
+   fs::path entries(m_boost_path / p / ".svn" / "entries");
+   if(fs::exists(entries))
+   {
+      fileview view(entries);
+      boost::cregex_token_iterator
+         i(view.begin(), view.end(), entry_expression, 1), j;
+
+      while(i != j) // entries
+      {
+         std::string entr = i->str();
+         boost::sregex_token_iterator
+ atr_it(entr.begin(), entr.end(), entry_line_expression, 1), atr_j;
+
+         if(atr_it != atr_j)
+         {
+            std::string name = atr_it->str(); // name of file or directory
+            fs::path fpath = p / name;
+            if(++atr_it != atr_j)
+            {
+               std::string kind = atr_it->str();
+               if(kind == "file")
+               {
+                  // find if binary, we asume text unless mime type is
+                  // set in property file
+                  bool binary = false;  //
+
+                  // skip some lines    type                   | example
+                  if( ++atr_it != atr_j  &&  // revnum         |
+                     ++atr_it != atr_j  &&  // url            |
+                     ++atr_it != atr_j  &&  // repos          |
+                     ++atr_it != atr_j  &&  // scedule attr   |
+ ++atr_it != atr_j && // text timestamp | 2007-09-02T... + ++atr_it != atr_j && // checksum | 58f4bfa7860... + ++atr_it != atr_j && // cmt_date | 2007-05-09T...
+                     ++atr_it != atr_j  &&  // cmt_rev        | 37654
+                     ++atr_it != atr_j  &&  // cmt_author     | dgregor
+                     ++atr_it != atr_j )    // has_props      | has-props
+                  {
+                     if(atr_it->str() == "has-props")
+                     {
+                        // we  need to check properties file for mime-type
+ // that does not start with "text/", if found file is binary + fs::path properties(m_boost_path / p / ".svn" / "prop-base"
+                           / (name + ".svn-base") );
+                        if(fs::exists(properties))
+                        {
+                           fileview prop(properties);
+
+                           static const boost::regex mime_type(
+ "svn:mime-type[[:blank:]]*(?:\\n|\\r| \\r\\n)[^\\r\\n]*(?:\\n|\\r|\\r\\n)[[:blank:]]*text/"); + binary = regex_search(prop.begin(), prop.end(), mime_type) ? false : true;
+                        }
+                     }
+                  }
+                  m_cvs_paths[fpath] = binary;
+               }  // kind == "file"
+               else if(kind == "dir")
+               {
+                  scan_svn_path(fpath); // recursion for directory entries
+               }
+               //       else
+ // std::cerr << "WARNING: unknown entry kind for entry " << name
+               //              << "in " << entries << std::endl;
+            }
+         }
+         ++i;
+      } // while
+   }
+}
=======================================
--- /dev/null
+++ /trunk/tools/bcp/scan_licence.cpp   Mon Feb  8 23:37:27 2010
@@ -0,0 +1,275 @@
+/*
+ *
+ * Copyright (c) 2003 Dr John Maddock
+ * Use, modification and distribution is subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+#include "licence_info.hpp"
+#include "bcp_imp.hpp"
+#include "fileview.hpp"
+#include <fstream>
+#include <iostream>
+
+
+const int boost_license_lines = 3;
+static const std::string boost_license_text[boost_license_lines] = {
+  "Distributed under the Boost Software License, Version 1.0. (See",
+  "accompanying file LICENSE_1_0.txt or copy at",
+  "http://www.boost.org/LICENSE_1_0.txt)"
+};
+
+fileview::const_iterator
+context_before_license(const fileview& v, fileview::const_iterator start,
+                       int context_lines = 3)
+{
+  char last_char = '\0';
+  while (start != v.begin() && context_lines >= 0) {
+    if (*start == '\r' || *start == '\n'
+ && (last_char == *start || (last_char != '\r' && last_char != '\n')))
+        --context_lines;
+
+    last_char = *start;
+    --start;
+  }
+
+  // Unless we hit the beginning, we need to step forward one to start
+  // on the next line.
+  if (start != v.begin()) ++start;
+
+  return start;
+}
+
+fileview::const_iterator
+context_after_license(const fileview& v, fileview::const_iterator end,
+                      int context_lines = 3)
+{
+  char last_char = '\0';
+  while (end != v.end() && context_lines >= 0) {
+    if (*end == '\r' || *end == '\n'
+        && (last_char == *end || (last_char != '\r' && last_char != '\n')))
+        --context_lines;
+
+    last_char = *end;
+    ++end;
+  }
+
+  return end;
+}
+
+static std::string
+find_prefix(const fileview& v, fileview::const_iterator start_of_line)
+{
+  while (start_of_line != v.begin()
+         && *start_of_line != '\n'
+         && *start_of_line != '\r')
+    --start_of_line;
+  if (start_of_line != v.begin())
+    ++start_of_line;
+
+  fileview::const_iterator first_noncomment_char = start_of_line;
+  while (*first_noncomment_char == '/'
+         || *first_noncomment_char == '*'
+         || *first_noncomment_char == ' '
+         || *first_noncomment_char == '#')
+    ++first_noncomment_char;
+
+  return std::string(start_of_line, first_noncomment_char);
+}
+
+static std::string
+html_escape(fileview::const_iterator first, fileview::const_iterator last)
+{
+  std::string result;
+  while (first != last) {
+    switch (*first) {
+    case '<': result += "&lt;"; break;
+    case '>': result += "&gt;"; break;
+    case '&': result += "&amp;"; break;
+    default: result += *first;
+    }
+    ++first;
+  }
+  return result;
+}
+
+static bool is_non_bsl_license(int index)
+{
+  return index > 2;
+}
+
+void bcp_implementation::scan_license(const fs::path& p, const fileview& v)
+{
+   std::pair<const license_info*, int> licenses = get_licenses();
+   //
+   // scan file for all the licenses in the list:
+   //
+   int license_count = 0;
+   int author_count = 0;
+   int nonbsl_author_count = 0;
+   bool has_non_bsl_license = false;
+   fileview::const_iterator start_of_license = v.begin(),
+                            end_of_license = v.end();
+   bool start_in_middle_of_line = false;
+
+   for(int i = 0; i < licenses.second; ++i)
+   {
+      boost::match_results<fileview::const_iterator> m;
+ if(boost::regex_search(v.begin(), v.end(), m, licenses.first[i].license_signature))
+      {
+           start_of_license = m[0].first;
+         end_of_license = m[0].second;
+
+         if (is_non_bsl_license(i) && i < licenses.second - 1)
+           has_non_bsl_license = true;
+
+         // add this license to the list:
+         m_license_data[i].files.insert(p);
+         ++license_count;
+         //
+         // scan for the associated copyright declarations:
+         //
+ boost::regex_iterator<const char*> cpy(v.begin(), v.end(), licenses.first[i].copyright_signature);
+         boost::regex_iterator<const char*> ecpy;
+         while(cpy != ecpy)
+         {
+#if 0
+             // Not dealing with copyrights because we don't have the years
+            if ((*cpy)[0].first < start_of_license)
+              start_of_license = (*cpy)[0].first;
+            if ((*cpy)[0].second > end_of_license)
+              end_of_license = (*cpy)[0].second;
+#endif
+
+            // extract the copy holders as a list:
+ std::string author_list = cpy->format(licenses.first[i].copyright_formatter, boost::format_all);
+            // now enumerate that list for all the names:
+ static const boost::regex author_separator("(?:\\s*,(?!\\s*(?:inc|ltd)\\b)\\s*|\\s+(,\\s*)?(and| &)\\s+)|by\\s+", boost::regex::perl | boost::regex::icase); + boost::regex_token_iterator<std::string::const_iterator> atr(author_list.begin(), author_list.end(), author_separator, -1);
+            boost::regex_token_iterator<std::string::const_iterator> eatr;
+            while(atr != eatr)
+            {
+               // get the reformatted authors name:
+               std::string name = format_authors_name(*atr);
+               // add to list of authors for this file:
+               if(name.size() && name[0] != '-')
+               {
+                  m_license_data[i].authors.insert(name);
+                  // add file to author index:
+                  m_author_data[name].insert(p);
+                  ++author_count;
+
+ // If this is not the Boost Software License (license 0), and the author hasn't given
+                  // blanket permission, note this for the report.
+                  if (has_non_bsl_license
+                      && m_bsl_authors.find(name) == m_bsl_authors.end()) {
+                    ++nonbsl_author_count;
+                    m_authors_for_bsl_migration.insert(name);
+                  }
+               }
+               ++atr;
+            }
+            ++cpy;
+         }
+
+         while (start_of_license != v.begin()
+                && *start_of_license != '\r'
+                && *start_of_license != '\n'
+                && *start_of_license != '.')
+           --start_of_license;
+
+         if (start_of_license != v.begin()) {
+           if (*start_of_license == '.')
+             start_in_middle_of_line = true;
+           ++start_of_license;
+         }
+
+         while (end_of_license != v.end()
+                && *end_of_license != '\r'
+                && *end_of_license != '\n')
+           ++end_of_license;
+      }
+   }
+   if(license_count == 0)
+      m_unknown_licenses.insert(p);
+   if(license_count && !author_count)
+      m_unknown_authors.insert(p);
+
+   if (has_non_bsl_license) {
+     bool converted = false;
+     if (nonbsl_author_count == 0
+         && license_count == 1) {
+       // Grab a few lines of context
+       fileview::const_iterator context_start =
+         context_before_license(v, start_of_license);
+       fileview::const_iterator context_end =
+         context_after_license(v, end_of_license);
+
+       // TBD: For files that aren't C++ code, this will have to
+       // change.
+       std::string prefix = find_prefix(v, start_of_license);
+
+       // Create enough information to permit manual verification of
+       // the correctness of the transformation
+       std::string before_conversion =
+         html_escape(context_start, start_of_license);
+       before_conversion += "<b>";
+       before_conversion += html_escape(start_of_license, end_of_license);
+       before_conversion += "</b>";
+       before_conversion += html_escape(end_of_license, context_end);
+
+       std::string after_conversion =
+         html_escape(context_start, start_of_license);
+       if (start_in_middle_of_line)
+         after_conversion += '\n';
+
+       after_conversion += "<b>";
+       for (int i = 0; i < boost_license_lines; ++i) {
+         if (i > 0) after_conversion += '\n';
+         after_conversion += prefix + boost_license_text[i];
+       }
+       after_conversion += "</b>";
+       after_conversion += html_escape(end_of_license, context_end);
+
+       m_converted_to_bsl[p] =
+         std::make_pair(before_conversion, after_conversion);
+
+       // Perform the actual conversion
+       if (m_bsl_convert_mode) {
+          try{
+ std::ofstream out((m_boost_path / p).native_file_string().c_str());
+            if (!out) {
+ std::string msg("Cannot open file for license conversion: ");
+               msg += p.native_file_string();
+               std::runtime_error e(msg);
+               boost::throw_exception(e);
+            }
+
+            out << std::string(v.begin(), start_of_license);
+            if (start_in_middle_of_line)
+               out << std::endl;
+
+            for (int j = 0; j < boost_license_lines; ++j) {
+               if (j > 0) out << std::endl;
+               out << prefix << boost_license_text[j];
+            }
+            out << std::string(end_of_license, v.end());
+
+            converted = true;
+       }
+       catch(const std::exception& e)
+       {
+          std::cerr << e.what() << std::endl;
+       }
+      }
+     }
+
+     if (!converted) {
+       if (nonbsl_author_count > 0) m_cannot_migrate_to_bsl.insert(p);
+       else m_can_migrate_to_bsl.insert(p);
+     }
+   }
+}
+
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/admon.xsl        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/admon.xsl"/>
+<xsl:import href="relative-href.xsl"/>
+
+<xsl:template name="admon.graphic">
+    <xsl:param name="node" select="."/>
+
+    <xsl:call-template name="href.target.relative">
+        <xsl:with-param name="target" select="$admon.graphics.path"/>
+    </xsl:call-template>
+
+    <xsl:choose>
+        <xsl:when test="local-name($node)='note'">note</xsl:when>
+        <xsl:when test="local-name($node)='warning'">warning</xsl:when>
+        <xsl:when test="local-name($node)='caution'">caution</xsl:when>
+        <xsl:when test="local-name($node)='tip'">tip</xsl:when>
+        <xsl:when test="local-name($node)='important'">important</xsl:when>
+        <xsl:otherwise>note</xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:value-of select="$admon.graphics.extension"/>
+</xsl:template>
+
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/annotation.xsl   Mon Feb  8 23:37:27 2010
@@ -0,0 +1,425 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+ <xsl:variable name="uppercase-letters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/> + <xsl:variable name="lowercase-letters" select="'abcdefghijklmnopqrstuvwxyz'"/>
+
+  <xsl:key name="classes" match="class|struct|union|typedef" use="@name"/>
+  <xsl:key name="methods" match="method|overloaded-method" use="@name"/>
+ <xsl:key name="functions" match="function|overloaded-function" use="@name"/>
+  <xsl:key name="enums" match="enum" use="@name"/>
+  <xsl:key name="concepts" match="concept" use="@name"/>
+  <xsl:key name="libraries" match="library" use="@name"/>
+  <xsl:key name="macros" match="macro" use="@name"/>
+  <xsl:key name="headers" match="header" use="@name"/>
+ <xsl:key name="globals" match="namespace/data-member|header/data-member" use="@name"/> + <xsl:key name="named-entities" match="class|struct|union|concept| function|overloaded-function|macro|library|namespace/data-member| header/data-member|*[attribute::id]" use="translate(@name|@id, $uppercase-letters, $lowercase-letters)"/>
+
+  <xsl:template match="function|overloaded-function" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="classname" mode="annotation">
+ <!-- Determine the (possibly qualified) class name we are looking for -->
+    <xsl:variable name="fullname">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Strip off any instantiation -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="contains($fullname, '&lt;')">
+          <xsl:value-of select="substring-before($fullname, '&lt;')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$fullname"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'class'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+ <xsl:with-param name="nodes" select="key('classes', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="globalname" mode="annotation">
+ <!-- Determine the (possibly qualified) global name we are looking for -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'data-member'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+ <xsl:with-param name="nodes" select="key('globals', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="methodname" mode="annotation">
+ <!-- Determine the (possibly qualified) method name we are looking for -->
+    <xsl:variable name="fullname">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Strip off any call -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="contains($fullname, '(')">
+          <xsl:value-of select="substring-before($fullname, '(')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$fullname"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'method'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+ <xsl:with-param name="nodes" select="key('methods', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="functionname" mode="annotation">
+    <!-- Determine the (possibly qualified) function name we are
+         looking for -->
+    <xsl:variable name="fullname">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Strip off any call -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="contains($fullname, '(')">
+          <xsl:value-of select="substring-before($fullname, '(')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$fullname"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'function'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+      <xsl:with-param name="nodes"
+        select="key('functions', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="enumname" mode="annotation">
+    <!-- Determine the (possibly qualified) enum name we are
+         looking for -->
+    <xsl:variable name="fullname">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Strip off any call -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="contains($fullname, '(')">
+          <xsl:value-of select="substring-before($fullname, '(')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$fullname"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'enum'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+      <xsl:with-param name="nodes"
+        select="key('enums', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="libraryname" mode="annotation">
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="text()"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="node" select="key('libraries', $name)"/>
+
+    <xsl:choose>
+      <xsl:when test="count($node)=0">
+        <xsl:message>
+          <xsl:text>warning: Cannot find library '</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>'</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$name"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="library.link">
+          <xsl:with-param name="node" select="$node"/>
+          <xsl:with-param name="name" select="text()"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="conceptname" mode="annotation">
+    <xsl:param name="name" select="text()"/>
+
+    <xsl:call-template name="concept.link">
+      <xsl:with-param name="name" select="$name"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="macroname" mode="annotation">
+    <xsl:param name="name">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:param>
+
+    <xsl:variable name="node" select="key('macros', $name)"/>
+    <xsl:choose>
+      <xsl:when test="count($node) = 0">
+        <xsl:message>
+          <xsl:text>warning: cannot find macro `</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>'</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$name"/>
+      </xsl:when>
+
+      <xsl:when test="count($node) = 1">
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="$node"/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="string(.)"/>
+        </xsl:call-template>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>error: macro `</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>' is multiply defined.</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$node"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="headername" mode="annotation">
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="node" select="key('headers', $name)"/>
+    <xsl:choose>
+      <xsl:when test="count($node) = 0">
+        <xsl:message>
+          <xsl:text>warning: cannot find header `</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>'</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$name"/>
+      </xsl:when>
+
+      <xsl:when test="count($node) = 1">
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="$node"/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="string(.)"/>
+        </xsl:call-template>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>error: header `</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>' is multiply defined.</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$node"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="annotation">
+    <xsl:param name="highlight" select="false()"/>
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="."/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="code" mode="annotation">
+    <computeroutput>
+      <xsl:apply-templates mode="annotation"/>
+    </computeroutput>
+  </xsl:template>
+
+  <xsl:template match="bold" mode="annotation">
+    <emphasis role="bold">
+      <xsl:apply-templates mode="annotation"/>
+    </emphasis>
+  </xsl:template>
+
+  <xsl:template match="description" mode="annotation">
+    <xsl:apply-templates mode="annotation"/>
+  </xsl:template>
+
+  <xsl:template match="comment()" mode="annotation">
+    <xsl:copy/>
+  </xsl:template>
+
+  <xsl:template match="node()" mode="annotation">
+    <xsl:param name="highlight" select="false()"/>
+
+    <xsl:element name="{name(.)}">
+      <xsl:for-each select="./@*">
+        <xsl:attribute name="{name(.)}">
+          <xsl:value-of select="."/>
+        </xsl:attribute>
+      </xsl:for-each>
+      <xsl:apply-templates select="./*|./text()" mode="annotation">
+        <xsl:with-param name="highlight" select="$highlight"/>
+      </xsl:apply-templates>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- The "purpose" mode strips simpara/para elements so that we can
+       place the resulting text into a comment in the synopsis. -->
+  <xsl:template match="para|simpara" mode="purpose">
+    <xsl:apply-templates mode="annotation"/>
+  </xsl:template>
+
+  <xsl:template match="*" mode="purpose">
+    <xsl:apply-templates select="." mode="annotation"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="purpose">
+    <xsl:apply-templates select="." mode="annotation"/>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/callout.xsl      Mon Feb  8 23:37:27 2010
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2007 Joel de Guzman <djowel -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/callout.xsl"/>
+<xsl:import href="relative-href.xsl"/>
+
+<xsl:template name="callout-bug">
+  <xsl:param name="conum" select='1'/>
+
+  <xsl:choose>
+    <xsl:when test="$callout.graphics != 0
+                    and $conum &lt;= $callout.graphics.number.limit">
+
+      <xsl:variable name="relative_callout_graphics_path">
+        <xsl:call-template name="href.target.relative">
+          <xsl:with-param name="target" select="$callout.graphics.path"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+ <img src="{$relative_callout_graphics_path}{$conum}{$callout.graphics.extension}"
+           alt="{$conum}" border="0"/>
+    </xsl:when>
+
+    <xsl:when test="$callout.unicode != 0
+                    and $conum &lt;= $callout.unicode.number.limit">
+      <xsl:choose>
+        <xsl:when test="$callout.unicode.start.character = 10102">
+          <xsl:choose>
+            <xsl:when test="$conum = 1">&#10102;</xsl:when>
+            <xsl:when test="$conum = 2">&#10103;</xsl:when>
+            <xsl:when test="$conum = 3">&#10104;</xsl:when>
+            <xsl:when test="$conum = 4">&#10105;</xsl:when>
+            <xsl:when test="$conum = 5">&#10106;</xsl:when>
+            <xsl:when test="$conum = 6">&#10107;</xsl:when>
+            <xsl:when test="$conum = 7">&#10108;</xsl:when>
+            <xsl:when test="$conum = 8">&#10109;</xsl:when>
+            <xsl:when test="$conum = 9">&#10110;</xsl:when>
+            <xsl:when test="$conum = 10">&#10111;</xsl:when>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+ <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
+            <xsl:text>when $callout.unicode.start.character is </xsl:text>
+            <xsl:value-of select="$callout.unicode.start.character"/>
+          </xsl:message>
+          <xsl:text>(</xsl:text>
+          <xsl:value-of select="$conum"/>
+          <xsl:text>)</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>(</xsl:text>
+      <xsl:value-of select="$conum"/>
+      <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/caramel/LICENSE  Mon Feb  8 23:37:27 2010
@@ -0,0 +1,58 @@
+Software License, Version 1.0
+
+Copyright 2002-2003, Trustees of Indiana University.
+Copyright 2000-2001, University of Notre Dame.
+All rights reserved.
+
+Indiana University has the exclusive rights to license this product under the
+following license.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * All redistributions of source code must retain the above copyright notice, + the list of authors in the original source code, this list of conditions
+    and the disclaimer listed in this license;
+
+  * All redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the disclaimer listed in this license + in the documentation and/or other materials provided with the distribution;
+
+  * Any documentation included with all redistributions must include the
+    following acknowledgement:
+
+ "This product includes software developed at the University of Notre Dame + and the Pervasive Technology Labs at Indiana University. For technical + information contact Andrew Lumsdaine at the Pervasive Technology Labs at + Indiana University. For administrative and license questions contact the
+      Advanced Research and Technology Institute at 351 West 10th Street.
+      Indianapolis, Indiana 46202, phone 317-278-4100, fax 317-274-5902."
+
+ Alternatively, this acknowledgement may appear in the software itself, and
+    wherever such third-party acknowledgments normally appear.
+
+  * The name Indiana University, the University of Notre Dame or "Caramel"
+ shall not be used to endorse or promote products derived from this software
+    without prior written permission from Indiana University.  For written
+    permission, please contact Indiana University Advanced Research &
+    Technology Institute.
+
+ * Products derived from this software may not be called "Caramel", nor may
+    Indiana University, the University of Notre Dame or "Caramel" appear in
+ their name, without prior written permission of Indiana University Advanced
+    Research & Technology Institute.
+
+Indiana University provides no reassurances that the source code provided does +not infringe the patent or any other intellectual property rights of any other +entity. Indiana University disclaims any liability to any recipient for claims
+brought by any other entity based on infringement of intellectual property
+rights or otherwise.
+
+LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH NO WARRANTIES +AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA UNIVERSITY GIVES NO WARRANTIES
+AND MAKES NO REPRESENTATION THAT SOFTWARE IS FREE OF INFRINGEMENT OF THIRD
+PARTY PATENT, COPYRIGHT, OR OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES +NO WARRANTIES THAT SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", +"TRAP DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE RISK
+AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS, AND TO THE
+PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING SOFTWARE.
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/caramel/concept2docbook.xsl Mon Feb 8 23:37:27 2010
@@ -0,0 +1,812 @@
+<?xml version="1.0" ?>
+
+<!--
+Copyright (c) 2002-2003 The Trustees of Indiana University.
+                        All rights reserved.
+Copyright (c) 2000-2001 University of Notre Dame. All rights reserved.
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
+  <xsl:strip-space elements="* xsl:*"/>
+
+  <xsl:include href="unparser.xsl"/>
+
+  <xsl:key name="concepts" match="concept" use="@name"/>
+
+  <!-- The layout type to use for concept descriptions. Can be one of:
+       sgi: simulate the SGI STL documentation
+ austern: simulate the documentation in Generic Programming and the STL,
+         by Matthew H. Austern
+       caramel: simulate the formatting from Caramel
+       -->
+  <xsl:param name="boost.concept.layout" select="'austern'"/>
+
+  <xsl:template match="concept">
+    <refentry>
+      <xsl:attribute name="id">
+        <xsl:call-template name="generate.id"/>
+      </xsl:attribute>
+
+      <refmeta>
+ <refentrytitle>Concept <xsl:value-of select="@name"/></refentrytitle>
+        <manvolnum>7</manvolnum>
+      </refmeta>
+
+      <refnamediv>
+        <refname><xsl:value-of select="@name"/></refname>
+        <xsl:if test="purpose">
+          <refpurpose>
+            <xsl:apply-templates select="purpose/*|purpose/text()"/>
+          </refpurpose>
+        </xsl:if>
+      </refnamediv>
+
+      <!--
+      <refentryinfo>
+        <xsl:for-each select="copyright | copyright-include | legalnotice">
+          <xsl:choose>
+            <xsl:when test="name(.)='copyright'">
+              <copyright><xsl:copy-of select="./node()"/></copyright>
+            </xsl:when>
+            <xsl:when test="name(.)='legalnotice'">
+              <legalnotice><xsl:copy-of select="./node()"/></legalnotice>
+            </xsl:when>
+            <xsl:when test="name(.)='copyright-include'">
+ <copyright><xsl:copy-of select="document(concat('../concepts/', @file))/copyright/node()"/></copyright>
+            </xsl:when>
+          </xsl:choose>
+        </xsl:for-each>
+      </refentryinfo>
+-->
+
+    <xsl:if test="description">
+      <xsl:if test="description">
+        <refsect1>
+          <title>Description</title>
+          <xsl:for-each select="description">
+            <xsl:apply-templates/>
+          </xsl:for-each>
+        </refsect1>
+      </xsl:if>
+    </xsl:if>
+
+    <xsl:if test="refines | refines-when-mutable">
+      <refsect1>
+        <title>Refinement of</title>
+        <itemizedlist>
+          <xsl:if test="refines">
+            <xsl:for-each select="refines">
+              <listitem>
+                <para>
+                  <xsl:call-template name="concept.link">
+                    <xsl:with-param name="name" select="@concept"/>
+                  </xsl:call-template>
+                </para>
+              </listitem>
+            </xsl:for-each>
+          </xsl:if>
+          <xsl:if test="refines-when-mutable">
+            <xsl:for-each select="refines-when-mutable">
+              <listitem>
+                <para>
+                  <xsl:text>When mutable: </xsl:text>
+                  <xsl:call-template name="concept.link">
+                    <xsl:with-param name="name" select="@concept"/>
+                  </xsl:call-template>
+                </para>
+              </listitem>
+            </xsl:for-each>
+          </xsl:if>
+        </itemizedlist>
+      </refsect1>
+    </xsl:if>
+
+ <!-- This part must be run even if there are no associated types to print out, so the hidden type definitions can be found -->
+    <xsl:variable name="definition_list">
+      <xsl:call-template name="make-definition-list">
+ <xsl:with-param name="typedefs" select="define-type | associated-type"/>
+        <xsl:with-param name="definition_list">
+          <xsl:for-each select="param/@name">
+            @(@<xsl:value-of select="."/>=<xsl:value-of select="."/>@)@
+          </xsl:for-each>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:variable>
+
+ <!-- <xsl:message>Definition list: <xsl:value-of select="$definition_list"/></xsl:message> -->
+
+    <xsl:call-template name="print-associated-types">
+      <xsl:with-param name="typedefs" select="associated-type"/>
+      <xsl:with-param name="definition_list" select="$definition_list"/>
+    </xsl:call-template>
+
+    <xsl:call-template name="concept.notation">
+      <xsl:with-param name="definition_list" select="$definition_list"/>
+    </xsl:call-template>
+
+    <xsl:variable name="notations">
+      <xsl:for-each select="notation">
+        @@(@@<xsl:call-template name="unparse-cpp">
+          <xsl:with-param name="typeref" select="*[1]"/>
+ <xsl:with-param name="definition_list" select="$definition_list"/>
+          <xsl:with-param name="ignore-cv" select="true()"/>
+          <xsl:with-param name="ignore-references" select="true()"/>
+ </xsl:call-template>@@=@@<xsl:value-of select="normalize-space(@variables)"/>@@)@@
+      </xsl:for-each>
+    </xsl:variable>
+
+ <!-- <xsl:message>Notations: <xsl:value-of select="normalize-space($notations)"/> End notations</xsl:message> -->
+
+    <xsl:if test="definition">
+      <refsect1>
+      <title>Definitions</title>
+        <xsl:for-each select="definition">
+          <p><xsl:apply-templates/></p>
+        </xsl:for-each>
+      </refsect1>
+    </xsl:if>
+
+    <xsl:if test="valid-type-expression | models | models-when-mutable">
+      <refsect1>
+        <title>Type expressions</title>
+        <variablelist>
+          <xsl:for-each select="models">
+            <varlistentry>
+              <term/>
+              <listitem>
+                <para>
+                  <xsl:call-template name="unparse-operator-definition">
+                    <xsl:with-param name="typeref" select="."/>
+ <xsl:with-param name="operator_nodeset" select="key('concepts', @concept)/models-sentence/node()"/> + <xsl:with-param name="definition_list" select="$definition_list"/>
+                    <xsl:with-param name="notations" select="$notations"/>
+                    <xsl:with-param name="ignore-cv" select="false()"/>
+                    <xsl:with-param name="self" select="@concept"/>
+                    <xsl:with-param name="use-code-block" select="true()"/>
+                  </xsl:call-template>
+                </para>
+              </listitem>
+            </varlistentry>
+          </xsl:for-each>
+          <xsl:for-each select="models-when-mutable">
+            <varlistentry>
+              <term>Only when mutable</term>
+              <listitem>
+                <para>
+                  <xsl:call-template name="unparse-operator-definition">
+                    <xsl:with-param name="typeref" select="."/>
+ <xsl:with-param name="operator_nodeset" select="key('concepts', @concept)/models-sentence/node()"/> + <xsl:with-param name="definition_list" select="$definition_list"/>
+                    <xsl:with-param name="notations" select="$notations"/>
+                    <xsl:with-param name="ignore-cv" select="false()"/>
+                    <xsl:with-param name="self" select="@concept"/>
+                    <xsl:with-param name="use-code-block" select="true()"/>
+                  </xsl:call-template>
+                </para>
+              </listitem>
+            </varlistentry>
+          </xsl:for-each>
+          <xsl:for-each select="valid-type-expression">
+            <varlistentry>
+              <term><xsl:value-of select="@name"/></term>
+              <listitem>
+                <para>
+                  <type>
+                    <xsl:call-template name="unparse-cpp">
+                      <xsl:with-param name="typeref" select="*[2]"/>
+ <xsl:with-param name="definition_list" select="$definition_list"/> + <xsl:with-param name="notations" select="normalize-space($notations)"/>
+                    </xsl:call-template>
+                  </type>
+
+                  <xsl:comment/> must be
+                  <xsl:for-each select="return-type/*">
+                    <xsl:if test="position()!=1 and last()!=2">, </xsl:if>
+ <xsl:if test="position()=last() and last()!=1"> and </xsl:if>
+                    <xsl:call-template name="unparse-constraint">
+                      <xsl:with-param name="constraint" select="."/>
+ <xsl:with-param name="definition_list" select="$definition_list"/> + <xsl:with-param name="type-expr-mode" select="true()"/>
+                    </xsl:call-template>
+                  </xsl:for-each><xsl:comment/>.
+                </para>
+
+                <xsl:if test="description">
+                  <xsl:for-each select="description">
+                    <xsl:apply-templates/>
+                  </xsl:for-each>
+                </xsl:if>
+              </listitem>
+            </varlistentry>
+          </xsl:for-each>
+        </variablelist>
+      </refsect1>
+    </xsl:if>
+
+    <xsl:if test="valid-expression">
+      <refsect1>
+      <title>Valid expressions</title>
+
+      <xsl:variable name="columns">
+        <xsl:if test="valid-expression/return-type">
+          <xsl:text>T</xsl:text>
+        </xsl:if>
+        <xsl:if test="valid-expression/precondition">
+          <xsl:text>P</xsl:text>
+        </xsl:if>
+        <xsl:if test="valid-expression/semantics">
+          <xsl:text>S</xsl:text>
+        </xsl:if>
+        <xsl:if test="valid-expression/postcondition">
+          <xsl:text>O</xsl:text>
+        </xsl:if>
+      </xsl:variable>
+
+      <informaltable>
+        <tgroup>
+          <xsl:attribute name="cols">
+            <xsl:value-of select="string-length($columns) + 2"/>
+          </xsl:attribute>
+          <thead>
+            <row>
+              <entry>Name</entry>
+              <entry>Expression</entry>
+              <xsl:if test="contains($columns, 'T')">
+                <entry>Type</entry>
+              </xsl:if>
+              <xsl:if test="contains($columns, 'P')">
+                <entry>Precondition</entry>
+              </xsl:if>
+              <xsl:if test="contains($columns, 'S')">
+                <entry>Semantics</entry>
+              </xsl:if>
+              <xsl:if test="contains($columns, 'O')">
+                <entry>Postcondition</entry>
+              </xsl:if>
+            </row>
+          </thead>
+          <tbody>
+            <xsl:apply-templates select="valid-expression">
+              <xsl:with-param name="definition_list"
+                select="$definition_list"/>
+              <xsl:with-param name="notations"
+                select="normalize-space($notations)"/>
+              <xsl:with-param name="columns" select="$columns"/>
+            </xsl:apply-templates>
+          </tbody>
+        </tgroup>
+      </informaltable>
+      <!-- Doug prefers the table
+      <variablelist>
+        <xsl:for-each select="valid-expression">
+          <xsl:variable name="as-cxx-value">
+            <xsl:call-template name="unparse-cpp">
+              <xsl:with-param name="typeref" select="*[1]"/>
+ <xsl:with-param name="definition_list" select="$definition_list"/> + <xsl:with-param name="notations" select="normalize-space($notations)"/>
+            </xsl:call-template>
+          </xsl:variable>
+          <varlistentry>
+ <term><xsl:value-of select="@name"/>: <literal><xsl:value-of select="$as-cxx-value"/></literal></term>
+            <listitem><variablelist>
+              <xsl:if test="return-type/*">
+                <varlistentry><term>Return value</term><listitem><para>
+                  <xsl:for-each select="return-type/*">
+                    <xsl:if test="position()!=1 and last()!=2">, </xsl:if>
+ <xsl:if test="position()=last() and last()!=1"> and </xsl:if>
+                    <xsl:call-template name="unparse-constraint">
+                      <xsl:with-param name="constraint" select="."/>
+ <xsl:with-param name="definition_list" select="$definition_list"/> + <xsl:with-param name="capitalize" select="position()=1"/>
+                    </xsl:call-template>
+                  </xsl:for-each>
+                </para></listitem></varlistentry>
+              </xsl:if>
+
+              <xsl:for-each select="precondition">
+                <varlistentry><term>Precondition</term><listitem><para>
+                  <xsl:apply-templates/>
+                </para></listitem></varlistentry>
+              </xsl:for-each>
+
+              <xsl:for-each select="semantics">
+                <varlistentry><term>Semantics</term><listitem><para>
+                  <xsl:apply-templates/>
+                </para></listitem></varlistentry>
+              </xsl:for-each>
+
+              <xsl:for-each select="postcondition">
+                <varlistentry><term>Postcondition</term><listitem><para>
+                  <xsl:apply-templates/>
+                </para></listitem></varlistentry>
+              </xsl:for-each>
+
+            </variablelist></listitem>
+          </varlistentry>
+
+        </xsl:for-each>
+      </variablelist>
+-->
+      </refsect1>
+    </xsl:if>
+
+    <xsl:if test="complexity">
+      <refsect1>
+      <title>Complexity</title>
+        <xsl:for-each select="complexity">
+          <para><xsl:apply-templates/></para>
+        </xsl:for-each>
+      </refsect1>
+    </xsl:if>
+
+    <xsl:if test="invariant">
+      <refsect1>
+      <title>Invariants</title>
+      <variablelist>
+        <xsl:for-each select="invariant">
+          <varlistentry>
+            <term><xsl:value-of select="@name"/></term>
+            <listitem>
+              <para><xsl:apply-templates/></para>
+            </listitem>
+          </varlistentry>
+        </xsl:for-each>
+      </variablelist>
+      </refsect1>
+    </xsl:if>
+
+    <xsl:if test="example-model">
+      <refsect1>
+      <title>Models</title>
+        <itemizedlist>
+        <xsl:for-each select="example-model">
+          <listitem>
+            <simplelist type="inline">
+            <xsl:for-each select="*">
+              <xsl:variable name="example-value">
+                <xsl:call-template name="unparse-cpp">
+                  <xsl:with-param name="typeref" select="."/>
+ <xsl:with-param name="definition_list" select="$definition_list"/>
+                </xsl:call-template>
+              </xsl:variable>
+ <member><type><xsl:value-of select="$example-value"/></type></member>
+            </xsl:for-each>
+            </simplelist>
+          </listitem>
+        </xsl:for-each>
+        </itemizedlist>
+      </refsect1>
+    </xsl:if>
+
+ <xsl:variable name="see-also-list-0" select="concept-ref | see-also | refines | refines-when-mutable | models-as-first-arg | models | models-when-mutable"/> + <xsl:variable name="see-also-list-1" select="$see-also-list-0[string(@name | @concept) != string(../@name)]"/> + <xsl:variable name="see-also-list" select="$see-also-list-1[not(string(@name|@concept) = (preceding::*/@name | preceding::*/@concept | ancestor::*/@name | ancestor::*/@concept))]"/>
+    <xsl:if test="$see-also-list">
+      <refsect1>
+        <title>See also</title>
+        <itemizedlist>
+          <xsl:for-each select="$see-also-list">
+            <xsl:sort select="string(@name|@concept)" data-type="text"/>
+            <listitem>
+              <para>
+                <xsl:call-template name="concept.link">
+                  <xsl:with-param name="name" select="@name|@concept"/>
+                </xsl:call-template>
+              </para>
+            </listitem>
+          </xsl:for-each>
+        </itemizedlist>
+      </refsect1>
+    </xsl:if>
+
+  </refentry>
+  </xsl:template>
+
+  <xsl:template name="unparse-constraint">
+    <xsl:param name="constraint"/>
+    <xsl:param name="definition_list"/>
+    <xsl:param name="type-expr-mode" select="false()"/>
+    <xsl:param name="capitalize" select="true()"/>
+
+    <xsl:choose>
+
+      <xsl:when test="name($constraint)='require-same-type'">
+        <xsl:if test="$type-expr-mode">identical to </xsl:if>
+        <type>
+          <xsl:call-template name="unparse-cpp">
+            <xsl:with-param name="typeref" select="$constraint/*[1]"/>
+ <xsl:with-param name="definition_list" select="definition_list"/>
+          </xsl:call-template>
+        </type>
+      </xsl:when>
+
+      <xsl:when test="name($constraint)='convertible-to'">
+        <xsl:choose>
+          <xsl:when test="$type-expr-mode">convertible to </xsl:when>
+ <xsl:when test="not($type-expr-mode) and $capitalize">Convertible to </xsl:when> + <xsl:when test="not($type-expr-mode) and not($capitalize)">convertible to </xsl:when>
+        </xsl:choose>
+        <type>
+          <xsl:call-template name="unparse-cpp">
+            <xsl:with-param name="typeref" select="$constraint/*[1]"/>
+ <xsl:with-param name="definition_list" select="definition_list"/>
+          </xsl:call-template>
+        </type>
+      </xsl:when>
+
+      <xsl:when test="name($constraint)='derived-from'">
+        <xsl:choose>
+          <xsl:when test="$type-expr-mode">derived from </xsl:when>
+ <xsl:when test="not($type-expr-mode) and $capitalize">Derived from </xsl:when> + <xsl:when test="not($type-expr-mode) and not($capitalize)">derived from </xsl:when>
+        </xsl:choose>
+        <type>
+          <xsl:call-template name="unparse-cpp">
+            <xsl:with-param name="typeref" select="$constraint/*[1]"/>
+ <xsl:with-param name="definition_list" select="definition_list"/>
+          </xsl:call-template>
+        </type>
+      </xsl:when>
+
+      <xsl:when test="name($constraint)='assignable-to'">
+        <xsl:choose>
+          <xsl:when test="$type-expr-mode">assignable to </xsl:when>
+ <xsl:when test="not($type-expr-mode) and $capitalize">Assignable to </xsl:when> + <xsl:when test="not($type-expr-mode) and not($capitalize)">assignable to </xsl:when>
+        </xsl:choose>
+        <type>
+          <xsl:call-template name="unparse-cpp">
+            <xsl:with-param name="typeref" select="$constraint/*[1]"/>
+ <xsl:with-param name="definition_list" select="definition_list"/>
+          </xsl:call-template>
+        </type>
+      </xsl:when>
+
+      <xsl:when test="name($constraint)='models-as-first-arg'">
+        <xsl:choose>
+          <xsl:when test="$type-expr-mode"> a model </xsl:when>
+ <xsl:when test="not($type-expr-mode) and $capitalize"> Models </xsl:when> + <xsl:when test="not($type-expr-mode) and not($capitalize)"> models </xsl:when>
+        </xsl:choose>
+        <xsl:if test="$constraint/*"><xsl:comment/>
+          (along with <xsl:for-each select="$constraint/*"><type>
+              <xsl:call-template name="unparse-cpp">
+                <xsl:with-param name="typeref" select="."/>
+ <xsl:with-param name="definition_list" select="definition_list"/>
+              </xsl:call-template>
+            </type>
+            <xsl:choose>
+              <xsl:when test="position()=last()"/>
+ <xsl:when test="position()=last()-1 and last()=2"> and </xsl:when> + <xsl:when test="position()=last()-1 and last()!=2">, and </xsl:when>
+              <xsl:otherwise>, </xsl:otherwise>
+            </xsl:choose><xsl:comment/>
+          </xsl:for-each><xsl:comment/>) <xsl:comment/>
+        </xsl:if><xsl:comment/>
+        <xsl:if test="$type-expr-mode"> of </xsl:if>
+        <xsl:call-template name="concept.link">
+          <xsl:with-param name="name" select="$constraint/@concept"/>
+        </xsl:call-template>
+      </xsl:when>
+
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="make-definition-list">
+    <xsl:param name="typedefs"/>
+    <xsl:param name="definition_list"/>
+
+    <xsl:choose>
+      <xsl:when test="$typedefs">
+        <xsl:variable name="type_definition">
+          <xsl:if test="name($typedefs[1]/*[1])!='description'">
+            <xsl:call-template name="unparse-cpp">
+              <xsl:with-param name="typeref" select="$typedefs[1]/*[1]"/>
+ <xsl:with-param name="definition_list" select="$definition_list"/>
+            </xsl:call-template>
+          </xsl:if>
+        </xsl:variable>
+
+        <xsl:variable name="new_type_definition">
+          <xsl:choose>
+            <xsl:when test="name($typedefs[1])='associated-type'">
+              <xsl:value-of select="$typedefs[1]/@name"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$type_definition"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <xsl:call-template name="make-definition-list">
+ <xsl:with-param name="typedefs" select="$typedefs[position()!=1]"/> + <xsl:with-param name="definition_list" select="concat($definition_list, ' @(@', $typedefs[1]/@name, '=', $new_type_definition, '@)@')"/>
+        </xsl:call-template>
+
+      </xsl:when>
+
+ <xsl:otherwise> <!-- End of expression list, emit the results that have accumulated -->
+        <xsl:value-of select="$definition_list"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="print-associated-types">
+    <xsl:param name="typedefs"/>
+    <xsl:param name="definition_list"/>
+
+    <xsl:if test="$typedefs">
+      <refsect1>
+        <title>Associated types</title>
+
+        <xsl:choose>
+          <xsl:when test="$boost.concept.layout='sgi'">
+            <informaltable>
+              <tgroup cols="2">
+                <tbody>
+                  <xsl:apply-templates select="associated-type" mode="sgi">
+                    <xsl:with-param name="definition_list"
+                      select="$definition_list"/>
+                  </xsl:apply-templates>
+                </tbody>
+              </tgroup>
+            </informaltable>
+          </xsl:when>
+          <xsl:when test="$boost.concept.layout='austern'">
+            <itemizedlist>
+              <xsl:apply-templates select="associated-type" mode="austern">
+                <xsl:with-param name="definition_list"
+                  select="$definition_list"/>
+              </xsl:apply-templates>
+            </itemizedlist>
+          </xsl:when>
+          <xsl:when test="$boost.concept.layout='caramel'">
+            <segmentedlist>
+              <segtitle>Name</segtitle>
+              <segtitle>Code</segtitle>
+              <segtitle>Description</segtitle>
+              <xsl:for-each select="$typedefs">
+                <xsl:variable name="type_definition">
+                  <xsl:call-template name="unparse-cpp">
+                    <xsl:with-param name="typeref" select="*[1]"/>
+ <xsl:with-param name="definition_list" select="$definition_list"/>
+                  </xsl:call-template>
+                </xsl:variable>
+                <seglistitem>
+                  <seg><xsl:value-of select="@name"/></seg>
+                  <seg><xsl:value-of select="$type_definition"/></seg>
+                  <seg>
+                    <xsl:for-each select="description">
+                      <xsl:call-template name="description"/>
+                    </xsl:for-each>
+                  </seg>
+                </seglistitem>
+              </xsl:for-each>
+            </segmentedlist>
+          </xsl:when>
+        </xsl:choose>
+      </refsect1>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="comma-list">
+    <xsl:param name="list"/>
+
+    <xsl:if test="$list!=''">
+      <term><varname>
+ <xsl:if test="substring-before($list,' ')=''"><xsl:value-of select="$list"/></xsl:if>
+        <xsl:value-of select="substring-before($list,' ')"/>
+      </varname></term>
+      <xsl:call-template name="comma-list">
+  <xsl:with-param name="list" select="substring-after($list,' ')"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="associated-type" mode="sgi">
+    <row>
+      <entry><simpara><xsl:value-of select="@name"/></simpara></entry>
+
+      <entry>
+        <para>
+          <xsl:for-each select="description">
+            <xsl:apply-templates/>
+          </xsl:for-each>
+        </para>
+      </entry>
+    </row>
+  </xsl:template>
+
+  <xsl:template match="associated-type" mode="austern">
+    <xsl:param name="definition_list" select="''"/>
+
+    <listitem>
+      <para>
+        <emphasis role="bold"><xsl:value-of select="@name"/></emphasis>
+
+        <xsl:call-template name="preformatted">
+          <xsl:with-param name="text">
+            <xsl:call-template name="unparse-cpp">
+              <xsl:with-param name="typeref" select="*[1]"/>
+ <xsl:with-param name="definition_list" select="$definition_list"/>
+            </xsl:call-template>
+          </xsl:with-param>
+        </xsl:call-template>
+
+        <xsl:for-each select="description">
+          <xsl:apply-templates/>
+        </xsl:for-each>
+      </para>
+    </listitem>
+  </xsl:template>
+
+  <xsl:template match="valid-expression">
+    <xsl:param name="definition_list"/>
+    <xsl:param name="notations"/>
+    <xsl:param name="columns"/>
+
+    <row>
+      <entry><simpara><xsl:value-of select="@name"/></simpara></entry>
+
+      <entry>
+        <simpara>
+          <xsl:call-template name="unparse-cpp">
+            <xsl:with-param name="typeref" select="*[1]"/>
+ <xsl:with-param name="definition_list" select="$definition_list"/>
+            <xsl:with-param name="notations" select="$notations"/>
+          </xsl:call-template>
+        </simpara>
+      </entry>
+
+      <xsl:if test="contains($columns, 'T')">
+        <entry>
+          <simpara>
+            <xsl:for-each select="return-type/*">
+              <xsl:if test="position()!=1 and last()!=2">, </xsl:if>
+              <xsl:if test="position()=last() and last()!=1"> and </xsl:if>
+              <xsl:call-template name="unparse-constraint">
+                <xsl:with-param name="constraint" select="."/>
+                <xsl:with-param name="definition_list"
+                  select="$definition_list"/>
+                <xsl:with-param name="capitalize" select="position()=1"/>
+              </xsl:call-template>
+            </xsl:for-each>
+          </simpara>
+        </entry>
+      </xsl:if>
+
+      <xsl:if test="contains($columns, 'P')">
+        <entry>
+          <xsl:for-each select="precondition">
+            <simpara><xsl:apply-templates/></simpara>
+          </xsl:for-each>
+        </entry>
+      </xsl:if>
+
+      <xsl:if test="contains($columns, 'S')">
+        <entry>
+          <xsl:for-each select="semantics">
+            <simpara><xsl:apply-templates/></simpara>
+          </xsl:for-each>
+        </entry>
+      </xsl:if>
+
+      <xsl:if test="contains($columns, 'O')">
+        <entry>
+          <xsl:for-each select="postcondition">
+            <simpara><xsl:apply-templates/></simpara>
+          </xsl:for-each>
+        </entry>
+      </xsl:if>
+    </row>
+  </xsl:template>
+
+  <xsl:template name="concept.notation">
+    <xsl:param name="definition_list"/>
+
+    <refsect1>
+      <title>Notation</title>
+      <variablelist>
+        <xsl:for-each select="param">
+          <varlistentry>
+            <term><xsl:value-of select="@name"/></term>
+            <listitem>
+              <simpara>
+                <xsl:text>A type playing the role of </xsl:text>
+                <xsl:value-of select="@role"/>
+                <xsl:text> in the </xsl:text>
+                <xsl:call-template name="concept.link">
+                  <xsl:with-param name="name" select="../@name"/>
+                </xsl:call-template>
+                <xsl:text> concept.</xsl:text>
+              </simpara>
+            </listitem>
+          </varlistentry>
+        </xsl:for-each>
+        <xsl:for-each select="notation">
+          <xsl:variable name="notation_name">
+            <xsl:call-template name="comma-list">
+              <xsl:with-param name="list"
+                select="normalize-space(@variables)"/>
+            </xsl:call-template>
+          </xsl:variable>
+
+          <varlistentry>
+            <xsl:copy-of select="$notation_name"/>
+            <listitem>
+              <simpara>
+ <xsl:variable name="output-plural" select="substring-before(normalize-space(@variables),' ')!=''"/> + <xsl:if test="name(*[1])='sample-value'">Object<xsl:if test="$output-plural">s</xsl:if> of type </xsl:if> + <xsl:variable name="typeref-to-print" select="*[name()!='sample-value'] | sample-value/*[name()!='sample-value']"/>
+                <xsl:call-template name="unparse-cpp">
+ <xsl:with-param name="typeref" select="$typeref-to-print"/> + <xsl:with-param name="definition_list" select="$definition_list"/>
+                  <xsl:with-param name="ignore-cv" select="true()"/>
+ <xsl:with-param name="ignore-references" select="true()"/>
+                </xsl:call-template>
+              </simpara>
+            </listitem>
+          </varlistentry>
+        </xsl:for-each>
+      </variablelist>
+    </refsect1>
+  </xsl:template>
+
+  <xsl:template name="concept.link">
+    <xsl:param name="name" select="text()"/>
+    <xsl:param name="warn" select="true()"/>
+    <xsl:param name="text" select="$name"/>
+    <xsl:variable name="node" select="key('concepts', $name)"/>
+
+    <xsl:choose>
+      <xsl:when test="count($node)=0">
+        <xsl:if test="$warn">
+          <xsl:message>
+            <xsl:text>warning: cannot find concept '</xsl:text>
+            <xsl:value-of select="$name"/>
+            <xsl:text>'</xsl:text>
+          </xsl:message>
+        </xsl:if>
+        <xsl:value-of select="$text"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="$node"/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="$text"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="remove-whitespace">
+    <xsl:param name="text" select="text()"/>
+
+    <xsl:variable name="normalized" select="normalize-space($text)"/>
+    <xsl:choose>
+      <xsl:when test="contains($normalized, ' ')">
+        <xsl:value-of select="substring-before($normalized, ' ')"/>
+        <xsl:call-template name="remove-whitespace">
+          <xsl:with-param name="text"
+            select="substring-after($normalized, ' ')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$normalized"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="concept" mode="generate.id">
+    <xsl:call-template name="remove-whitespace">
+      <xsl:with-param name="text" select="@name"/>
+    </xsl:call-template>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/caramel/cpp-operators.xml Mon Feb 8 23:37:27 2010
@@ -0,0 +1,288 @@
+<?xml version="1.0" ?>
+
+<!--
+Copyright (c) 2002-2003 The Trustees of Indiana University.
+                        All rights reserved.
+Copyright (c) 2000-2001 University of Notre Dame. All rights reserved.
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt) -->
+
+<operator-list>
+ <!-- This list is from Pohl's book, and needs to be checked for accuracy -->
+
+  <op name="postincrement">
+ <apply priority="100"><arg num="1"/>++</apply> <!-- No assoc - always use parentheses -->
+    <impl position="method">operator++(int)</impl>
+  </op>
+
+  <op name="postdecrement">
+    <apply priority="100"><arg num="1"/>--</apply>
+    <impl position="method">operator--(int)</impl>
+  </op>
+
+  <op name="apply-function">
+ <apply priority="100"><name/>(<arg-list start="1" priority="30"/>)</apply>
+    <impl position="freestanding"><name/>(<arg-list/>)</impl>
+  </op>
+
+  <op name="apply-method">
+ <apply priority="100" assoc="1"><arg num="1"/>.<name/>(<arg-list start="2" priority="30"/>)</apply>
+    <impl position="method"><name/>(<arg-list/>)</impl>
+  </op>
+
+  <op name="pointer-apply-method">
+ <apply priority="100" assoc="1"><arg num="1"/>-&gt;<name/>(<arg-list start="2" priority="30"/>)</apply>
+    <impl>Error</impl>
+  </op>
+
+  <op name="apply-funcobj">
+ <apply priority="100" assoc="1"><arg num="1"/>(<arg-list start="2" priority="30"/>)</apply>
+    <impl position="method">operator()(<arg-list/>)</impl>
+  </op>
+
+  <op name="construct">
+ <apply priority="100"><arg num="1"/>(<arg-list start="2" priority="30"/>)</apply>
+    <impl position="method"><self/>(<arg-list/>)</impl>
+  </op>
+
+  <op name="subscript">
+ <apply priority="100" assoc="1"><arg num="1"/>[<arg num="2" priority="0"/>]</apply>
+    <impl position="method">operator[](<arg-list/>)</impl>
+  </op>
+
+  <op name="class-member">
+    <apply priority="100" assoc="1"><arg num="1"/>.<name/></apply>
+    <impl>Error</impl>
+  </op>
+
+  <op name="pointer-member">
+    <!-- Note: non-testable constraint -->
+ <apply priority="100"><arg num="1" assoc="1"/>-&gt;{member-name} (return type is pointer-to-object type)</apply>
+    <impl>operator-&gt;(<arg-list/>)</impl>
+  </op>
+
+  <op name="preincrement">
+    <apply priority="95">++<arg num="1"/></apply>
+    <impl position="method">operator++(<arg-list/>)</impl>
+  </op>
+
+  <op name="predecrement">
+    <apply priority="95">--<arg num="1"/></apply>
+    <impl position="method">operator--(<arg-list/>)</impl>
+  </op>
+
+  <op name="logical-not">
+    <apply priority="95" assoc="1">!<arg num="1"/></apply>
+    <impl position="method">operator!(<arg-list/>)</impl>
+  </op>
+
+  <op name="bitwise-not">
+    <apply priority="95" assoc="1">~<arg num="1"/></apply>
+    <impl position="method">operator~(<arg-list/>)</impl>
+  </op>
+
+  <op name="address-of">
+    <apply priority="95">&amp;<arg num="1"/></apply>
+    <impl position="method">operator&amp;(<arg-list/>)</impl>
+  </op>
+
+  <op name="dereference">
+    <apply priority="95" assoc="1">*<arg num="1"/></apply>
+    <impl position="method">operator*(<arg-list/>)</impl>
+  </op>
+
+  <op name="unary-plus">
+    <apply priority="95">+<arg num="1"/></apply>
+    <impl position="method">operator+(<arg-list/>)</impl>
+  </op>
+
+  <op name="unary-minus">
+    <apply priority="95">-<arg num="1"/></apply>
+    <impl position="method">operator-(<arg-list/>)</impl>
+  </op>
+
+  <op name="class-member-ptr">
+    <apply priority="90" assoc="1"><arg num="1"/>.*<arg num="2"/></apply>
+    <impl>Error</impl>
+  </op>
+
+  <op name="pointer-member-ptr">
+ <apply priority="90" assoc="1"><arg num="1"/>-&gt;*<arg num="2"/></apply>
+    <impl position="method">operator-&gt;*(<arg-list/>)</impl>
+  </op>
+
+  <op name="multiply">
+    <apply priority="90" assoc="1"><arg num="1"/> * <arg num="2"/></apply>
+    <impl position="freestanding">operator * (<arg-list/>)</impl>
+  </op>
+
+  <op name="divide">
+    <apply priority="90" assoc="1"><arg num="1"/> / <arg num="2"/></apply>
+    <impl position="freestanding">operator / (<arg-list/>)</impl>
+  </op>
+
+  <op name="modulus">
+    <apply priority="90" assoc="1"><arg num="1"/> % <arg num="2"/></apply>
+    <impl position="freestanding">operator % (<arg-list/>)</impl>
+  </op>
+
+  <op name="add">
+    <apply priority="85" assoc="1"><arg num="1"/> + <arg num="2"/></apply>
+    <impl position="freestanding">operator + (<arg-list/>)</impl>
+  </op>
+
+  <op name="subtract">
+    <apply priority="85" assoc="1"><arg num="1"/> - <arg num="2"/></apply>
+    <impl position="freestanding">operator - (<arg-list/>)</impl>
+  </op>
+
+  <op name="shift-left">
+ <apply priority="80" assoc="1"><arg num="1"/> &lt;&lt; <arg num="2"/></apply>
+    <impl position="freestanding">operator &lt;&lt; (<arg-list/>)</impl>
+  </op>
+
+  <op name="shift-right">
+ <apply priority="80" assoc="1"><arg num="1"/> &gt;&gt; <arg num="2"/></apply>
+    <impl position="freestanding">operator &gt;&gt; (<arg-list/>)</impl>
+  </op>
+
+  <op name="less-than">
+    <apply priority="75"><arg num="1"/> &lt; <arg num="2"/></apply>
+    <impl position="freestanding">operator &lt; (<arg-list/>)</impl>
+  </op>
+
+  <op name="greater-than">
+    <apply priority="75"><arg num="1"/> &gt; <arg num="2"/></apply>
+    <impl position="freestanding">operator &gt; (<arg-list/>)</impl>
+  </op>
+
+  <op name="less-than-or-equal">
+    <apply priority="75"><arg num="1"/> &lt;= <arg num="2"/></apply>
+    <impl position="freestanding">operator &lt;= (<arg-list/>)</impl>
+  </op>
+
+  <op name="greater-than-or-equal">
+    <apply priority="75"><arg num="1"/> &gt;= <arg num="2"/></apply>
+    <impl position="freestanding">operator &gt;= (<arg-list/>)</impl>
+  </op>
+
+  <op name="equal-to">
+    <apply priority="70"><arg num="1"/> == <arg num="2"/></apply>
+    <impl position="freestanding">operator == (<arg-list/>)</impl>
+  </op>
+
+  <op name="not-equal-to">
+    <apply priority="70"><arg num="1"/> != <arg num="2"/></apply>
+    <impl position="freestanding">operator != (<arg-list/>)</impl>
+  </op>
+
+  <op name="bitwise-and">
+ <apply priority="65" assoc="1"><arg num="1"/> &amp; <arg num="2"/></apply>
+    <impl position="freestanding">operator &amp; (<arg-list/>)</impl>
+  </op>
+
+  <op name="bitwise-or">
+    <apply priority="60" assoc="1"><arg num="1"/> | <arg num="2"/></apply>
+    <impl position="freestanding">operator | (<arg-list/>)</impl>
+  </op>
+
+  <op name="bitwise-xor">
+    <apply priority="55" assoc="1"><arg num="1"/> ^ <arg num="2"/></apply>
+    <impl position="freestanding">operator ^ (<arg-list/>)</impl>
+  </op>
+
+  <op name="logical-and">
+ <apply priority="50" assoc="1"><arg num="1"/> &amp;&amp; <arg num="2"/></apply>
+    <impl position="freestanding">operator &amp;&amp; (<arg-list/>)</impl>
+  </op>
+
+  <op name="logical-or">
+    <apply priority="45" assoc="1"><arg num="1"/> || <arg num="2"/></apply>
+    <impl position="freestanding">operator || (<arg-list/>)</impl>
+  </op>
+
+  <op name="conditional">
+ <apply priority="40" assoc="3"><arg num="1"/> ? <arg num="2"/> : <arg num="3"/></apply>
+    <impl>Error</impl>
+  </op>
+
+  <op name="assign">
+    <apply priority="35" assoc="2"><arg num="1"/> = <arg num="2"/></apply>
+    <impl position="method">operator = (<arg-list/>)</impl>
+  </op>
+
+  <op name="add-assign">
+    <apply priority="35" assoc="2"><arg num="1"/> += <arg num="2"/></apply>
+    <impl position="method">operator += (<arg-list/>)</impl>
+  </op>
+
+  <op name="subtract-assign">
+    <apply priority="35" assoc="2"><arg num="1"/> -= <arg num="2"/></apply>
+    <impl position="method">operator -= (<arg-list/>)</impl>
+  </op>
+
+  <op name="multiply-assign">
+    <apply priority="35" assoc="2"><arg num="1"/> *= <arg num="2"/></apply>
+    <impl position="method">operator *= (<arg-list/>)</impl>
+  </op>
+
+  <op name="divide-assign">
+    <apply priority="35" assoc="2"><arg num="1"/> /= <arg num="2"/></apply>
+    <impl position="method">operator /= (<arg-list/>)</impl>
+  </op>
+
+  <op name="modulus-assign">
+    <apply priority="35" assoc="2"><arg num="1"/> %= <arg num="2"/></apply>
+    <impl position="method">operator %= (<arg-list/>)</impl>
+  </op>
+
+  <op name="shift-left-assign">
+ <apply priority="35" assoc="2"><arg num="1"/> &lt;&lt;= <arg num="2"/></apply>
+    <impl position="method">operator &lt;&lt;= (<arg-list/>)</impl>
+  </op>
+
+  <op name="shift-right-assign">
+ <apply priority="35" assoc="2"><arg num="1"/> &gt;&gt;= <arg num="2"/></apply>
+    <impl position="method">operator &gt;&gt;= (<arg-list/>)</impl>
+  </op>
+
+  <op name="bitwise-and-assign">
+ <apply priority="35" assoc="2"><arg num="1"/> &amp;= <arg num="2"/></apply>
+    <impl position="method">operator &amp;= (<arg-list/>)</impl>
+  </op>
+
+  <op name="bitwise-or-assign">
+    <apply priority="35" assoc="2"><arg num="1"/> |= <arg num="2"/></apply>
+    <impl position="method">operator |= (<arg-list/>)</impl>
+  </op>
+
+  <op name="bitwise-xor-assign">
+    <apply priority="35" assoc="2"><arg num="1"/> ^= <arg num="2"/></apply>
+    <impl position="method">operator ^= (<arg-list/>)</impl>
+  </op>
+
+  <op name="comma">
+    <apply priority="20"><arg num="1"/>, <arg num="2"/></apply>
+    <impl position="freestanding">operator , (<arg-list/>)</impl>
+  </op>
+
+  <op name="function-pointer">
+    <apply><arg num="1"/> (*)(<arg-list start="2" priority="30"/>)</apply>
+    <impl>Error</impl>
+  </op>
+
+  <op name="functorize-operator">
+    <!-- Note: non-testable constraint -->
+ <apply>functorization of operator <name/> on arguments {<arg-list start="1"/>}</apply>
+    <impl>Error</impl>
+  </op>
+
+  <op name="functorize-function">
+    <!-- Note: non-testable constraint -->
+ <apply>functorization of function <name/> on arguments {<arg-list start="1"/>}</apply>
+    <impl>Error</impl>
+  </op>
+
+</operator-list>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/caramel/unparser.xsl     Mon Feb  8 23:37:27 2010
@@ -0,0 +1,497 @@
+<?xml version="1.0" ?>
+
+<!--
+Copyright (c) 2002-2003 The Trustees of Indiana University.
+                        All rights reserved.
+Copyright (c) 2000-2001 University of Notre Dame. All rights reserved.
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt) -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
+  <xsl:template name="unparse-cpp">
+    <xsl:param name="typeref"/>
+    <xsl:param name="definition_list"/>
+    <xsl:param name="priority">0</xsl:param>
+    <xsl:param name="ignore-cv" select="false()"/>
+    <xsl:param name="ignore-references" select="false()"/>
+    <xsl:param name="notations"/>
+    <xsl:param name="ignore-notation" select="false()"/>
+    <xsl:param name="print-updated-notation" select="false()"/>
+    <xsl:param name="use-typename" select="false()"/>
+ <xsl:param name="const-if-not-mutable-value" select="'const-if-not-mutable'"/>
+
+    <xsl:variable name="notation_check">
+ <xsl:if test="not($ignore-notation)"> <!-- Prevent infinite recursion -->
+       <xsl:call-template name="unparse-cpp">
+         <xsl:with-param name="typeref" select="$typeref"/>
+         <xsl:with-param name="definition_list" select="$definition_list"/>
+         <xsl:with-param name="priority">0</xsl:with-param>
+         <xsl:with-param name="ignore-cv" select="true()"/>
+         <xsl:with-param name="ignore-references" select="true()"/>
+         <xsl:with-param name="notations" select="$notations"/>
+         <xsl:with-param name="ignore-notation" select="true()"/>
+ <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+       </xsl:call-template>
+      </xsl:if>
+    </xsl:variable>
+
+    <!--
+    <xsl:message>Notation check: <xsl:value-of select="$notation_check"/>
+                Notations: <xsl:value-of select="$notations"/>
+    </xsl:message> -->
+
+ <xsl:variable name="this_op_priority" select="document('cpp-operators.xml')/operator-list/op[@name=name($typeref)]/apply/@priority"/>
+
+    <xsl:variable name="result">
+
+      <xsl:variable name="subcall_priority">
+       <xsl:choose>
+         <xsl:when test="true() or ($this_op_priority &gt; $priority)">
+           <xsl:value-of select="$this_op_priority"/>
+         </xsl:when>
+         <!-- <xsl:otherwise>0</xsl:otherwise> -->
+       </xsl:choose>
+      </xsl:variable>
+
+      <xsl:if test="$this_op_priority &lt;= $priority">(</xsl:if>
+
+      <xsl:choose>
+
+       <xsl:when test="name($typeref)='sample-value'"
+ >boost::sample_value &lt; <xsl:call-template name="unparse-cpp"><xsl:with-param name="typeref" select="$typeref/*[1]"/><xsl:with-param name="definition_list" select="$definition_list"/><xsl:with-param name="ignore-cv" select="$ignore-cv"/><xsl:with-param name="notations" select="$notations"/><xsl:with-param name="ignore-references" select="$ignore-references"/><xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/></xsl:call-template> &gt;()</xsl:when>
+
+       <xsl:when test="name($typeref)='reference-to'"
+ ><xsl:call-template name="unparse-cpp"><xsl:with-param name="typeref" select="$typeref/*[1]"/><xsl:with-param name="definition_list" select="$definition_list"/><xsl:with-param name="priority" select="$subcall_priority"/><xsl:with-param name="ignore-cv" select="$ignore-cv"/><xsl:with-param name="notations" select="$notations"/><xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/></xsl:call-template><xsl:if test="not($ignore-references)"> &amp;</xsl:if></xsl:when>
+
+       <xsl:when test="name($typeref)='pointer-to'"
+ ><xsl:call-template name="unparse-cpp"><xsl:with-param name="typeref" select="$typeref/*[1]"/><xsl:with-param name="definition_list" select="$definition_list"/><xsl:with-param name="priority" select="$subcall_priority"/><xsl:with-param name="ignore-cv" select="$ignore-cv"/><xsl:with-param name="notations" select="$notations"/></xsl:call-template> *</xsl:when>
+
+       <xsl:when test="name($typeref)='const'"
+ ><xsl:if test="not($ignore-cv)">const </xsl:if><xsl:call-template name="unparse-cpp"><xsl:with-param name="typeref" select="$typeref/*[1]"/><xsl:with-param name="definition_list" select="$definition_list"/><xsl:with-param name="priority" select="$subcall_priority"/><xsl:with-param name="ignore-cv" select="$ignore-cv"/><xsl:with-param name="notations" select="$notations"/><xsl:with-param name="ignore-references" select="$ignore-references"/><xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/></xsl:call-template>
+       </xsl:when>
+
+       <xsl:when test="name($typeref)='const-if-not-mutable'"
+ ><xsl:if test="not($ignore-cv)"><xsl:value-of select="$const-if-not-mutable-value"/><xsl:if test="$const-if-not-mutable-value"><xsl:text> </xsl:text></xsl:if></xsl:if><xsl:call-template name="unparse-cpp"><xsl:with-param name="typeref" select="$typeref/*[1]"/><xsl:with-param name="definition_list" select="$definition_list"/><xsl:with-param name="priority" select="$subcall_priority"/><xsl:with-param name="ignore-cv" select="$ignore-cv"/><xsl:with-param name="notations" select="$notations"/><xsl:with-param name="ignore-references" select="$ignore-references"/><xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/></xsl:call-template>
+       </xsl:when>
+
+       <xsl:when test="name($typeref)='volatile'"
+ ><xsl:if test="not($ignore-cv)">volatile </xsl:if><xsl:call-template name="unparse-cpp"><xsl:with-param name="typeref" select="$typeref/*[1]"/><xsl:with-param name="definition_list" select="$definition_list"/><xsl:with-param name="priority" select="$subcall_priority"/><xsl:with-param name="ignore-cv" select="$ignore-cv"/><xsl:with-param name="notations" select="$notations"/><xsl:with-param name="ignore-references" select="$ignore-references"/><xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/></xsl:call-template>
+       </xsl:when>
+
+       <xsl:when test="name($typeref)='apply-template'">
+ <xsl:value-of select="$typeref/@name"/>&lt;<xsl:for-each select="$typeref/*">
+             <xsl:if test="position()!=1">, </xsl:if><xsl:comment/>
+             <xsl:call-template name="unparse-cpp">
+               <xsl:with-param name="typeref" select="."/>
+               <xsl:with-param name="definition_list" 
select="$definition_list"/>
+               <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+               <xsl:with-param name="notations" select="$notations"/>
+ <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+             </xsl:call-template></xsl:for-each
+           ><xsl:comment/>&gt;</xsl:when>
+
+       <xsl:when test="name($typeref)='get-member-type'">
+ <xsl:call-template name="unparse-cpp"><xsl:with-param name="typeref" select="$typeref/*[1]"/><xsl:with-param name="definition_list" select="$definition_list"/><xsl:with-param name="ignore-cv" select="$ignore-cv"/><xsl:with-param name="notations" select="$notations"/><xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/></xsl:call-template>::<xsl:value-of select="$typeref/@name"/>
+       </xsl:when>
+
+       <xsl:when test="name($typeref)='type'">
+ <xsl:variable name="typeref_value" select="normalize-space(substring-before(substring-after($definition_list,concat('@(@',$typeref/@name,'=')),'@)@'))"/>
+         <xsl:choose>
+           <xsl:when test="$typeref_value=''">
+             <xsl:value-of select="$typeref/@name"/><xsl:comment/>
+           </xsl:when>
+           <xsl:otherwise>
+             <xsl:value-of select="$typeref_value"/><xsl:comment/>
+           </xsl:otherwise>
+         </xsl:choose>
+       </xsl:when>
+
+       <xsl:when test="name($typeref)='documentation'"/>
+
+ <xsl:when test="document('cpp-operators.xml')/operator-list/op[@name=name($typeref)]"> + <xsl:variable name="op_file" select="document('cpp-operators.xml')/operator-list"/> + <xsl:variable name="op_info" select="$op_file/op[@name=name($typeref)]/apply/."/>
+
+         <xsl:call-template name="unparse-operator-definition">
+           <xsl:with-param name="typeref" select="$typeref"/>
+ <xsl:with-param name="operator_nodeset" select="$op_info/child::node()"/>
+           <xsl:with-param name="my_priority" select="$subcall_priority"/>
+           <xsl:with-param name="definition_list" select="$definition_list"/>
+           <xsl:with-param name="notations" select="$notations"/>
+           <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+ <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/> + <xsl:with-param name="print-updated-notation" select="$print-updated-notation"/>
+         </xsl:call-template>
+
+       </xsl:when>
+
+       <xsl:otherwise>
+         (Unrecognized tag <xsl:value-of select="name($typeref)"/>)
+       </xsl:otherwise>
+      </xsl:choose>
+
+      <!-- Close parenthesis code moved below -->
+
+    </xsl:variable>
+
+ <!-- <xsl:message>ignore-notation = <xsl:value-of select="$ignore-notation"/></xsl:message> --> + <!-- <xsl:message>notation_check = <xsl:value-of select="$notation_check"/></xsl:message> --> + <!-- <xsl:message>notations = <xsl:value-of select="$notations"/></xsl:message> --> + <!-- <xsl:message>result = <xsl:value-of select="$result"/></xsl:message> -->
+
+ <xsl:variable name="used_notation" select="boolean($notation_check) and boolean(substring-before(substring-after($notations, concat('@@(@@', $notation_check, '@@=@@')),'@@)@@'))"/>
+
+    <xsl:variable name="notations2">
+      <!-- Possibly replace from result of unparse-operator-definition -->
+      <xsl:choose>
+       <xsl:when test="contains($result, ' *@@@* ')">
+         <xsl:value-of select="substring-after($result, ' *@@@* ')"/>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:value-of select="$notations"/>
+       </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="result2">
+      <!-- Possibly replace from result of unparse-operator-definition -->
+      <xsl:choose>
+       <xsl:when test="contains($result, ' *@@@* ')">
+         <xsl:value-of select="substring-before($result, ' *@@@* ')"/>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:value-of select="$result"/>
+       </xsl:otherwise>
+      </xsl:choose>
+      <!-- Close parenthesis code -->
+      <xsl:if test="$this_op_priority &lt;= $priority">)</xsl:if>
+    </xsl:variable>
+
+    <xsl:variable name="notation_varlist">
+      <xsl:choose>
+       <xsl:when test="$used_notation">
+ <xsl:value-of select="substring-before(substring-after($notations2, concat('@@(@@', $notation_check, '@@=@@')), '@@)@@')"/>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:value-of select="$result2"/>
+       </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+ <xsl:variable name="new_varlist" select="substring-after(normalize-space($notation_varlist), ' ')"/>
+
+    <xsl:variable name="notation_var">
+      <xsl:choose>
+       <xsl:when test="not($used_notation)">
+         <xsl:value-of select="$result2"/>
+       </xsl:when>
+       <xsl:when test="$new_varlist=''">
+         <xsl:value-of select="$notation_varlist"/>
+       </xsl:when>
+       <xsl:otherwise>
+ <xsl:value-of select="substring-before(normalize-space($notation_varlist), ' ')"/>
+       </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Generate new notation list -->
+    <xsl:variable name="new_notations">
+      <xsl:choose>
+       <xsl:when test="$used_notation">
+ <xsl:value-of select="normalize-space(concat('@@(@@', $notation_check, '@@=@@', $new_varlist, '@@)@@', $notations2))"/> + <!-- Duplicate entries always use first occurrance, so I can optimize this -->
+       </xsl:when>
+       <xsl:otherwise><xsl:value-of select="$notations2"/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+ <!-- <xsl:message>final_result = <xsl:value-of select="normalize-space($final_result)"/></xsl:message> -->
+
+ <xsl:call-template name="add-typename"><xsl:with-param name="really-do-it" select="$use-typename"/><xsl:with-param name="type"><xsl:value-of select="normalize-space($notation_var)"/></xsl:with-param></xsl:call-template><xsl:if test="$print-updated-notation"> *@@@* <xsl:value-of select="$new_notations"/></xsl:if>
+
+  </xsl:template>
+
+  <xsl:template name="unparse-operator-definition">
+    <xsl:param name="typeref"/>
+    <xsl:param name="operator_nodeset"/>
+    <xsl:param name="current_start">1</xsl:param>
+    <xsl:param name="my_priority"/>
+    <xsl:param name="definition_list"/>
+    <xsl:param name="notations"/>
+    <xsl:param name="ignore-cv"/>
+    <xsl:param name="self"/>
+    <xsl:param name="use-code-block" select="false()"/>
+    <xsl:param name="print-updated-notation" select="false()"/>
+    <xsl:param name="const-if-not-mutable-value"/>
+
+ <xsl:variable name="op_current" select="$operator_nodeset[position()=1]"/> + <xsl:variable name="op_rest" select="$operator_nodeset[position()!=1]"/>
+
+    <xsl:choose>
+
+      <xsl:when test="count($operator_nodeset)=0">
+ <xsl:if test="$print-updated-notation"> *@@@* <xsl:value-of select="$notations"/></xsl:if>
+      </xsl:when>
+
+ <xsl:when test="$op_current != $op_current/../*"> <!-- If I am not an element -->
+       <xsl:value-of select="$op_current"/>
+       <xsl:call-template name="unparse-operator-definition">
+         <xsl:with-param name="typeref" select="$typeref"/>
+         <xsl:with-param name="operator_nodeset" select="$op_rest"/>
+         <xsl:with-param name="my_priority" select="$my_priority"/>
+         <xsl:with-param name="definition_list" select="$definition_list"/>
+         <xsl:with-param name="notations" select="$notations"/>
+         <xsl:with-param name="self" select="$self"/>
+         <xsl:with-param name="use-code-block" select="$use-code-block"/>
+ <xsl:with-param name="print-updated-notation" select="$print-updated-notation"/> + <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+       </xsl:call-template>
+      </xsl:when>
+
+      <xsl:when test="name($op_current)='name'">
+       <xsl:value-of select="$typeref/@name"/>
+       <xsl:call-template name="unparse-operator-definition">
+         <xsl:with-param name="typeref" select="$typeref"/>
+         <xsl:with-param name="operator_nodeset" select="$op_rest"/>
+         <xsl:with-param name="my_priority" select="$my_priority"/>
+         <xsl:with-param name="definition_list" select="$definition_list"/>
+         <xsl:with-param name="notations" select="$notations"/>
+         <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+         <xsl:with-param name="self" select="$self"/>
+         <xsl:with-param name="use-code-block" select="$use-code-block"/>
+ <xsl:with-param name="print-updated-notation" select="$print-updated-notation"/> + <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+       </xsl:call-template>
+      </xsl:when>
+
+      <xsl:when test="name($op_current)='self'">
+        <xsl:call-template name="concept.link">
+          <xsl:with-param name="name" select="string($self)"/>
+        </xsl:call-template>
+       <xsl:call-template name="unparse-operator-definition">
+         <xsl:with-param name="typeref" select="$typeref"/>
+         <xsl:with-param name="operator_nodeset" select="$op_rest"/>
+         <xsl:with-param name="my_priority" select="$my_priority"/>
+         <xsl:with-param name="definition_list" select="$definition_list"/>
+         <xsl:with-param name="notations" select="$notations"/>
+         <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+         <xsl:with-param name="self" select="$self"/>
+         <xsl:with-param name="use-code-block" select="$use-code-block"/>
+ <xsl:with-param name="print-updated-notation" select="$print-updated-notation"/> + <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+       </xsl:call-template>
+      </xsl:when>
+
+      <xsl:when test="name($op_current)='arg'">
+       <xsl:variable name="num" select="$op_current/@num"/>
+       <xsl:variable name="assoc" select="$op_current/../@assoc"/>
+       <xsl:variable name="my_priority_before" select="$my_priority"/>
+       <xsl:variable name="my_priority">
+         <xsl:choose>
+           <xsl:when test="count($op_current/@priority)">
+             <xsl:value-of select="$op_current/@priority"/>
+           </xsl:when>
+           <xsl:when test="$assoc and ($num = $assoc)">
+             <xsl:value-of select="$my_priority_before - 1"/>
+           </xsl:when>
+           <xsl:otherwise>
+             <xsl:value-of select="$my_priority"/>
+           </xsl:otherwise>
+         </xsl:choose>
+       </xsl:variable>
+       <xsl:variable name="typeref-result">
+         <xsl:call-template name="unparse-cpp">
+           <xsl:with-param name="typeref" 
select="$typeref/*[position()=$num]"/>
+           <xsl:with-param name="definition_list" select="$definition_list"/>
+           <xsl:with-param name="priority" select="$my_priority"/>
+           <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+           <xsl:with-param name="notations" select="$notations"/>
+           <xsl:with-param name="print-updated-notation" select="true()"/>
+ <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+         </xsl:call-template>
+       </xsl:variable>
+ <xsl:variable name="typeref-print" select="normalize-space(substring-before($typeref-result, ' *@@@* '))"/> + <xsl:variable name="new_notations" select="normalize-space(substring-after($typeref-result, ' *@@@* '))"/>
+
+       <xsl:choose>
+         <xsl:when test="$use-code-block">
+           <type><xsl:value-of select="$typeref-print"/></type>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:value-of select="$typeref-print"/>
+         </xsl:otherwise>
+       </xsl:choose>
+
+       <xsl:call-template name="unparse-operator-definition">
+         <xsl:with-param name="typeref" select="$typeref"/>
+         <xsl:with-param name="operator_nodeset" select="$op_rest"/>
+         <xsl:with-param name="my_priority" select="$my_priority_before"/>
+         <xsl:with-param name="definition_list" select="$definition_list"/>
+         <xsl:with-param name="notations" select="$new_notations"/>
+         <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+         <xsl:with-param name="self" select="$self"/>
+         <xsl:with-param name="use-code-block" select="$use-code-block"/>
+ <xsl:with-param name="print-updated-notation" select="$print-updated-notation"/> + <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+       </xsl:call-template>
+      </xsl:when>
+
+      <xsl:when test="name($op_current)='arg-list'">
+       <xsl:variable name="start" select="$op_current/@start"/>
+       <xsl:variable name="typeref-result">
+         <xsl:choose>
+           <xsl:when test="$current_start &gt;= $start">
+             <xsl:call-template name="unparse-cpp">
+               <xsl:with-param name="typeref" 
select="$typeref/*[$current_start]"/>
+               <xsl:with-param name="definition_list" 
select="$definition_list"/>
+               <xsl:with-param name="priority" select="$my_priority"/>
+               <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+               <xsl:with-param name="notations" select="$notations"/>
+               <xsl:with-param name="print-updated-notation" select="true()"/>
+ <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+             </xsl:call-template>
+           </xsl:when>
+
+           <xsl:otherwise>
+              *@@@* <xsl:value-of select="$notations"/>
+           </xsl:otherwise>
+         </xsl:choose>
+       </xsl:variable>
+
+ <xsl:variable name="typeref-print" select="normalize-space(substring-before($typeref-result, ' *@@@* '))"/> + <xsl:variable name="new_notations" select="normalize-space(substring-after($typeref-result, ' *@@@* '))"/>
+
+       <xsl:choose>
+         <xsl:when test="$use-code-block">
+           <type><xsl:value-of select="$typeref-print"/></type>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:value-of select="$typeref-print"/>
+         </xsl:otherwise>
+       </xsl:choose>
+
+       <xsl:if test="$current_start &gt;= $start">
+         <xsl:if test="$current_start!=count($typeref/*)">, </xsl:if>
+       </xsl:if>
+
+       <xsl:choose>
+         <xsl:when test="$current_start != count($typeref/*)">
+           <xsl:call-template name="unparse-operator-definition">
+             <xsl:with-param name="typeref" select="$typeref"/>
+             <xsl:with-param name="operator_nodeset" 
select="$operator_nodeset"/>
+             <xsl:with-param name="current_start" select="$current_start + 1"/>
+             <xsl:with-param name="my_priority" select="$my_priority"/>
+             <xsl:with-param name="definition_list" select="$definition_list"/>
+             <xsl:with-param name="notations" select="$new_notations"/>
+             <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+             <xsl:with-param name="self" select="$self"/>
+             <xsl:with-param name="use-code-block" select="$use-code-block"/>
+ <xsl:with-param name="print-updated-notation" select="$print-updated-notation"/> + <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+           </xsl:call-template>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:call-template name="unparse-operator-definition">
+             <xsl:with-param name="typeref" select="$typeref"/>
+             <xsl:with-param name="operator_nodeset" select="$op_rest"/>
+             <xsl:with-param name="my_priority" select="$my_priority"/>
+             <xsl:with-param name="definition_list" select="$definition_list"/>
+             <xsl:with-param name="notations" select="$new_notations"/>
+             <xsl:with-param name="ignore-cv" select="$ignore-cv"/>
+             <xsl:with-param name="self" select="$self"/>
+             <xsl:with-param name="use-code-block" select="$use-code-block"/>
+ <xsl:with-param name="const-if-not-mutable-value" select="$const-if-not-mutable-value"/>
+           </xsl:call-template>
+         </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+
+ <xsl:otherwise>Invalid tag in operator definition: <xsl:value-of select="name($op_current)"/></xsl:otherwise>
+
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="add-typename">
+    <!-- Adds typename to the front of a string if it is necessary. -->
+    <xsl:param name="type"/> <!-- string to prepend to -->
+ <xsl:param name="params" select="/concept/param | /concept/define-type | /concept/associated-type"/>
+      <!-- nodeset of param tags for concept -->
+      <!-- associated types are assumed to be dependent -->
+    <xsl:param name="really-do-it"/> <!-- really change anything? -->
+
+    <xsl:variable name="type-after-last-scope">
+      <xsl:call-template name="substring-before-last">
+       <xsl:with-param name="string" select="$type"/>
+       <xsl:with-param name="to-find" select="'::'"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:variable name="tokenized-type-after-last-scope">
+      <xsl:call-template name="rough-tokenize">
+       <xsl:with-param name="string" select="$type-after-last-scope"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:choose>
+ <xsl:when test="$really-do-it and boolean($params[contains($tokenized-type-after-last-scope, concat(' ', @name, ' '))])">
+      <!-- If the tokenized string contains any of the param names in a
+      token by itself, return true.  Return false otherwise -->
+       <xsl:comment/>typename <xsl:value-of select="$type"/><xsl:comment/>
+      </xsl:when>
+      <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="substring-before-last">
+    <xsl:param name="string"/>
+    <xsl:param name="to-find"/>
+    <xsl:param name="string-processed-so-far"/> <!-- internal -->
+    <!-- Find the substring of $string before the last occurrance of
+    $to-find, returning '' if it was not found. -->
+
+    <xsl:choose>
+      <xsl:when test="contains($string, $to-find)">
+       <xsl:call-template name="substring-before-last">
+ <xsl:with-param name="string" select="substring-after($string, $to-find)"/>
+         <xsl:with-param name="to-find" select="$to-find"/>
+ <xsl:with-param name="string-processed-so-far" select="concat($string-processed-so-far, substring-before($string, $to-find), $to-find)"/>
+       </xsl:call-template>
+      </xsl:when>
+
+      <xsl:otherwise>
+ <xsl:value-of select="substring($string-processed-so-far, 1, string-length($string-processed-so-far)-(string-length($to-find)))"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="substring-after-last">
+    <xsl:param name="string"/>
+    <xsl:param name="to-find"/>
+    <!-- Find the substring of $string after the last occurrance of
+    $to-find, returning the original string if it was not found. -->
+
+    <xsl:choose>
+      <xsl:when test="contains($string, $to-find)">
+       <xsl:call-template name="substring-after-last">
+ <xsl:with-param name="string" select="substring-after($string, $to-find)"/>
+         <xsl:with-param name="to-find" select="$to-find"/>
+       </xsl:call-template>
+      </xsl:when>
+
+      <xsl:otherwise>
+       <xsl:value-of select="$string"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="rough-tokenize">
+    <xsl:param name="string"/>
+    <!-- Do a rough tokenization of the string.  Right now, just translate
+    all non-token-chars to spaces, normalize-space the result, and prepend
+    and append spaces. -->
+
+ <xsl:value-of select="concat(' ', normalize-space(translate($string, '&lt;&gt;,./?;:[]{}-=\\_+|!@#$%^&amp;*()', ' ')), ' ')"/>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/chunk-common.xsl Mon Feb  8 23:37:27 2010
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+
+<!-- Import the HTML chunking stylesheet -->
+<xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/>
+
+<xsl:import href="relative-href.xsl"/>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="recursive-chunk-filename">
+    <xsl:param name="recursive" select="false()"/>
+
+    <xsl:variable name="their">
+        <xsl:apply-imports mode="recursive-chunk-filename" select="."/>
+    </xsl:variable>
+
+ <xsl:variable name="basename" select="substring-before( $their, $html.ext )"/>
+    <xsl:choose>
+        <xsl:when test="not($recursive)">
+ <!-- translate dots into directory separators, and replace illegal file path characters with underscores --> + <xsl:value-of select="translate($basename, '.&lt;&gt;\:*?&quot;|,()!+=&amp;', '/_______________' )"/>
+            <xsl:value-of select="$html.ext"/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="$basename"/>
+            <xsl:value-of select="'.'"/>
+        </xsl:otherwise>
+    </xsl:choose>
+
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="navig.content">
+    <xsl:param name="direction" select="next"/>
+    <xsl:variable name="navtext">
+        <xsl:choose>
+           <xsl:when test="$direction = 'prev'">
+               <xsl:call-template name="gentext.nav.prev"/>
+           </xsl:when>
+           <xsl:when test="$direction = 'next'">
+               <xsl:call-template name="gentext.nav.next"/>
+           </xsl:when>
+           <xsl:when test="$direction = 'up'">
+               <xsl:call-template name="gentext.nav.up"/>
+           </xsl:when>
+           <xsl:when test="$direction = 'home'">
+               <xsl:call-template name="gentext.nav.home"/>
+           </xsl:when>
+           <xsl:otherwise>
+               <xsl:text>xxx</xsl:text>
+           </xsl:otherwise>
+       </xsl:choose>
+    </xsl:variable>
+
+    <xsl:choose>
+       <xsl:when test="$navig.graphics != 0">
+           <img>
+               <xsl:attribute name="src">
+            <xsl:call-template name="href.target.relative">
+ <xsl:with-param name="target" select="$navig.graphics.path"/>
+            </xsl:call-template>
+                   <xsl:value-of select="$direction"/>
+                   <xsl:value-of select="$navig.graphics.extension"/>
+               </xsl:attribute>
+               <xsl:attribute name="alt">
+                   <xsl:value-of select="$navtext"/>
+               </xsl:attribute>
+           </img>
+       </xsl:when>
+       <xsl:otherwise>
+           <xsl:value-of select="$navtext"/>
+       </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- ====================================================================== -->
+
+<xsl:template match="@fileref">
+    <xsl:choose>
+        <xsl:when test="contains(., ':')">
+            <xsl:value-of select="."/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:call-template name="href.target.relative">
+                <xsl:with-param name="target" select="."/>
+                <xsl:with-param name="context" select=".."/>
+            </xsl:call-template>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<xsl:template match="@url">
+    <xsl:choose>
+        <xsl:when test="contains(., ':')">
+            <xsl:value-of select="."/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:text>XXX</xsl:text>
+            <xsl:value-of select="."/>
+            <xsl:text>XXX</xsl:text>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/docbook-layout.xsl       Mon Feb  8 23:37:27 2010
@@ -0,0 +1,211 @@
+<?xml version = "1.0" encoding = "utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+
+<xsl:stylesheet version = "1.0"
+   xmlns:xsl = "http://www.w3.org/1999/XSL/Transform";
+>
+  <!-- needed for calsTable template -->
+
+  <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/current/html/formal.xsl"/>
+
+  <!--
+     Override the behaviour of some DocBook elements for better
+     integration with the new look & feel.
+  -->
+
+  <xsl:template match = "programlisting[ancestor::informaltable]">
+     <pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
+  </xsl:template>
+
+  <xsl:template match = "refsynopsisdiv">
+     <h2 class = "{name(.)}-title">Synopsis</h2>
+     <div class = "{name(.)}"><xsl:apply-templates/></div>
+  </xsl:template>
+
+  <!-- table: remove border = '1' -->
+
+  <xsl:template match = "table|informaltable">
+     <xsl:choose>
+        <xsl:when test = "self::table and tgroup|mediaobject|graphic">
+           <xsl:apply-imports/>
+ </xsl:when><xsl:when test = "self::informaltable and tgroup| mediaobject|graphic">
+           <xsl:call-template name = "informal.object">
+              <xsl:with-param name = "class"><xsl:choose>
+                 <xsl:when test = "@tabstyle">
+                    <xsl:value-of select = "@tabstyle"/>
+                 </xsl:when><xsl:otherwise>
+                    <xsl:value-of select = "local-name(.)"/>
+                 </xsl:otherwise>
+              </xsl:choose></xsl:with-param>
+           </xsl:call-template>
+        </xsl:when><xsl:otherwise>
+ <table class = "table"><xsl:copy-of select = "@*[not(local-name(.)='border')]"/>
+              <xsl:call-template name = "htmlTable"/>
+           </table>
+        </xsl:otherwise>
+     </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match = "tgroup" name = "tgroup">
+ <xsl:variable name="summary"><xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
+        <xsl:with-param name="attribute" select="'table-summary'"/>
+     </xsl:call-template></xsl:variable>
+
+ <xsl:variable name="cellspacing"><xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
+        <xsl:with-param name="attribute" select="'cellspacing'"/>
+     </xsl:call-template></xsl:variable>
+
+ <xsl:variable name="cellpadding"><xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" select="processing-instruction('dbhtml')[1]"/>
+        <xsl:with-param name="attribute" select="'cellpadding'"/>
+     </xsl:call-template></xsl:variable>
+
+     <table class = "table">
+        <xsl:choose>
+           <xsl:when test="../textobject/phrase">
+              <xsl:attribute name="summary">
+                 <xsl:value-of select="../textobject/phrase"/>
+              </xsl:attribute>
+           </xsl:when><xsl:when test="$summary != ''">
+              <xsl:attribute name="summary">
+                 <xsl:value-of select="$summary"/>
+              </xsl:attribute>
+           </xsl:when><xsl:when test="../title">
+              <xsl:attribute name="summary">
+                 <xsl:value-of select="string(../title)"/>
+              </xsl:attribute>
+           </xsl:when>
+           <xsl:otherwise/>
+ </xsl:choose><xsl:if test="$cellspacing != '' or $html.cellspacing != ''">
+           <xsl:attribute name="cellspacing"><xsl:choose>
+ <xsl:when test="$cellspacing != ''"><xsl:value-of select="$cellspacing"/></xsl:when> + <xsl:otherwise><xsl:value-of select="$html.cellspacing"/></xsl:otherwise>
+           </xsl:choose></xsl:attribute>
+ </xsl:if><xsl:if test="$cellpadding != '' or $html.cellpadding != ''">
+           <xsl:attribute name="cellpadding"><xsl:choose>
+ <xsl:when test="$cellpadding != ''"><xsl:value-of select="$cellpadding"/></xsl:when> + <xsl:otherwise><xsl:value-of select="$html.cellpadding"/></xsl:otherwise>
+           </xsl:choose></xsl:attribute>
+        </xsl:if><xsl:if test="../@pgwide=1">
+           <xsl:attribute name="width">100%</xsl:attribute>
+        </xsl:if>
+
+        <xsl:variable name="colgroup">
+           <colgroup><xsl:call-template name="generate.colgroup">
+              <xsl:with-param name="cols" select="@cols"/>
+           </xsl:call-template></colgroup>
+        </xsl:variable>
+
+ <xsl:variable name="explicit.table.width"><xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" select="../processing-instruction('dbhtml')[1]"/>
+           <xsl:with-param name="attribute" select="'table-width'"/>
+        </xsl:call-template></xsl:variable>
+
+        <xsl:variable name="table.width"><xsl:choose>
+           <xsl:when test="$explicit.table.width != ''">
+              <xsl:value-of select="$explicit.table.width"/>
+           </xsl:when><xsl:when test="$default.table.width = ''">
+              <xsl:text>100%</xsl:text>
+           </xsl:when><xsl:otherwise>
+              <xsl:value-of select="$default.table.width"/>
+           </xsl:otherwise>
+        </xsl:choose></xsl:variable>
+
+ <xsl:if test="$default.table.width != '' or $explicit.table.width != ''">
+           <xsl:attribute name="width"><xsl:choose>
+              <xsl:when test="contains($table.width, '%')">
+                 <xsl:value-of select="$table.width"/>
+ </xsl:when><xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
+                 <xsl:choose>
+ <xsl:when test="function-available('stbl:convertLength')"> + <xsl:value-of select="stbl:convertLength($table.width)"/> + </xsl:when><xsl:when test="function-available('xtbl:convertLength')"> + <xsl:value-of select="xtbl:convertLength($table.width)"/>
+                    </xsl:when><xsl:otherwise>
+                       <xsl:message terminate="yes">
+ <xsl:text>No convertLength function available.</xsl:text>
+                       </xsl:message>
+                    </xsl:otherwise>
+                 </xsl:choose>
+              </xsl:when><xsl:otherwise>
+                 <xsl:value-of select="$table.width"/>
+              </xsl:otherwise>
+           </xsl:choose></xsl:attribute>
+        </xsl:if>
+
+        <xsl:choose>
+ <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
+              <xsl:choose>
+ <xsl:when test="function-available('stbl:adjustColumnWidths')"> + <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/> + </xsl:when><xsl:when test="function-available('xtbl:adjustColumnWidths')"> + <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup)"/> + </xsl:when><xsl:when test="function-available('ptbl:adjustColumnWidths')"> + <xsl:copy-of select="ptbl:adjustColumnWidths($colgroup)"/>
+                 </xsl:when><xsl:otherwise>
+                    <xsl:message terminate="yes">
+ <xsl:text>No adjustColumnWidths function available.</xsl:text>
+                    </xsl:message>
+                 </xsl:otherwise>
+              </xsl:choose>
+           </xsl:when><xsl:otherwise>
+              <xsl:copy-of select="$colgroup"/>
+           </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:apply-templates select="thead"/>
+        <xsl:apply-templates select="tfoot"/>
+        <xsl:apply-templates select="tbody"/>
+
+        <xsl:if test=".//footnote"><tbody class="footnotes">
+           <tr><td colspan="{@cols}">
+ <xsl:apply-templates select=".//footnote" mode="table.footnote.mode"/>
+           </td></tr>
+        </tbody></xsl:if>
+     </table>
+  </xsl:template>
+
+  <!-- table of contents
+
+    The standard Docbook template selects, amoung others,
+    the 'refentry' element for inclusion in TOC. In some
+    cases, this creates empty TOC. The most possible reason
+    is that there's 'refentry' element without 'refentrytitle',
+    but it's a mistery why it occurs. Even if we fix that
+    problem, we'll get non-empty TOC where no TOC is desired
+    (e.g. for section corresponding to each header file in
+    library doc). So, don't bother for now.
+  -->
+
+  <xsl:template name="section.toc">
+     <xsl:param name="toc-context" select="."/>
+     <xsl:param name="toc.title.p" select="true()"/>
+
+     <xsl:call-template name="make.toc">
+        <xsl:with-param name="toc-context" select="$toc-context"/>
+        <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
+        <xsl:with-param name="nodes" select="
+           section|sect1|sect2|sect3|sect4|sect5|
+           bridgehead[$bridgehead.in.toc != 0]
+        "/>
+     </xsl:call-template>
+  </xsl:template>
+
+  <!-- When there is both a title and a caption for a table, only use the
+       title. -->
+  <xsl:template match="table" mode="title.markup">
+    <xsl:param name="allow-anchors" select="0"/>
+    <xsl:apply-templates select="(title|caption)[1]" mode="title.markup">
+      <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    </xsl:apply-templates>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/docbook.xsl      Mon Feb  8 23:37:27 2010
@@ -0,0 +1,542 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns:xi="http://www.w3.org/2001/XInclude";
+                version="1.0">
+  <xsl:include href="reference.xsl"/>
+
+  <xsl:output method="xml"
+    doctype-public="-//OASIS//DTD DocBook XML V4.2//EN"
+ doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"/>
+
+  <!-- The maximum number of columns allowed in preformatted text -->
+  <xsl:param name="max-columns" select="78"/>
+
+  <!-- The root of the Boost directory -->
+  <xsl:param name="boost.root" select="'../..'"/>
+
+  <!-- A space-separated list of libraries to include in the
+       output. If this list is empty, all libraries will be included. -->
+  <xsl:param name="boost.include.libraries" select="''"/>
+
+  <!-- Whether to rewrite relative URL's to point to the website -->
+  <xsl:param name="boost.url.prefix"/>
+
+  <!-- A space-separated list of xml elements in the input file for which
+       whitespace should be preserved -->
+  <xsl:preserve-space elements="*"/>
+
+  <!-- The root for boost headers -->
+  <xsl:param name="boost.header.root">
+    <xsl:if test="$boost.url.prefix">
+      <xsl:value-of select="$boost.url.prefix"/>
+      <xsl:text>/</xsl:text>
+    </xsl:if>
+    <xsl:value-of select="$boost.root"/>
+  </xsl:param>
+
+  <!-- The prefix for 'boost:' links. -->
+  <xsl:variable name="boost.protocol.text">
+ <xsl:if test="($boost.url.prefix != '') and (contains($boost.root, '://') = 0)">
+      <xsl:value-of select="concat($boost.url.prefix, '/', $boost.root)"/>
+    </xsl:if>
+ <xsl:if test="($boost.url.prefix = '') or contains($boost.root, '://')">
+      <xsl:value-of select="$boost.root"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:template match="library-reference">
+    <xsl:choose>
+      <xsl:when test="ancestor::library-reference">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:otherwise>
+        <section>
+          <xsl:choose>
+            <xsl:when test="@id">
+              <xsl:attribute name="id">
+                <xsl:value-of select="@id"/>
+              </xsl:attribute>
+            </xsl:when>
+            <xsl:when test="ancestor::library/attribute::id">
+              <xsl:attribute name="id">
+                <xsl:value-of select="ancestor::library/attribute::id"/>
+                <xsl:text>.reference</xsl:text>
+              </xsl:attribute>
+            </xsl:when>
+          </xsl:choose>
+          <xsl:if test="not(title)">
+            <title>
+              <xsl:text>Reference</xsl:text>
+            </title>
+          </xsl:if>
+
+          <xsl:if test="concept">
+            <section>
+              <xsl:choose>
+                <xsl:when test="@id">
+                  <xsl:attribute name="id">
+                    <xsl:value-of select="@id"/>
+                    <xsl:text>.concepts</xsl:text>
+                  </xsl:attribute>
+                </xsl:when>
+                <xsl:when test="ancestor::library/attribute::id">
+                  <xsl:attribute name="id">
+ <xsl:value-of select="ancestor::library/attribute::id"/>
+                    <xsl:text>.concepts</xsl:text>
+                  </xsl:attribute>
+                </xsl:when>
+              </xsl:choose>
+
+              <title>Concepts</title>
+
+              <itemizedlist>
+                <xsl:for-each select="concept">
+                  <listitem>
+                    <xsl:call-template name="internal-link">
+                      <xsl:with-param name="to">
+                        <xsl:call-template name="generate.id"/>
+                      </xsl:with-param>
+                      <xsl:with-param name="text" select="@name"/>
+                    </xsl:call-template>
+                  </listitem>
+                </xsl:for-each>
+              </itemizedlist>
+            </section>
+          </xsl:if>
+
+          <xsl:apply-templates/>
+        </section>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="header">
+    <xsl:if test="*">
+      <section>
+        <xsl:attribute name="id">
+          <xsl:call-template name="generate.id"/>
+        </xsl:attribute>
+
+        <title>
+          <xsl:text>Header &lt;</xsl:text>
+          <ulink>
+            <xsl:attribute name="url">
+              <xsl:value-of select="$boost.header.root"/>
+              <xsl:text>/</xsl:text>
+              <xsl:value-of select="@name"/>
+            </xsl:attribute>
+            <xsl:value-of select="@name"/>
+          </ulink>
+          <xsl:text>&gt;</xsl:text>
+        </title>
+
+        <xsl:apply-templates select="para|section" mode="annotation"/>
+
+        <xsl:if test="macro">
+          <xsl:call-template name="synopsis">
+            <xsl:with-param name="text">
+              <xsl:apply-templates mode="synopsis" select="macro">
+                <xsl:with-param name="indentation" select="0"/>
+              </xsl:apply-templates>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+
+ <xsl:if test="descendant::class|descendant::struct| descendant::union
+                     |descendant::function|descendant::free-function-group
+                     |descendant::overloaded-function|descendant::enum
+                     |descendant::typedef">
+          <xsl:call-template name="synopsis">
+            <xsl:with-param name="text">
+              <xsl:apply-templates mode="synopsis"
+                select="namespace|class|struct|union
+                       |function|free-function-group
+                       |overloaded-function|enum
+                       |typedef">
+                <xsl:with-param name="indentation" select="0"/>
+              </xsl:apply-templates>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+
+        <xsl:apply-templates mode="namespace-reference"/>
+      </section>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="header" mode="generate.id">
+    <xsl:text>header.</xsl:text>
+    <xsl:value-of select="translate(@name, '/.', '._')"/>
+  </xsl:template>
+
+  <xsl:template match="*" mode="passthrough">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+  <!-- Syntax highlighting -->
+  <xsl:template name="highlight-keyword">
+    <xsl:param name="keyword"/>
+    <xsl:choose>
+      <xsl:when test="$boost.syntax.highlight='1'">
+        <emphasis role="bold"><xsl:value-of select="$keyword"/></emphasis>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$keyword"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="highlight-comment">
+    <xsl:param name="text"/>
+    <emphasis><xsl:copy-of select="$text"/></emphasis>
+  </xsl:template>
+
+  <xsl:template name="monospaced">
+    <xsl:param name="text"/>
+    <computeroutput><xsl:value-of select="$text"/></computeroutput>
+  </xsl:template>
+
+  <!-- Linking -->
+  <xsl:template match="ulink">
+    <xsl:copy>
+      <xsl:copy-of select="@*"/>
+      <xsl:attribute name="url">
+        <xsl:choose>
+          <xsl:when test="starts-with(@url, 'boost:/')">
+ <xsl:value-of select="concat($boost.protocol.text, substring-after(@url, 'boost:'))"/>
+          </xsl:when>
+          <xsl:when test="starts-with(@url, 'boost:')">
+ <xsl:value-of select="concat($boost.protocol.text, '/', substring-after(@url, 'boost:'))"/>
+          </xsl:when>
+ <xsl:when test="$boost.url.prefix != '' and not(contains(@url, ':') or starts-with(@url, '//'))">
+            <xsl:value-of select="concat($boost.url.prefix, '/', @url)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="@url"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  <xsl:template name="internal-link">
+    <xsl:param name="to"/>
+    <xsl:param name="text"/>
+    <xsl:param name="highlight" select="false()"/>
+
+    <link linkend="{$to}">
+      <xsl:if test="$highlight">
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$text"/>
+        </xsl:call-template>
+      </xsl:if>
+      <xsl:if test="not($highlight)">
+        <xsl:value-of select="string($text)"/>
+      </xsl:if>
+    </link>
+  </xsl:template>
+
+  <xsl:template name="anchor">
+    <xsl:param name="to"/>
+    <xsl:param name="text"/>
+    <xsl:param name="highlight" select="false()"/>
+
+    <anchor id="{$to}"/>
+    <xsl:if test="$highlight">
+      <xsl:call-template name="source-highlight">
+        <xsl:with-param name="text" select="$text"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:if test="not($highlight)">
+      <xsl:value-of select="$text"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="link-or-anchor">
+    <xsl:param name="to"/>
+    <xsl:param name="text"/>
+
+    <!-- True if we should create an anchor, otherwise we will create
+         a link. If you require more control (e.g., with the possibility of
+         having no link or anchor), set link-type instead: if present, it
+         takes precedence. -->
+    <xsl:param name="is-anchor"/>
+
+    <!-- 'anchor', 'link', or 'none' -->
+    <xsl:param name="link-type">
+      <xsl:choose>
+        <xsl:when test="$is-anchor">
+          <xsl:text>anchor</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>link</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:param>
+
+    <xsl:param name="highlight" select="false()"/>
+
+    <xsl:choose>
+      <xsl:when test="$link-type='anchor'">
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="to" select="$to"/>
+          <xsl:with-param name="text" select="$text"/>
+          <xsl:with-param name="highlight" select="$highlight"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$link-type='link'">
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to" select="$to"/>
+          <xsl:with-param name="text" select="$text"/>
+          <xsl:with-param name="highlight" select="$highlight"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$link-type='none'">
+        <xsl:if test="$highlight">
+          <xsl:call-template name="source-highlight">
+            <xsl:with-param name="text" select="$text"/>
+          </xsl:call-template>
+        </xsl:if>
+        <xsl:if test="not($highlight)">
+          <xsl:value-of select="$text"/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message>
+Error: XSL template 'link-or-anchor' called with invalid link-type '<xsl:value-of select="$link-type"/>'
+        </xsl:message>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="separator"/>
+
+  <xsl:template name="reference-documentation">
+    <xsl:param name="name"/>
+    <xsl:param name="refname"/>
+    <xsl:param name="purpose"/>
+    <xsl:param name="anchor"/>
+    <xsl:param name="synopsis"/>
+    <xsl:param name="text"/>
+
+    <refentry id="{$anchor}">
+      <refmeta>
+        <refentrytitle><xsl:value-of select="$name"/></refentrytitle>
+        <manvolnum>3</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname><xsl:value-of select="$refname"/></refname>
+        <refpurpose>
+                 <xsl:apply-templates mode="purpose" select="$purpose"/>
+               </refpurpose>
+      </refnamediv>
+      <refsynopsisdiv>
+        <synopsis>
+          <xsl:copy-of select="$synopsis"/>
+        </synopsis>
+      </refsynopsisdiv>
+      <xsl:if test="not(string($text)='')">
+        <refsect1>
+          <title>Description</title>
+          <xsl:copy-of select="$text"/>
+        </refsect1>
+      </xsl:if>
+    </refentry>
+  </xsl:template>
+
+  <xsl:template name="member-documentation">
+    <xsl:param name="name"/>
+    <xsl:param name="text"/>
+
+    <refsect2>
+      <title><xsl:copy-of select="$name"/></title>
+      <xsl:copy-of select="$text"/>
+    </refsect2>
+  </xsl:template>
+
+  <xsl:template name="preformatted">
+    <xsl:param name="text"/>
+
+    <literallayout class="monospaced">
+      <xsl:copy-of select="$text"/>
+    </literallayout>
+  </xsl:template>
+
+  <xsl:template name="synopsis">
+    <xsl:param name="text"/>
+
+    <synopsis>
+      <xsl:copy-of select="$text"/>
+    </synopsis>
+  </xsl:template>
+
+  <!-- Fallthrough for DocBook elements -->
+  <xsl:template match="*">
+    <xsl:element name="{name(.)}">
+      <xsl:for-each select="./@*">
+        <xsl:choose>
+          <xsl:when test="local-name(.)='last-revision'">
+            <xsl:attribute
+              name="rev:last-revision"
+ namespace="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision";>
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:attribute name="{name(.)}">
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="code">
+    <computeroutput>
+      <xsl:apply-templates mode="annotation"/>
+    </computeroutput>
+  </xsl:template>
+
+  <xsl:template match="bold">
+    <emphasis role="bold">
+      <xsl:apply-templates mode="annotation"/>
+    </emphasis>
+  </xsl:template>
+
+  <xsl:template match="library">
+    <xsl:if test="not(@html-only = 1) and
+                  ($boost.include.libraries='' or
+                   contains($boost.include.libraries, @id))">
+      <chapter>
+        <xsl:attribute name="id">
+          <xsl:choose>
+            <xsl:when test="@id">
+              <xsl:value-of select="@id"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:call-template name="generate.id"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:attribute>
+
+        <xsl:if test="@last-revision">
+          <xsl:attribute
+            name="rev:last-revision"
+ namespace="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision";>
+            <xsl:value-of select="@last-revision"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates/>
+      </chapter>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="chapter">
+    <xsl:if test="$boost.include.libraries=''">
+      <chapter>
+        <xsl:for-each select="./@*">
+          <xsl:attribute name="{name(.)}">
+            <xsl:value-of select="."/>
+          </xsl:attribute>
+        </xsl:for-each>
+
+        <xsl:apply-templates/>
+      </chapter>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="boostbook">
+    <book><xsl:apply-templates/></book>
+  </xsl:template>
+
+  <xsl:template match="programlisting">
+    <programlisting><xsl:apply-templates/></programlisting>
+  </xsl:template>
+
+ <!-- These DocBook elements have special meaning. Use the annotation mode -->
+  <xsl:template match="classname|methodname|functionname|enumname|
+                       macroname|headername|globalname">
+    <computeroutput>
+      <xsl:apply-templates select="." mode="annotation"/>
+    </computeroutput>
+  </xsl:template>
+
+  <xsl:template match="libraryname|conceptname">
+    <xsl:apply-templates select="." mode="annotation"/>
+  </xsl:template>
+
+  <xsl:template match="description">
+    <xsl:apply-templates mode="annotation"/>
+  </xsl:template>
+
+  <!-- Swallow using-namespace and using-class directives along with
+       last-revised elements -->
+  <xsl:template match="using-namespace|using-class|last-revised"/>
+
+  <!-- If there is no "namespace-reference" mode, forward to
+       "reference" mode -->
+  <xsl:template match="*" mode="namespace-reference">
+    <xsl:apply-templates select="." mode="reference"/>
+  </xsl:template>
+
+  <!-- Make the various blocks immediately below a "part" be
+       "chapter"-s. Must also take into account turning
+       chapters within chpaters into sections. -->
+  <xsl:template match="part/part|part/article">
+    <chapter>
+      <xsl:for-each select="./@*">
+        <xsl:attribute name="{name(.)}">
+          <xsl:value-of select="."/>
+        </xsl:attribute>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+    </chapter>
+  </xsl:template>
+  <xsl:template match="part/part/partinfo|part/article/articleinfo">
+    <chapterinfo><xsl:apply-templates/></chapterinfo>
+  </xsl:template>
+  <xsl:template match="part/part/chapter|part/part/appendix">
+    <section>
+      <xsl:for-each select="./@*">
+        <xsl:attribute name="{name(.)}">
+          <xsl:value-of select="."/>
+        </xsl:attribute>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+    </section>
+  </xsl:template>
+ <xsl:template match="part/part/chapter/chapterinfo| part/part/appendix/appendixinfo">
+    <sectioninfo><xsl:apply-templates/></sectioninfo>
+  </xsl:template>
+
+ <!-- Header link comment to be inserted at the start of a reference page's
+       synopsis -->
+  <xsl:template name="header-link">
+    <xsl:if test="ancestor::header">
+      <xsl:call-template name="highlight-comment">
+        <xsl:with-param name="text">
+          <xsl:text>// In header: &lt;</xsl:text>
+          <xsl:call-template name="internal-link">
+            <xsl:with-param name="to">
+              <xsl:call-template name="generate.id">
+                <xsl:with-param name="node" select="ancestor::header[1]"/>
+              </xsl:call-template>
+            </xsl:with-param>
+ <xsl:with-param name="text" select="ancestor::header[1]/@name" />
+          </xsl:call-template>
+          <xsl:text>&gt;&#10;&#10;</xsl:text>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>
+
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/doxygen/collect.xsl      Mon Feb  8 23:37:27 2010
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
+  <xsl:output method="xml" version="1.0" indent="yes" standalone="yes" />
+
+  <xsl:template match="/">
+    <doxygen>
+      <xsl:attribute name="version">
+        <xsl:choose>
+          <xsl:when test="doxygen">
+            <xsl:value-of select="doxygen/attribute::version"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="doxygenindex/attribute::version"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+
+      <!-- Load all doxgen generated xml files -->
+      <xsl:for-each select="doxygen/compound">
+        <xsl:variable name="id">
+          <xsl:choose>
+            <xsl:when test="@refid">
+              <xsl:value-of select="@refid"/>
+            </xsl:when>
+            <xsl:when test="@id">
+              <xsl:value-of select="@id"/>
+            </xsl:when>
+          </xsl:choose>
+        </xsl:variable>
+        <xsl:if test="$id">
+ <xsl:copy-of select="document( concat( $id, '.xml' ), / )/doxygen/*" />
+        </xsl:if>
+      </xsl:for-each>
+      <xsl:for-each select="doxygenindex/compound">
+        <xsl:variable name="id">
+          <xsl:choose>
+            <xsl:when test="@refid">
+              <xsl:value-of select="@refid"/>
+            </xsl:when>
+            <xsl:when test="@id">
+              <xsl:value-of select="@id"/>
+            </xsl:when>
+          </xsl:choose>
+        </xsl:variable>
+        <xsl:if test="$id">
+ <xsl:copy-of select="document( concat($id, '.xml'), /)/doxygen/*" />
+        </xsl:if>
+      </xsl:for-each>
+    </doxygen>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl Mon Feb 8 23:37:27 2010
@@ -0,0 +1,1535 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+  <xsl:import href="../lookup.xsl"/>
+
+  <!-- Set this parameter to a space-separated list of headers that
+       will be included in the output (all others are ignored). If this
+       parameter is omitted or left as the empty string, all headers will
+       be output. -->
+  <xsl:param name="boost.doxygen.headers" select="''"/>
+
+  <!-- The common prefix to all headers -->
+  <xsl:param name="boost.doxygen.header.prefix" select="'boost'"/>
+
+  <!-- The text that Doxygen places in overloaded functions. Damn them
+       for forcing us to compare TEXT just to figure out what's overloaded
+       and what isn't. -->
+  <xsl:param name="boost.doxygen.overload">
+ This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+  </xsl:param>
+
+  <!-- The namespace used to identify code that should not be
+       processed at all. -->
+  <xsl:param name="boost.doxygen.detailns">detail</xsl:param>
+
+  <!-- The substring used to identify unspecified types that we can't
+       mask from within Doxygen. This is a hack (big surprise). -->
+ <xsl:param name="boost.doxygen.detail"><xsl:value-of select="$boost.doxygen.detailns"/>::</xsl:param>
+
+ <!-- The title that will be used for the BoostBook library reference emitted.
+       If left blank, BoostBook will assign a default title. -->
+  <xsl:param name="boost.doxygen.reftitle" select="''"/>
+
+ <!-- The id used for the library-reference. By default, it is the normalized
+       form of the reftitle. -->
+  <xsl:param name="boost.doxygen.refid" select="''"/>
+
+ <!-- The directory into which png files corresponding to LaTeX formulas will be found. -->
+  <xsl:param name="boost.doxygen.formuladir" select="'images/'"/>
+
+  <xsl:output method="xml" indent="no" standalone="yes"/>
+
+  <xsl:key name="compounds-by-kind" match="compounddef" use="@kind"/>
+  <xsl:key name="compounds-by-id" match="compounddef" use="@id"/>
+  <xsl:key name="members-by-id" match="memberdef" use="@id" />
+
+ <xsl:strip-space elements="briefdescription detaileddescription inbodydescription"/>
+
+  <xsl:template name="kind-error-message">
+    <xsl:param name="message"/>
+
+    <xsl:variable name="location" select=".//location[1]" />
+    <xsl:variable name="name" select="./name" />
+
+    <xsl:message>
+      <xsl:if test="$location">
+ <xsl:value-of select="concat($location/@file, ':', $location/@line, ': ')" />
+      </xsl:if>
+      <xsl:value-of select="concat($message, ' with kind=', @kind)" />
+      <xsl:if test="$name">
+        <xsl:value-of select="concat(' (name=', $name, ') ')" />
+      </xsl:if>
+    </xsl:message>
+  </xsl:template>
+
+ <!-- translate-name: given a string, return a string suitable for use as a refid -->
+  <xsl:template name="translate-name">
+    <xsl:param name="name"/>
+    <xsl:value-of select="translate($name,
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ~!%^&amp;*()[].,&lt;&gt;|/ +-=',
+                                    
'abcdefghijklmnopqrstuvwxyz_____________________')"/>
+  </xsl:template>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="doxygen"/>
+  </xsl:template>
+
+  <xsl:template match="doxygen">
+    <library-reference>
+      <xsl:if test="string($boost.doxygen.reftitle) != ''">
+ <!-- when a reference section has a reftitle, also give it a refid. The id + is determined by the boost.doxygen.refid param, which defaults to a
+             normalized form of the boost.doxygen.reftitle -->
+        <xsl:attribute name="id">
+          <xsl:choose>
+            <xsl:when test="string($boost.doxygen.refid) != ''">
+              <xsl:value-of select="$boost.doxygen.refid"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:call-template name="translate-name">
+ <xsl:with-param name="name" select="$boost.doxygen.reftitle"/>
+              </xsl:call-template>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:attribute>
+
+        <title><xsl:copy-of select="$boost.doxygen.reftitle"/></title>
+      </xsl:if>
+      <xsl:apply-templates select="key('compounds-by-kind', 'file')"/>
+    </library-reference>
+  </xsl:template>
+
+  <xsl:template match="compounddef">
+    <!-- The set of innernamespace nodes that limits our search -->
+    <xsl:param name="with-namespace-refs"/>
+    <xsl:param name="in-file"/>
+
+    <xsl:choose>
+      <!-- If the string INTERNAL ONLY is in the description, don't
+           emit this entity. This hack is necessary because Doxygen doesn't
+           tell us what is \internal and what isn't. -->
+ <xsl:when test="contains(detaileddescription/para, 'INTERNAL ONLY')"/>
+      <xsl:when test="contains(briefdescription/para, 'INTERNAL ONLY')"/>
+      <xsl:when test="contains(inbodydescription/para, 'INTERNAL ONLY')"/>
+
+      <xsl:when test="@kind='file'">
+        <xsl:call-template name="file"/>
+      </xsl:when>
+      <xsl:when test="@kind='namespace'">
+        <xsl:call-template name="namespace">
+          <xsl:with-param name="with-namespace-refs"
+            select="$with-namespace-refs"/>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="@kind='class'">
+        <xsl:call-template name="class">
+          <xsl:with-param name="class-key" select="'class'"/>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="@kind='struct'">
+        <xsl:call-template name="class">
+          <xsl:with-param name="class-key" select="'struct'"/>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="@kind='union'">
+        <xsl:call-template name="class">
+          <xsl:with-param name="class-key" select="'union'"/>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="kind-error-message">
+ <xsl:with-param name="message" select="'Cannot handle compounddef'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="namespace">
+    <!-- The set of innernamespace nodes that limits our search -->
+    <xsl:param name="with-namespace-refs"/>
+    <xsl:param name="in-file"/>
+
+    <xsl:variable name="fullname" select="string(compoundname)"/>
+
+    <xsl:if test="$with-namespace-refs[string(text())=$fullname]
+                  and not(contains($fullname, $boost.doxygen.detailns))">
+      <!-- Namespace without the prefix -->
+      <xsl:variable name="rest">
+        <xsl:call-template name="strip-qualifiers">
+          <xsl:with-param name="name" select="compoundname"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+ <!-- Grab only the namespace name, not any further nested namespaces -->
+      <xsl:variable name="name">
+        <xsl:choose>
+          <xsl:when
+            test="contains($rest, '::')">
+            <xsl:value-of select="substring-before($rest, '::')"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$rest"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <namespace>
+        <xsl:attribute name="name">
+          <xsl:value-of select="$name"/>
+        </xsl:attribute>
+
+        <xsl:apply-templates>
+          <xsl:with-param name="with-namespace-refs"
+            select="$with-namespace-refs"/>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:apply-templates>
+      </namespace>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="class">
+    <xsl:param name="class-key"/>
+    <xsl:param name="in-file"/>
+    <xsl:param name="with-namespace-refs"/>
+
+    <xsl:if test="contains(string(location/attribute::file),
+                           concat('/', $in-file)) ">
+
+      <!-- The short name of this class -->
+      <xsl:variable name="name-with-spec">
+        <xsl:call-template name="strip-qualifiers">
+          <xsl:with-param name="name" select="compoundname"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="name">
+        <xsl:choose>
+          <xsl:when test="contains($name-with-spec, '&lt;')">
+ <xsl:value-of select="substring-before($name-with-spec, '&lt;')"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$name-with-spec"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="specialization">
+        <xsl:if test="contains($name-with-spec, '&lt;')">
+          <xsl:variable name="spec-with-gt"
+            select="substring-after($name-with-spec, '&lt;')"/>
+          <xsl:value-of select="substring($spec-with-gt, 1,
+ string-length($spec-with-gt)-1)"/>
+        </xsl:if>
+      </xsl:variable>
+
+      <xsl:variable name="actual-class-key">
+        <xsl:value-of select="$class-key"/>
+        <xsl:if test="string-length($specialization) &gt; 0">
+          <xsl:text>-specialization</xsl:text>
+        </xsl:if>
+      </xsl:variable>
+
+      <xsl:element name="{$actual-class-key}">
+        <xsl:attribute name="name">
+          <xsl:value-of select="$name"/>
+        </xsl:attribute>
+
+        <xsl:apply-templates select="templateparamlist" mode="template"/>
+
+        <xsl:if test="string-length($specialization) &gt; 0">
+          <specialization>
+            <xsl:call-template name="specialization">
+ <xsl:with-param name="specialization" select="$specialization"/>
+            </xsl:call-template>
+          </specialization>
+        </xsl:if>
+
+        <xsl:apply-templates select="basecompoundref" mode="inherit"/>
+
+        <xsl:apply-templates select="briefdescription" mode="passthrough"/>
+ <xsl:apply-templates select="detaileddescription" mode="passthrough"/> + <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
+        <xsl:apply-templates/>
+      </xsl:element>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="enum">
+    <xsl:param name="in-file"/>
+
+    <xsl:if test="contains(string(location/attribute::file),
+                           concat('/', $in-file))">
+      <xsl:variable name="name">
+        <xsl:call-template name="strip-qualifiers">
+          <xsl:with-param name="name" select="name"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <enum>
+        <xsl:attribute name="name">
+          <xsl:value-of select="$name"/>
+        </xsl:attribute>
+
+        <xsl:apply-templates select="enumvalue"/>
+
+        <xsl:apply-templates select="briefdescription" mode="passthrough"/>
+ <xsl:apply-templates select="detaileddescription" mode="passthrough"/> + <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
+      </enum>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="enumvalue">
+    <xsl:choose>
+      <!-- If the string INTERNAL ONLY is in the description, don't
+           emit this entity. This hack is necessary because Doxygen doesn't
+           tell us what is \internal and what isn't. -->
+ <xsl:when test="contains(detaileddescription/para, 'INTERNAL ONLY')"/>
+      <xsl:when test="contains(briefdescription/para, 'INTERNAL ONLY')"/>
+      <xsl:when test="contains(inbodydescription/para, 'INTERNAL ONLY')"/>
+      <xsl:otherwise>
+
+        <enumvalue>
+          <xsl:attribute name="name">
+            <xsl:value-of select="name"/>
+          </xsl:attribute>
+
+          <xsl:if test="initializer">
+            <default>
+ <xsl:apply-templates select="initializer/*| initializer/text()" mode="passthrough"/>
+            </default>
+          </xsl:if>
+
+ <xsl:apply-templates select="briefdescription" mode="passthrough"/> + <xsl:apply-templates select="detaileddescription" mode="passthrough"/> + <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
+        </enumvalue>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="doxygen.include.header.rec">
+    <xsl:param name="name"/>
+    <xsl:param name="header-list" select="$boost.doxygen.headers"/>
+
+    <xsl:choose>
+      <xsl:when test="contains($header-list, ' ')">
+        <xsl:variable name="header"
+          select="substring-before($header-list, ' ')"/>
+ <xsl:variable name="rest" select="substring-after($header-list, ' ')"/>
+
+        <xsl:choose>
+          <xsl:when test="$name=$header">
+            <xsl:text>yes</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="doxygen.include.header.rec">
+              <xsl:with-param name="name" select="$name"/>
+              <xsl:with-param name="header-list" select="$rest"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name=$header-list">
+        <xsl:text>yes</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="doxygen.include.header">
+    <xsl:param name="name"/>
+
+    <xsl:if test="$boost.doxygen.headers=''">
+      <xsl:text>yes</xsl:text>
+    </xsl:if>
+    <xsl:if test="not($boost.doxygen.headers='')">
+      <xsl:call-template name="doxygen.include.header.rec">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="file">
+    <xsl:variable name="include-header">
+      <xsl:call-template name="doxygen.include.header">
+        <xsl:with-param name="name" select="string(compoundname)"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:if test="$include-header='yes'">
+      <header>
+        <xsl:attribute name="name">
+          <xsl:call-template name="shorten.header.name">
+ <xsl:with-param name="header" select="location/attribute::file"/>
+          </xsl:call-template>
+        </xsl:attribute>
+
+ <xsl:if test="briefdescription/*|detaileddescription/*| inbodydescription/*"> + <xsl:apply-templates select="briefdescription/*" mode="passthrough"/> + <xsl:apply-templates select="detaileddescription/*" mode="passthrough"/> + <xsl:apply-templates select="inbdoydescription/*" mode="passthrough"/>
+        </xsl:if>
+
+        <xsl:apply-templates mode="toplevel">
+          <xsl:with-param name="with-namespace-refs"
+            select="innernamespace"/>
+          <xsl:with-param name="in-file" select="string(compoundname)"/>
+        </xsl:apply-templates>
+      </header>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="shorten.header.name">
+    <xsl:param name="header"/>
+
+    <xsl:variable name="prefix">
+      <xsl:value-of select="concat($boost.doxygen.header.prefix, '/')"/>
+    </xsl:variable>
+
+    <xsl:choose>
+      <xsl:when test="contains($header, $prefix)">
+ <xsl:variable name="rest" select="substring-after($header, $prefix)"/>
+        <xsl:choose>
+          <xsl:when test="contains($rest, $prefix)">
+            <xsl:call-template name="shorten.header.name">
+              <xsl:with-param name="header" select="$rest"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$prefix"/>
+            <xsl:value-of select="$rest"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$header"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+
+  <xsl:template match="innernamespace">
+    <xsl:param name="with-namespace-refs"/>
+    <xsl:param name="in-file"/>
+
+    <xsl:apply-templates select="key('compounds-by-id', @refid)">
+      <xsl:with-param name="with-namespace-refs"
+        select="$with-namespace-refs"/>
+      <xsl:with-param name="in-file" select="$in-file"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="innernamespace" mode="toplevel">
+    <!-- The set of innernamespace nodes that limits our search -->
+    <xsl:param name="with-namespace-refs"/>
+    <xsl:param name="in-file"/>
+
+    <!-- The full name of the namespace we are referring to -->
+    <xsl:variable name="fullname"
+      select="string(key('compounds-by-id', @refid)/compoundname)"/>
+
+    <!-- Only pass on top-level namespaces -->
+    <xsl:if test="not(contains($fullname, '::'))">
+      <xsl:apply-templates select="key('compounds-by-id', @refid)">
+        <xsl:with-param name="with-namespace-refs"
+          select="$with-namespace-refs"/>
+        <xsl:with-param name="in-file" select="$in-file"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="sectiondef" mode="toplevel">
+    <xsl:param name="in-file" select="''"/>
+
+    <xsl:apply-templates mode="toplevel"
+                         select="memberdef[generate-id() =
+                                 generate-id(key('members-by-id', @id))]">
+      <xsl:with-param name="in-file" select="$in-file"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="memberdef" mode="toplevel">
+    <xsl:param name="with-namespace-refs"/>
+    <xsl:param name="in-file"/>
+
+    <xsl:choose>
+      <!-- If the string INTERNAL ONLY is in the description, don't
+           emit this entity. This hack is necessary because Doxygen doesn't
+           tell us what is \internal and what isn't. -->
+ <xsl:when test="contains(detaileddescription/para, 'INTERNAL ONLY')"/>
+      <xsl:when test="contains(briefdescription/para, 'INTERNAL ONLY')"/>
+      <xsl:when test="contains(inbodydescription/para, 'INTERNAL ONLY')"/>
+
+      <xsl:when test="@kind='define'">
+        <macro>
+          <xsl:attribute name="name">
+            <xsl:value-of select="name/text()"/>
+          </xsl:attribute>
+
+          <xsl:if test="param">
+            <xsl:attribute name="kind">
+              <xsl:value-of select="'functionlike'"/>
+            </xsl:attribute>
+          </xsl:if>
+
+          <xsl:for-each select="param">
+            <macro-parameter>
+              <xsl:attribute name="name">
+                <xsl:value-of select="defname/text()"/>
+              </xsl:attribute>
+            </macro-parameter>
+          </xsl:for-each>
+
+ <xsl:apply-templates select="briefdescription" mode="passthrough"/> + <xsl:apply-templates select="detaileddescription" mode="passthrough"/> + <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
+        </macro>
+      </xsl:when>
+
+      <xsl:when test="@kind='function'">
+        <xsl:call-template name="function" />
+      </xsl:when>
+
+      <xsl:when test="@kind='typedef'">
+        <xsl:call-template name="typedef" />
+      </xsl:when>
+
+      <xsl:when test="@kind='variable'">
+        <xsl:call-template name="variable" />
+      </xsl:when>
+
+      <xsl:when test="@kind='enum'">
+        <xsl:call-template name="enum" />
+      </xsl:when>
+
+      <xsl:otherwise>
+        <xsl:call-template name="kind-error-message">
+ <xsl:with-param name="message" select="'Cannot handle toplevel memberdef element'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="innerclass" mode="toplevel">
+    <xsl:param name="with-namespace-refs"/>
+    <xsl:param name="in-file"/>
+
+    <xsl:variable name="name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="."/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <!-- Only process this if it is indeed global -->
+    <xsl:if test=".=$name">
+      <xsl:apply-templates select="key('compounds-by-id', @refid)">
+        <xsl:with-param name="with-namespace-refs"
+          select="$with-namespace-refs"/>
+        <xsl:with-param name="in-file" select="$in-file"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="innerclass">
+    <xsl:param name="with-namespace-refs"/>
+    <xsl:param name="in-file"/>
+
+    <xsl:apply-templates select="key('compounds-by-id', @refid)">
+      <xsl:with-param name="with-namespace-refs"
+        select="$with-namespace-refs"/>
+      <xsl:with-param name="in-file" select="$in-file"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Classes -->
+  <xsl:template match="templateparamlist" mode="template">
+    <template>
+      <xsl:apply-templates mode="template"/>
+    </template>
+  </xsl:template>
+
+  <xsl:template match="param" mode="template">
+    <xsl:choose>
+      <xsl:when test="string(type)='class' or string(type)='typename'">
+        <template-type-parameter>
+          <xsl:attribute name="name">
+            <xsl:value-of select="normalize-space(string(declname))"/>
+          </xsl:attribute>
+          <xsl:if test="defval">
+            <default>
+              <xsl:apply-templates select="defval/*|defval/text()"
+                mode="passthrough"/>
+            </default>
+          </xsl:if>
+        </template-type-parameter>
+      </xsl:when>
+      <!-- Doxygen 1.5.8 generates odd xml for template type parameters.
+           This deals with that -->
+      <xsl:when test="not(declname) and
+ (starts-with(string(type), 'class ') or starts-with(string(type), 'typename '))">
+        <template-type-parameter>
+          <xsl:attribute name="name">
+ <xsl:value-of select="normalize-space(substring-after(string(type), ' '))"/>
+          </xsl:attribute>
+          <xsl:if test="defval">
+            <default>
+              <xsl:apply-templates select="defval/*|defval/text()"
+                mode="passthrough"/>
+            </default>
+          </xsl:if>
+        </template-type-parameter>
+      </xsl:when>
+      <xsl:otherwise>
+        <template-nontype-parameter>
+          <xsl:attribute name="name">
+            <xsl:value-of select="normalize-space(string(declname))"/>
+          </xsl:attribute>
+          <type>
+            <xsl:apply-templates select="type"/>
+          </type>
+          <xsl:if test="defval">
+            <default>
+              <xsl:apply-templates select="defval/*|defval/text()"
+                mode="passthrough"/>
+            </default>
+          </xsl:if>
+        </template-nontype-parameter>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="templateparamlist"/>
+
+  <!-- "Parse" a specialization from part of a name -->
+  <xsl:template name="specialization">
+    <xsl:param name="specialization"/>
+
+    <xsl:choose>
+      <xsl:when test="contains($specialization, ',')">
+        <template-arg>
+          <xsl:value-of
+ select="normalize-space(substring-before($specialization, ','))"/>
+        </template-arg>
+        <xsl:call-template name="specialization">
+          <xsl:with-param name="specialization"
+            select="substring-after($specialization, ',')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <template-arg>
+          <xsl:value-of select="normalize-space($specialization)"/>
+        </template-arg>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Inheritance -->
+  <xsl:template match="basecompoundref" mode="inherit">
+    <xsl:choose>
+      <xsl:when test="contains(string(.), $boost.doxygen.detail)"/>
+      <xsl:otherwise>
+        <inherit>
+          <!-- Access specifier for inheritance -->
+          <xsl:attribute name="access">
+            <xsl:value-of select="@prot"/>
+          </xsl:attribute>
+          <!-- TBD: virtual vs. non-virtual inheritance -->
+
+          <xsl:apply-templates mode="passthrough"/>
+        </inherit>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="basecompoundref"/>
+
+  <!-- Skip over sections: they aren't very useful at all -->
+  <xsl:template match="sectiondef">
+    <xsl:param name="in-file" select="''"/>
+
+    <xsl:choose>
+      <xsl:when test="@kind='public-static-func'">
+        <!-- TBD: pass on the fact that these are static functions -->
+        <method-group name="public static functions">
+          <xsl:apply-templates>
+            <xsl:with-param name="in-section" select="true()"/>
+          </xsl:apply-templates>
+        </method-group>
+      </xsl:when>
+      <xsl:when test="@kind='protected-static-func'">
+        <!-- TBD: pass on the fact that these are static functions -->
+        <method-group name="protected static functions">
+          <xsl:apply-templates>
+            <xsl:with-param name="in-section" select="true()"/>
+          </xsl:apply-templates>
+        </method-group>
+      </xsl:when>
+      <xsl:when test="@kind='private-static-func'">
+        <!-- TBD: pass on the fact that these are static functions -->
+        <method-group name="private static functions">
+          <xsl:apply-templates>
+            <xsl:with-param name="in-section" select="true()"/>
+          </xsl:apply-templates>
+        </method-group>
+      </xsl:when>
+      <xsl:when test="@kind='public-func'">
+        <xsl:variable name="members" select="./memberdef"/>
+        <xsl:variable name="num-internal-only">
+          <xsl:value-of
+            select="count($members[contains(detaileddescription/para,
+                                  'INTERNAL ONLY')])"/>
+        </xsl:variable>
+        <xsl:if test="$num-internal-only &lt; count($members)">
+          <method-group name="public member functions">
+            <xsl:apply-templates>
+              <xsl:with-param name="in-section" select="true()"/>
+            </xsl:apply-templates>
+          </method-group>
+          <xsl:apply-templates/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:when test="@kind='protected-func'">
+        <method-group name="protected member functions">
+          <xsl:apply-templates>
+            <xsl:with-param name="in-section" select="true()"/>
+          </xsl:apply-templates>
+        </method-group>
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="@kind='private-func'">
+        <xsl:variable name="members" select="./memberdef"/>
+        <xsl:variable name="num-internal-only">
+          <xsl:value-of
+            select="count($members[contains(detaileddescription/para,
+                                  'INTERNAL ONLY')])"/>
+        </xsl:variable>
+        <xsl:if test="$num-internal-only &lt; count($members)">
+          <method-group name="private member functions">
+            <xsl:apply-templates>
+              <xsl:with-param name="in-section" select="true()"/>
+            </xsl:apply-templates>
+          </method-group>
+        </xsl:if>
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="@kind='friend'">
+ <xsl:if test="./memberdef/detaileddescription/para or ./memberdef/briefdescription/para">
+          <method-group name="friend functions">
+            <xsl:apply-templates>
+              <xsl:with-param name="in-section" select="true()"/>
+            </xsl:apply-templates>
+          </method-group>
+        </xsl:if>
+      </xsl:when>
+ <xsl:when test="@kind='public-static-attrib' or @kind='public-attrib'">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="@kind='public-type'">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="@kind='private-type'">
+        <!--skip private members-->
+      </xsl:when>
+ <xsl:when test="@kind='private-static-attrib' or @kind='private-attrib'">
+        <!--skip private members-->
+      </xsl:when>
+      <xsl:when test="@kind='func'">
+        <xsl:apply-templates>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:when test="@kind='typedef'">
+        <xsl:apply-templates>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:when test="@kind='var'">
+        <xsl:apply-templates>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:when test="@kind='enum'">
+        <xsl:apply-templates>
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:when test="@kind='user-defined'">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="@kind=''">
+        <xsl:apply-templates select="memberdef[generate-id() =
+ generate-id(key('members-by-id', @id))]">
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="kind-error-message">
+ <xsl:with-param name="message" select="'Cannot handle sectiondef'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Handle member definitions -->
+  <xsl:template match="memberdef">
+    <!-- True when we're inside a section -->
+    <xsl:param name="in-section" select="false()"/>
+    <xsl:param name="in-file" select="''"/>
+
+    <xsl:choose>
+      <!-- If the string INTERNAL ONLY is in the description, don't
+           emit this entity. This hack is necessary because Doxygen doesn't
+           tell us what is \internal and what isn't. -->
+ <xsl:when test="contains(detaileddescription/para, 'INTERNAL ONLY')"/>
+      <xsl:when test="contains(briefdescription/para, 'INTERNAL ONLY')"/>
+      <xsl:when test="contains(inbodydescription/para, 'INTERNAL ONLY')"/>
+
+      <xsl:when test="@kind='typedef'">
+        <xsl:call-template name="typedef">
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="@kind='function'">
+        <xsl:choose>
+ <xsl:when test="ancestor::compounddef/attribute::kind='namespace'">
+            <xsl:call-template name="function">
+              <xsl:with-param name="in-file" select="$in-file"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <!-- We are in a class -->
+            <!-- The name of the class we are in -->
+            <xsl:variable name="in-class">
+              <xsl:call-template name="strip-qualifiers">
+                <xsl:with-param name="name"
+ select="string(ancestor::compounddef/compoundname/text())"/>
+              </xsl:call-template>
+            </xsl:variable>
+
+            <xsl:choose>
+              <xsl:when test="string(name/text())=$in-class">
+                <xsl:if test="not ($in-section)">
+                  <xsl:call-template name="constructor"/>
+                </xsl:if>
+              </xsl:when>
+              <xsl:when test="string(name/text())=concat('~',$in-class)">
+                <xsl:if test="not ($in-section)">
+                  <xsl:call-template name="destructor"/>
+                </xsl:if>
+              </xsl:when>
+              <xsl:when test="string(name/text())='operator='">
+                <xsl:if test="not ($in-section)">
+                  <xsl:call-template name="copy-assignment"/>
+                </xsl:if>
+              </xsl:when>
+              <xsl:when test="normalize-space(string(type))=''
+                              and contains(name/text(), 'operator ')">
+                <xsl:if test="$in-section">
+                  <xsl:call-template name="conversion-operator"/>
+                </xsl:if>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:if test="$in-section">
+                  <xsl:call-template name="method"/>
+                </xsl:if>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:when test="@kind='friend'">
+ <xsl:if test="./detaileddescription/para or ./briefdescription/para">
+          <xsl:call-template name="method"/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:when test="@kind='enum'">
+        <xsl:call-template name="enum">
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="@kind='variable'">
+        <xsl:call-template name="variable">
+          <xsl:with-param name="in-file" select="$in-file"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="kind-error-message">
+ <xsl:with-param name="message" select="'Cannot handle memberdef element'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Display typedefs -->
+  <xsl:template name="typedef">
+    <xsl:param name="in-file" select="''"/>
+
+    <xsl:if test="contains(string(location/attribute::file),
+                           concat('/', $in-file))">
+      <!-- TBD: Handle public/protected/private -->
+      <typedef>
+        <!-- Name of the type -->
+        <xsl:attribute name="name">
+          <xsl:value-of select="name/text()"/>
+        </xsl:attribute>
+
+        <xsl:apply-templates select="briefdescription" mode="passthrough"/>
+ <xsl:apply-templates select="detaileddescription" mode="passthrough"/> + <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
+
+        <type><xsl:apply-templates select="type"/></type>
+      </typedef>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Handle function parameters -->
+  <xsl:template match="param" mode="function">
+    <parameter>
+      <!-- Parameter name -->
+      <xsl:attribute name="name">
+        <xsl:value-of select="normalize-space(declname/text())"/>
+      </xsl:attribute>
+
+      <!-- Parameter type -->
+      <paramtype><xsl:apply-templates select="type"/></paramtype>
+
+      <!-- Default argument -->
+      <xsl:if test="defval">
+        <default>
+          <xsl:choose>
+ <xsl:when test="contains(string(defval), $boost.doxygen.detail)">
+              <emphasis>unspecified</emphasis>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="defval/*|defval/text()"
+                mode="passthrough"/>
+            </xsl:otherwise>
+          </xsl:choose>
+
+        </default>
+      </xsl:if>
+
+      <!-- Parameter description -->
+      <xsl:variable name="name">
+        <xsl:value-of select="normalize-space(declname/text())"/>
+      </xsl:variable>
+
+ <xsl:apply-templates select="../*[self::detaileddescription or self::inbodydescription]//parameterlist[attribute::kind='param']/*"
+        mode="parameter.description">
+        <xsl:with-param name="name">
+          <xsl:value-of select="$name"/>
+        </xsl:with-param>
+      </xsl:apply-templates>
+    </parameter>
+  </xsl:template>
+
+  <xsl:template match="parameteritem" mode="parameter.description">
+    <!-- The parameter name we are looking for -->
+    <xsl:param name="name"/>
+
+    <xsl:if test="string(parameternamelist/parametername) = $name">
+      <description>
+ <xsl:apply-templates select="parameterdescription/para" mode="passthrough"/>
+      </description>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- For older versions of Doxygen, which didn't use parameteritem -->
+  <xsl:template match="parameterdescription" mode="parameter.description">
+    <!-- The parameter name we are looking for -->
+    <xsl:param name="name"/>
+
+    <!-- The parametername node associated with this description -->
+    <xsl:variable name="name-node" select="preceding-sibling::*[1]"/>
+
+    <xsl:if test="string($name-node/text()) = $name">
+      <description>
+        <xsl:apply-templates select="para" mode="passthrough"/>
+      </description>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Handle function children -->
+  <xsl:template name="function.children">
+    <xsl:param name="is-overloaded" select="false()"/>
+
+    <xsl:if test="not($is-overloaded)">
+      <!-- Emit template header -->
+      <xsl:apply-templates select="templateparamlist" mode="template"/>
+
+      <!-- Emit function parameters -->
+      <xsl:apply-templates select="param" mode="function"/>
+    </xsl:if>
+
+    <!-- The description -->
+    <xsl:apply-templates select="briefdescription" mode="passthrough"/>
+    <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
+    <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
+
+    <xsl:apply-templates
+ select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='pre']"
+      mode="function-clauses"/>
+    <xsl:apply-templates
+ select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='post']"
+      mode="function-clauses"/>
+    <xsl:apply-templates
+ select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='return']"
+      mode="function-clauses"/>
+ <xsl:if test="*[self::detaileddescription or self::inbodydescription]/para/parameterlist[@kind='exception']">
+      <throws>
+        <xsl:apply-templates
+ select="*[self::detaileddescription or self::inbodydescription]/para/parameterlist[@kind='exception']"
+          mode="function-clauses"/>
+      </throws>
+    </xsl:if>
+ <xsl:variable name="notes" select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='note' or @kind='attention']"/>
+    <xsl:if test="count($notes) &gt; 0">
+      <notes>
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/dtd/dtd2boostbook.xsl Mon Feb 8 23:37:27 2010
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+
+  <xsl:output method="xml" indent="yes" standalone="yes"/>
+
+ <xsl:strip-space elements="sequence-group or-group element element-name"/>
+
+  <xsl:key name="elements" match="element" use="@name"/>
+  <xsl:key name="attributes" match="attlist" use="@name"/>
+  <xsl:key name="attribute-purposes" match="attpurpose" use="@name"/>
+
+  <xsl:template match="dtd">
+    <section id="reference">
+      <title>Reference</title>
+      <para>
+        <xsl:text>Elements:</xsl:text>
+        <itemizedlist spacing="compact">
+          <xsl:apply-templates select="element" mode="synopsis">
+            <xsl:sort select="@name"/>
+          </xsl:apply-templates>
+        </itemizedlist>
+      </para>
+      <xsl:apply-templates select="element"/>
+    </section>
+  </xsl:template>
+
+  <!-- Element synopsis -->
+  <xsl:template match="element" mode="synopsis">
+    <listitem>
+      <simpara>
+        <link>
+          <xsl:attribute name="linkend">
+            <xsl:value-of select="concat('boostbook.dtd.',@name)"/>
+          </xsl:attribute>
+          <xsl:text>Element </xsl:text>
+          <sgmltag><xsl:value-of select="@name"/></sgmltag>
+          <xsl:text> - </xsl:text>
+          <xsl:apply-templates select="purpose"/>
+        </link>
+      </simpara>
+    </listitem>
+  </xsl:template>
+
+  <!-- Elements are transformed into DocBook refentry elements -->
+  <xsl:template match="element">
+    <refentry>
+      <xsl:attribute name="id">
+        <xsl:value-of select="concat('boostbook.dtd.',@name)"/>
+      </xsl:attribute>
+
+      <refmeta>
+        <refentrytitle>
+ BoostBook element <sgmltag><xsl:value-of select="@name"/></sgmltag>
+        </refentrytitle>
+        <manvolnum>9</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname><xsl:value-of select="@name"/></refname>
+        <refpurpose><xsl:apply-templates select="purpose"/></refpurpose>
+      </refnamediv>
+      <refsynopsisdiv>
+        <xsl:value-of select="@name"/><xsl:text> ::= </xsl:text>
+        <xsl:apply-templates select="content-model-expanded"/>
+      </refsynopsisdiv>
+      <xsl:apply-templates select="description"/>
+      <xsl:apply-templates select="key('attributes', @name)"/>
+    </refentry>
+  </xsl:template>
+
+  <xsl:template match="content-model-expanded">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- Sequences -->
+  <xsl:template match="sequence-group">
+    <xsl:param name="separator" select="''"/>
+
+    <xsl:if test="preceding-sibling::*">
+      <xsl:value-of select="$separator"/>
+    </xsl:if>
+    <xsl:text>(</xsl:text>
+    <xsl:apply-templates>
+      <xsl:with-param name="separator" select="', '"/>
+    </xsl:apply-templates>
+    <xsl:text>)</xsl:text>
+    <xsl:value-of select="@occurrence"/>
+  </xsl:template>
+
+  <!-- Alternatives -->
+  <xsl:template match="or-group">
+    <xsl:param name="separator" select="''"/>
+
+    <xsl:if test="preceding-sibling::*">
+      <xsl:value-of select="$separator"/>
+    </xsl:if>
+    <xsl:text>(</xsl:text>
+    <xsl:apply-templates>
+      <xsl:with-param name="separator" select="'| '"/>
+    </xsl:apply-templates>
+    <xsl:text>)</xsl:text>
+    <xsl:value-of select="@occurrence"/>
+  </xsl:template>
+
+  <!-- Element references -->
+  <xsl:template match="element-name">
+    <xsl:param name="separator" select="''"/>
+
+    <xsl:if test="preceding-sibling::*">
+      <xsl:value-of select="$separator"/>
+    </xsl:if>
+
+    <xsl:variable name="element-node" select="key('elements', @name)"/>
+
+    <xsl:choose>
+      <xsl:when test="$element-node">
+        <link>
+          <xsl:attribute name="linkend">
+            <xsl:value-of select="concat('boostbook.dtd.',@name)"/>
+          </xsl:attribute>
+          <xsl:value-of select="@name"/>
+        </link>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@name"/>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:value-of select="@occurrence"/>
+  </xsl:template>
+
+  <!-- #PCDATA -->
+  <xsl:template match="pcdata">
+    <xsl:param name="separator" select="''"/>
+
+    <xsl:if test="preceding-sibling::*">
+      <xsl:value-of select="$separator"/>
+    </xsl:if>
+
+    <xsl:text>#PCDATA</xsl:text>
+  </xsl:template>
+
+  <!-- ANY -->
+  <xsl:template match="any">
+    <xsl:text>ANY</xsl:text>
+  </xsl:template>
+
+  <!-- EMPTY -->
+  <xsl:template match="empty">
+    <xsl:text>EMPTY</xsl:text>
+  </xsl:template>
+
+  <!-- Just copy anything in a purpose element -->
+  <xsl:template match="purpose">
+    <xsl:copy-of select="text()|*"/>
+  </xsl:template>
+
+  <!-- Just copy anything in a description element, but place it in a
+       section. -->
+  <xsl:template match="description">
+    <refsection>
+      <title>Description</title>
+      <xsl:copy-of select="text()|*"/>
+    </refsection>
+  </xsl:template>
+
+  <!-- Attributes -->
+  <xsl:template match="attlist">
+    <refsection>
+      <title>Attributes</title>
+
+      <informaltable>
+        <tgroup cols="4">
+          <thead>
+            <row>
+              <entry>Name</entry>
+              <entry>Type</entry>
+              <entry>Value</entry>
+              <entry>Purpose</entry>
+            </row>
+          </thead>
+          <tbody>
+            <xsl:apply-templates/>
+          </tbody>
+        </tgroup>
+      </informaltable>
+    </refsection>
+  </xsl:template>
+
+  <!-- Attribute -->
+  <xsl:template match="attribute">
+    <row>
+      <entry><xsl:value-of select="@name"/></entry>
+      <entry><xsl:value-of select="@type"/></entry>
+      <entry><xsl:value-of select="@value"/></entry>
+      <entry>
+        <xsl:choose>
+          <xsl:when test="purpose">
+            <xsl:apply-templates select="purpose"/>
+          </xsl:when>
+          <xsl:otherwise>
+ <xsl:apply-templates select="key('attribute-purposes', @name)"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </entry>
+    </row>
+  </xsl:template>
+
+  <!-- Eat attribute declarations -->
+  <xsl:template match="attdecl"/>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/error.xsl        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+  <xsl:template name="print.warning.context">
+    <xsl:message>
+      <xsl:text>  In </xsl:text>
+      <xsl:call-template name="fully-qualified-name">
+        <xsl:with-param name="node" select="."/>
+      </xsl:call-template>
+    </xsl:message>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/fo.xsl   Mon Feb  8 23:37:27 2010
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2003 Douglas Gregor -->
+<!-- Distributed under the Boost Software License, Version 1.0. -->
+<!-- (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns:fo="http://www.w3.org/1999/XSL/Format";
+                version="1.0">
+
+  <!-- Import the FO stylesheet -->
+  <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
+
+  <xsl:param name="chapter.autolabel" select="0"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="fop1.extensions" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+  <xsl:param name="ulink.show" select="0"/>
+
+  <!-- The question and answer templates are copied here from the
+       1.61.3 DocBook XSL stylesheets so that we can eliminate the emission
+       of id attributes in the emitted fo:list-item-label elements. FOP
+       0.20.5 has problems with these id attributes, and they are otherwise
+       unused. -->
+<xsl:template match="question">
+ <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="entry.id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="parent::*"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="deflabel">
+    <xsl:choose>
+      <xsl:when test="ancestor-or-self::*[@defaultlabel]">
+        <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
+                              /@defaultlabel"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$qanda.defaultlabel"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+ <fo:list-item id="{$entry.id}" xsl:use-attribute-sets="list.item.spacing">
+    <fo:list-item-label end-indent="label-end()">
+      <xsl:choose>
+        <xsl:when test="$deflabel = 'none'">
+          <fo:block/>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block>
+            <xsl:apply-templates select="." mode="label.markup"/>
+ <xsl:text>.</xsl:text> <!-- FIXME: Hack!!! This should be in the locale! -->
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:choose>
+        <xsl:when test="$deflabel = 'none'">
+          <fo:block font-weight="bold">
+            <xsl:apply-templates select="*[local-name(.)!='label']"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="*[local-name(.)!='label']"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<xsl:template match="answer">
+ <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+  <xsl:variable name="entry.id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="parent::*"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="deflabel">
+    <xsl:choose>
+      <xsl:when test="ancestor-or-self::*[@defaultlabel]">
+        <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
+                              /@defaultlabel"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$qanda.defaultlabel"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:list-item xsl:use-attribute-sets="list.item.spacing">
+    <fo:list-item-label end-indent="label-end()">
+      <xsl:choose>
+        <xsl:when test="$deflabel = 'none'">
+          <fo:block/>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block>
+            <!-- FIXME: Hack!!! This should be in the locale! -->
+            <xsl:variable name="answer.label">
+              <xsl:apply-templates select="." mode="label.markup"/>
+            </xsl:variable>
+            <xsl:copy-of select="$answer.label"/>
+            <xsl:if test="string($answer.label) != ''">
+              <xsl:text>.</xsl:text>
+            </xsl:if>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:apply-templates select="*[local-name(.)!='label']"/>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<!--
+
+ The following rules apply syntax highlighting to phrases
+ that have been appropriately marked up, the highlighting
+ used is the same as that used by our CSS style sheets,
+ but potentially we have the option to do better here
+ since we can add bold and italic formatting quite easily
+
+ -->
+
+<xsl:template match="//programlisting/phrase[@role='keyword']">
+  <fo:inline color="#0000AA"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='special']">
+  <fo:inline color="#707070"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='preprocessor']">
+  <fo:inline color="#402080"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='char']">
+  <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='comment']">
+  <fo:inline color="#800000"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='string']">
+  <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='number']">
+  <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='white_bkd']">
+  <fo:inline color="#FFFFFF"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='dk_grey_bkd']">
+  <fo:inline color="#999999"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<!--
+Make all hyperlinks blue colored:
+-->
+<xsl:attribute-set name="xref.properties">
+  <xsl:attribute name="color">blue</xsl:attribute>
+</xsl:attribute-set>
+
+<!--
+Put a box around admonishments and keep them together:
+-->
+<xsl:attribute-set name="graphical.admonition.properties">
+  <xsl:attribute name="border-color">#FF8080</xsl:attribute>
+  <xsl:attribute name="border-width">1px</xsl:attribute>
+  <xsl:attribute name="border-style">solid</xsl:attribute>
+  <xsl:attribute name="padding-left">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-right">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-top">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-bottom">0.2cm</xsl:attribute>
+  <xsl:attribute name="keep-together.within-page">1</xsl:attribute>
+  <xsl:attribute name="margin-left">0pt</xsl:attribute>
+  <xsl:attribute name="margin-right">0pt</xsl:attribute>
+</xsl:attribute-set>
+
+<!--
+Put a box around code blocks, also set the font size
+and keep the block together if we can using the widows
+and orphans controls.  Hyphenation and line wrapping
+is also turned on, so that long lines of code don't
+bleed off the edge of the page, a carriage return
+symbol is used as the hyphenation character:
+-->
+<xsl:attribute-set name="monospace.verbatim.properties">
+  <xsl:attribute name="border-color">#DCDCDC</xsl:attribute>
+  <xsl:attribute name="border-width">1px</xsl:attribute>
+  <xsl:attribute name="border-style">solid</xsl:attribute>
+  <xsl:attribute name="padding-left">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-right">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-top">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-bottom">0.2cm</xsl:attribute>
+  <xsl:attribute name="widows">6</xsl:attribute>
+  <xsl:attribute name="orphans">40</xsl:attribute>
+  <xsl:attribute name="font-size">9pt</xsl:attribute>
+  <xsl:attribute name="hyphenate">true</xsl:attribute>
+  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
+  <xsl:attribute name="hyphenation-character">&#x21B5;</xsl:attribute>
+  <xsl:attribute name="margin-left">0pt</xsl:attribute>
+  <xsl:attribute name="margin-right">0pt</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:param name="hyphenate.verbatim" select="1"></xsl:param>
+<xsl:param name="monospace.font.family">monospace,Symbol</xsl:param>
+
+ <!--Regular monospace text should have the same font size as code blocks etc-->
+<xsl:attribute-set name="monospace.properties">
+  <xsl:attribute name="font-size">9pt</xsl:attribute>
+</xsl:attribute-set>
+
+<!--
+Put some small amount of padding around table cells, and keep tables
+together on one page if possible:
+-->
+<xsl:attribute-set name="table.cell.padding">
+  <xsl:attribute name="padding-left">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-right">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-top">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-bottom">0.2cm</xsl:attribute>
+</xsl:attribute-set>
+
+  <!--Formal and informal tables have the same properties
+      Using widow-and-orphan control here gives much better
+      results for very large tables than a simple "keep-together"
+      instruction-->
+<xsl:attribute-set name="table.properties">
+  <xsl:attribute name="keep-together.within-page">1</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="informaltable.properties">
+  <xsl:attribute name="keep-together.within-page">1</xsl:attribute>
+</xsl:attribute-set>
+
+<!--
+General default options go here:
+* Borders are mid-grey.
+* Body text is not indented compared to the titles.
+* Page margins are a rather small 0.5in, but we need
+  all the space we can get for code blocks.
+* Paper size is A4: an ISO standard, and just slightly smaller than US Letter.
+* Use SVG graphics for admonishments: the bitmaps look awful in PDF's.
+* Disable draft mode so we're not constantly trying to download the necessary graphic. +* Set default image paths to pull down direct from SVN: individual Jamfiles can override this + and pass an absolute path to local versions of the images, but we can't get that here, so
+  we'll use SVN instead so that most things "just work".
+-->
+<xsl:param name="table.frame.border.color">#DCDCDC</xsl:param>
+<xsl:param name="table.cell.border.color">#DCDCDC</xsl:param>
+<xsl:param name="body.start.indent">0pt</xsl:param>
+<xsl:param name="page.margin.inner">0.5in</xsl:param>
+<xsl:param name="page.margin.outer">0.5in</xsl:param>
+<xsl:param name="paper.type">A4</xsl:param>
+<xsl:param name="admon.graphics">1</xsl:param>
+<xsl:param name="admon.graphics.extension">.svg</xsl:param>
+<xsl:param name="draft.mode">no</xsl:param>
+<xsl:param name="admon.graphics.path">http://svn.boost.org/svn/boost/trunk/doc/src/images/</xsl:param> +<xsl:param name="callout.graphics.path">http://svn.boost.org/svn/boost/trunk/doc/src/images/callouts/</xsl:param> +<xsl:param name="img.src.path">http://svn.boost.org/svn/boost/trunk/doc/html/</xsl:param>
+
+<!-- Ideally we would use this to force top level sections
+     to start on a new page, unfortunately this causes rather
+     unfortunate page breaks in some Doxygen-generated
+     documentation which uses <refentry> and <synopsis>
+     sections :-(
+
+<xsl:attribute-set name="section.level1.properties">
+  <xsl:attribute name="break-before">page</xsl:attribute>
+</xsl:attribute-set>
+
+-->
+
+</xsl:stylesheet>
+
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/function.xsl     Mon Feb  8 23:37:27 2010
@@ -0,0 +1,1129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+
+  <xsl:strip-space elements="requires effects postconditions returns throws
+                             complexity notes rationale purpose"/>
+
+  <!-- When true, the stylesheet will emit compact definitions of
+       functions when the function does not have any detailed
+       description. -->
+  <xsl:param name="boost.compact.function">1</xsl:param>
+
+  <!-- The longest type length that is considered "short" for the
+       layout of function return types. When the length of the result type
+       and any storage specifiers is greater than this length, they will be
+       placed on a separate line from the function name and parameters
+       unless everything fits on a single line. -->
+  <xsl:param name="boost.short.result.type">12</xsl:param>
+
+  <!-- Display a function declaration -->
+  <xsl:template name="function">
+    <xsl:param name="indentation"/>
+    <xsl:param name="is-reference"/>
+
+    <!-- Whether or not we should include parameter names in the output -->
+    <xsl:param name="include-names" select="$is-reference"/>
+
+    <!-- What type of link the function name should have. This shall
+         be one of 'anchor' (the function output will be the target of
+         links), 'link' (the function output will link to a definition), or
+         'none' (the function output will not be either a link or a link
+         target) -->
+    <xsl:param name="link-type">
+      <xsl:choose>
+        <xsl:when test="$is-reference">
+          <xsl:text>anchor</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>link</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:param>
+
+    <!-- The id we should link to or anchor as -->
+    <xsl:param name="link-to">
+      <xsl:call-template name="generate.id"/>
+    </xsl:param>
+
+    <!-- If we are printing a constructor -->
+    <xsl:param name="constructor-for"/>
+
+    <!-- If we are printing a destructor -->
+    <xsl:param name="destructor-for"/>
+
+    <!-- If we are printing a copy assignment operator -->
+    <xsl:param name="copy-assign-for"/>
+
+    <!-- The name of this function -->
+    <xsl:param name="name" select="@name"/>
+
+    <!-- True if this is the function's separate documentation -->
+    <xsl:param name="standalone" select="false()"/>
+
+    <!-- True if we should suppress the template header -->
+    <xsl:param name="suppress-template" select="false()"/>
+
+    <!-- Calculate the specifiers -->
+    <xsl:variable name="specifiers">
+      <xsl:if test="@specifiers">
+        <xsl:value-of select="concat(@specifiers, ' ')"/>
+      </xsl:if>
+    </xsl:variable>
+
+    <!-- Calculate the type -->
+    <xsl:variable name="type">
+      <xsl:value-of select="$specifiers"/>
+
+      <xsl:choose>
+        <!-- Conversion operators have an empty type, because the return
+             type is part of the name -->
+        <xsl:when test="$name='conversion-operator'"/>
+
+        <!-- Constructors and destructors have no return type -->
+        <xsl:when test="$constructor-for or $destructor-for"/>
+
+        <!-- Copy assignment operators return a reference to the class
+             they are in, unless another type has been explicitly
+             provided in the element. -->
+        <xsl:when test="$copy-assign-for and not(type)">
+          <xsl:value-of select="concat($copy-assign-for, '&amp; ')"/>
+        </xsl:when>
+
+        <xsl:otherwise>
+          <xsl:apply-templates select="type" mode="annotation"/>
+          <xsl:text> </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Build the function name with return type -->
+    <xsl:variable name="function-name">
+      <xsl:choose>
+        <xsl:when test="$constructor-for">
+          <xsl:value-of select="$constructor-for"/>
+        </xsl:when>
+        <xsl:when test="$destructor-for">
+          <xsl:value-of select="concat('~',$destructor-for)"/>
+        </xsl:when>
+        <xsl:when test="$copy-assign-for">
+          <xsl:value-of select="'operator='"/>
+        </xsl:when>
+        <xsl:when test="$name='conversion-operator'">
+          <xsl:text>operator </xsl:text>
+          <xsl:apply-templates select="type" mode="annotation"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$name"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:if test="not ($standalone) or
+                  (local-name(.)='signature' and (position() &gt; 1))
+                  or $suppress-template">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+
+    <!-- Indent this declaration -->
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+
+    <!-- Build the template header -->
+    <xsl:variable name="template-length">
+      <xsl:choose>
+        <xsl:when test="$suppress-template">
+          0
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="template.synopsis.length"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Build a full parameter string (without line breaks) -->
+    <xsl:variable name="param-string">
+      <xsl:text>(</xsl:text>
+      <xsl:call-template name="function-parameters">
+        <xsl:with-param name="include-names" select="$include-names"/>
+        <xsl:with-param name="wrap" select="false()"/>
+      </xsl:call-template>
+      <xsl:text>)</xsl:text>
+    </xsl:variable>
+
+    <!-- Build the text that follows the declarator-->
+    <xsl:variable name="postdeclarator">
+      <xsl:if test="@cv">
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="@cv"/>
+      </xsl:if>
+    </xsl:variable>
+
+    <!-- Build the full declaration text -->
+    <xsl:variable name="decl-string"
+ select="concat($type, $function-name, $param-string, $postdeclarator)"/>
+    <xsl:variable name="end-column"
+ select="$template-length + string-length($decl-string) + $indentation"/>
+
+    <xsl:choose>
+      <!-- Check if we should put the template header on its own line to
+           save horizontal space. -->
+      <xsl:when test="($template-length &gt; 0) and
+                      ($end-column &gt; $max-columns)">
+        <!-- Emit template header on its own line -->
+        <xsl:apply-templates select="template" mode="synopsis">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:apply-templates>
+
+        <!-- Emit the rest of the function declaration (without the
+             template header) indented two extra spaces. -->
+        <xsl:call-template name="function">
+          <xsl:with-param name="indentation" select="$indentation + 2"/>
+          <xsl:with-param name="is-reference" select="$is-reference"/>
+          <xsl:with-param name="include-names" select="$include-names"/>
+          <xsl:with-param name="link-type" select="$link-type"/>
+          <xsl:with-param name="link-to" select="$link-to"/>
+ <xsl:with-param name="constructor-for" select="$constructor-for"/>
+          <xsl:with-param name="destructor-for" select="$destructor-for"/>
+ <xsl:with-param name="copy-assign-for" select="$copy-assign-for"/>
+          <xsl:with-param name="name" select="$name"/>
+          <xsl:with-param name="standalone" select="$standalone"/>
+          <xsl:with-param name="suppress-template" select="true()"/>
+        </xsl:call-template>
+      </xsl:when>
+
+      <!-- Check if we can put the entire declaration on a single
+           line. -->
+      <xsl:when test="not($end-column &gt; $max-columns)">
+        <!-- Emit template header, if not suppressed -->
+        <xsl:if test="not($suppress-template)">
+          <xsl:apply-templates select="template" mode="synopsis">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="wrap" select="false()"/>
+            <xsl:with-param name="highlight" select="true()"/>
+          </xsl:apply-templates>
+        </xsl:if>
+
+        <!-- Emit specifiers -->
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$specifiers"/>
+        </xsl:call-template>
+
+        <!-- Emit type, if any -->
+        <xsl:choose>
+          <!-- Conversion operators have an empty type, because the return
+               type is part of the name -->
+          <xsl:when test="$name='conversion-operator'"/>
+
+          <!-- Constructors and destructors have no return type -->
+          <xsl:when test="$constructor-for or $destructor-for"/>
+
+          <!-- Copy assignment operators return a reference to the class
+               they are in, unless another type has been explicitly
+               provided in the element. -->
+          <xsl:when test="$copy-assign-for and not(type)">
+            <xsl:value-of select="concat($copy-assign-for, '&amp; ')"/>
+          </xsl:when>
+
+          <xsl:otherwise>
+            <xsl:apply-templates select="type" mode="highlight"/>
+            <xsl:text> </xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:call-template name="link-or-anchor">
+          <xsl:with-param name="to" select="$link-to"/>
+          <xsl:with-param name="text" select="$function-name"/>
+          <xsl:with-param name="link-type" select="$link-type"/>
+          <xsl:with-param name="highlight" select="true()"/>
+        </xsl:call-template>
+
+        <xsl:text>(</xsl:text>
+        <xsl:call-template name="function-parameters">
+          <xsl:with-param name="include-names" select="$include-names"/>
+          <xsl:with-param name="indentation"
+            select="$indentation + $template-length + string-length($type)
+                    + string-length($function-name) + 1"/>
+          <xsl:with-param name="final" select="true()"/>
+        </xsl:call-template>
+        <xsl:text>)</xsl:text>
+
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$postdeclarator"/>
+        </xsl:call-template>
+        <xsl:text>;</xsl:text>
+      </xsl:when>
+
+      <!-- This declaration will take multiple lines -->
+      <xsl:otherwise>
+        <!-- Emit specifiers -->
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$specifiers"/>
+        </xsl:call-template>
+
+        <!-- Emit type, if any -->
+        <xsl:choose>
+          <!-- Conversion operators have an empty type, because the return
+               type is part of the name -->
+          <xsl:when test="$name='conversion-operator'"/>
+
+          <!-- Constructors and destructors have no return type -->
+          <xsl:when test="$constructor-for or $destructor-for"/>
+
+          <!-- Copy assignment operators return a reference to the class
+               they are in, unless another type has been explicitly
+               provided in the element. -->
+          <xsl:when test="$copy-assign-for and not(type)">
+            <xsl:value-of select="concat($copy-assign-for, '&amp; ')"/>
+          </xsl:when>
+
+          <xsl:otherwise>
+            <xsl:apply-templates select="type" mode="highlight"/>
+            <xsl:text> </xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:if test="string-length($type) &gt; $boost.short.result.type">
+          <xsl:text>&#10;</xsl:text>
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+        </xsl:if>
+
+        <!-- Determine how many columns the type and storage
+             specifiers take on the same line as the function name. -->
+        <xsl:variable name="type-length">
+          <xsl:choose>
+ <xsl:when test="string-length($type) &gt; $boost.short.result.type">
+              0
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="string-length($type)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <xsl:call-template name="link-or-anchor">
+          <xsl:with-param name="to" select="$link-to"/>
+          <xsl:with-param name="text" select="$function-name"/>
+          <xsl:with-param name="link-type" select="$link-type"/>
+          <xsl:with-param name="highlight" select="true()"/>
+        </xsl:call-template>
+        <xsl:text>(</xsl:text>
+        <xsl:call-template name="function-parameters">
+          <xsl:with-param name="include-names" select="$include-names"/>
+          <xsl:with-param name="indentation"
+            select="$indentation + $type-length
+                    + string-length($function-name) + 1"/>
+          <xsl:with-param name="final" select="true()"/>
+        </xsl:call-template>
+        <xsl:text>)</xsl:text>
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$postdeclarator"/>
+        </xsl:call-template>
+        <xsl:text>;</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Synopsis of function parameters, e.g., "(const T&, int x = 5)" -->
+  <xsl:template name="function-parameters">
+    <!-- Indentation level of this parameter list -->
+    <xsl:param name="indentation"/>
+
+    <!-- True if we should include parameter names -->
+    <xsl:param name="include-names" select="true()"/>
+
+    <!-- True if we should wrap function parameters to the next line -->
+    <xsl:param name="wrap" select="true()"/>
+
+    <!-- True if we are printing the final output -->
+    <xsl:param name="final" select="false()"/>
+
+    <!-- Internal: The prefix to emit before a parameter -->
+    <xsl:param name="prefix" select="''"/>
+
+    <!-- Internal: The list of parameters -->
+    <xsl:param name="parameters" select="parameter"/>
+
+    <!-- Internal: The column we are on -->
+    <xsl:param name="column" select="$indentation"/>
+
+ <!-- Internal: Whether this is the first parameter on this line or not -->
+    <xsl:param name="first-on-line" select="true()"/>
+
+    <xsl:if test="$parameters">
+      <!-- Information for this parameter -->
+      <xsl:variable name="parameter" select="$parameters[position()=1]"/>
+      <xsl:variable name="pack">
+        <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
+      </xsl:variable>
+      <xsl:variable name="name">
+        <xsl:if test="$include-names and $parameter/@name != ''">
+          <xsl:text> </xsl:text><xsl:value-of select="$parameter/@name"/>
+        </xsl:if>
+      </xsl:variable>
+
+      <xsl:variable name="type" select="string($parameter/paramtype)"/>
+
+      <xsl:variable name="default">
+        <xsl:choose>
+          <xsl:when test="$parameter/@default">
+            <xsl:text> = </xsl:text>
+            <xsl:value-of select="$parameter/@default"/>
+          </xsl:when>
+          <xsl:when test="$parameter/default">
+            <xsl:text> = </xsl:text>
+            <xsl:choose>
+              <xsl:when test="$final">
+                <xsl:apply-templates
+                  select="$parameter/default/*|$parameter/default/text()"
+                  mode="annotation"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="string($parameter/default)"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:variable>
+
+ <xsl:variable name="text" select="concat($type, $pack, $name, $default)"/>
+
+      <xsl:variable name="end-column"
+        select="$column + string-length($prefix) + string-length($text)"/>
+
+      <xsl:choose>
+        <!-- Parameter goes on this line -->
+        <xsl:when test="$first-on-line or ($end-column &lt; $max-columns)
+                        or not($wrap)">
+          <xsl:choose>
+            <xsl:when test="$final">
+              <xsl:value-of select="$prefix"/>
+              <xsl:apply-templates
+                select="$parameter/paramtype/*|$parameter/paramtype/text()"
+                mode="annotation">
+                <xsl:with-param name="highlight" select="true()"/>
+              </xsl:apply-templates>
+              <xsl:value-of select="$pack"/>
+              <xsl:value-of select="$name"/>
+              <xsl:copy-of select="$default"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="concat($prefix, $text)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+
+          <xsl:call-template name="function-parameters">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="include-names" select="$include-names"/>
+            <xsl:with-param name="wrap" select="$wrap"/>
+            <xsl:with-param name="final" select="$final"/>
+            <xsl:with-param name="parameters"
+              select="$parameters[position()!=1]"/>
+            <xsl:with-param name="prefix" select="', '"/>
+            <xsl:with-param name="column" select="$end-column"/>
+            <xsl:with-param name="first-on-line" select="false()"/>
+          </xsl:call-template>
+        </xsl:when>
+        <!-- Parameter goes on next line -->
+        <xsl:otherwise>
+          <!-- The comma goes on this line -->
+          <xsl:value-of select="$prefix"/><xsl:text>&#10;</xsl:text>
+
+          <!-- Indent and print the parameter -->
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+          <xsl:choose>
+            <xsl:when test="$final">
+              <xsl:apply-templates
+                select="$parameter/paramtype/*|$parameter/paramtype/text()"
+                mode="annotation">
+                <xsl:with-param name="highlight" select="true()"/>
+              </xsl:apply-templates>
+              <xsl:value-of select="$pack"/>
+              <xsl:value-of select="$name"/>
+              <xsl:value-of select="$default"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="concat($prefix, $text)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+
+          <!-- Emit next parameter -->
+          <xsl:call-template name="function-parameters">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="include-names" select="$include-names"/>
+            <xsl:with-param name="wrap" select="$wrap"/>
+            <xsl:with-param name="final" select="$final"/>
+            <xsl:with-param name="parameters"
+              select="$parameters[position()!=1]"/>
+            <xsl:with-param name="prefix" select="', '"/>
+            <xsl:with-param name="column"
+              select="1 + string-length($text) + $indentation"/>
+            <xsl:with-param name="first-on-line" select="false()"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Function synopsis -->
+  <xsl:template match="function|method" mode="synopsis">
+    <xsl:param name="indentation"/>
+
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+ select="not (para|description|requires|effects|postconditions| returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1') and
+              not (local-name(.)='method')"/>
+
+    <xsl:choose>
+      <xsl:when test="$compact">
+        <xsl:if test="purpose">
+          <!-- Compact display outputs the purpose as a comment (if
+               there is one) and the entire function declaration. -->
+          <xsl:text>&#10;&#10;</xsl:text>
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+
+          <xsl:call-template name="highlight-comment">
+            <xsl:with-param name="text">
+              <xsl:text>// </xsl:text>
+              <xsl:apply-templates select="purpose/*|purpose/text()"
+                mode="purpose"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+
+        <xsl:call-template name="function">
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="is-reference" select="true()"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="function">
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="is-reference" select="false()"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+ <xsl:template match="overloaded-function|overloaded-method" mode="synopsis">
+    <xsl:param name="indentation"/>
+
+    <xsl:variable name="name" select="@name"/>
+
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+ select="not (para|description|requires|effects|postconditions| returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1') and
+              not (local-name(.)='overloaded-method')"/>
+
+    <xsl:choose>
+      <xsl:when test="$compact">
+        <xsl:if test="purpose">
+          <!-- Compact display outputs the purpose as a comment (if
+               there is one) and the entire function declaration. -->
+          <xsl:text>&#10;</xsl:text>
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+
+          <xsl:call-template name="highlight-comment">
+            <xsl:with-param name="text">
+              <xsl:text>// </xsl:text>
+              <xsl:apply-templates select="purpose" mode="annotation"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+
+        <xsl:for-each select="signature">
+          <xsl:call-template name="function">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="is-reference" select="true()"/>
+            <xsl:with-param name="name" select="$name"/>
+          </xsl:call-template>
+        </xsl:for-each>
+      </xsl:when>
+      <xsl:when test="local-name(..)='namespace'">
+        <xsl:variable name="link-to">
+          <xsl:call-template name="generate.id"/>
+        </xsl:variable>
+
+        <xsl:for-each select="signature">
+          <xsl:call-template name="function">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="is-reference" select="false()"/>
+            <xsl:with-param name="name" select="$name"/>
+            <xsl:with-param name="link-to" select="$link-to"/>
+          </xsl:call-template>
+        </xsl:for-each>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:for-each select="signature">
+          <xsl:call-template name="function">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="is-reference" select="false()"/>
+            <xsl:with-param name="name" select="$name"/>
+          </xsl:call-template>
+        </xsl:for-each>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+ <!-- Group free functions together under a category name (header synopsis)-->
+  <xsl:template match="free-function-group" mode="header-synopsis">
+    <xsl:param name="class"/>
+    <xsl:param name="indentation"/>
+ <xsl:apply-templates select="function|overloaded-function" mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Constructors, destructor, and assignment operators -->
+  <xsl:template name="construct-copy-destruct-synopsis">
+    <xsl:param name="indentation"/>
+    <xsl:if test="constructor|copy-assignment|destructor">
+      <xsl:if test="typedef|static-constant">
+        <xsl:text>&#10;</xsl:text>
+      </xsl:if>
+      <xsl:text>&#10;</xsl:text>
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:call-template>
+      <emphasis>
+        <xsl:text>// </xsl:text>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id"/>
+            <xsl:text>construct-copy-destruct</xsl:text>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="'construct/copy/destruct'"/>
+        </xsl:call-template>
+      </emphasis>
+      <xsl:apply-templates select="constructor" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates select="copy-assignment" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates select="destructor" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="construct-copy-destruct-reference">
+    <xsl:if test="constructor|copy-assignment|destructor">
+      <xsl:call-template name="member-documentation">
+        <xsl:with-param name="name">
+          <xsl:call-template name="anchor">
+            <xsl:with-param name="to">
+              <xsl:call-template name="generate.id"/>
+              <xsl:text>construct-copy-destruct</xsl:text>
+            </xsl:with-param>
+            <xsl:with-param name="text" select="''"/>
+          </xsl:call-template>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text">
+              <xsl:call-template name="object-name"/>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:text> </xsl:text>
+          <xsl:call-template name="access-name"/>
+          <xsl:text> construct/copy/destruct</xsl:text>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <orderedlist>
+            <xsl:apply-templates select="constructor" mode="reference"/>
+ <xsl:apply-templates select="copy-assignment" mode="reference"/>
+            <xsl:apply-templates select="destructor" mode="reference"/>
+          </orderedlist>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="constructor" mode="reference">
+    <xsl:call-template name="function.documentation">
+      <xsl:with-param name="text">
+        <para>
+          <xsl:call-template name="preformatted">
+            <xsl:with-param name="text">
+              <xsl:call-template name="function">
+                <xsl:with-param name="indentation" select="0"/>
+                <xsl:with-param name="is-reference" select="true()"/>
+                <xsl:with-param name="constructor-for">
+                  <xsl:call-template name="object-name"/>
+                </xsl:with-param>
+                <xsl:with-param name="standalone" select="true()"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </para>
+        <xsl:call-template name="function-requirements"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="copy-assignment" mode="reference">
+    <xsl:call-template name="function.documentation">
+      <xsl:with-param name="text">
+        <para>
+          <xsl:call-template name="preformatted">
+            <xsl:with-param name="text">
+              <xsl:call-template name="function">
+                <xsl:with-param name="indentation" select="0"/>
+                <xsl:with-param name="is-reference" select="true()"/>
+                <xsl:with-param name="copy-assign-for">
+                  <xsl:call-template name="object-name"/>
+                </xsl:with-param>
+                <xsl:with-param name="standalone" select="true()"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </para>
+        <xsl:call-template name="function-requirements"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="destructor" mode="reference">
+    <xsl:call-template name="function.documentation">
+      <xsl:with-param name="text">
+        <para>
+          <xsl:call-template name="preformatted">
+            <xsl:with-param name="text">
+              <xsl:call-template name="function">
+                <xsl:with-param name="indentation" select="0"/>
+                <xsl:with-param name="is-reference" select="true()"/>
+                <xsl:with-param name="destructor-for">
+                  <xsl:call-template name="object-name"/>
+                </xsl:with-param>
+                <xsl:with-param name="standalone" select="true()"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </para>
+        <xsl:call-template name="function-requirements"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Templates for functions -->
+  <xsl:template name="function.documentation">
+    <xsl:param name="text"/>
+    <xsl:choose>
+      <xsl:when test="count(ancestor::free-function-group) &gt; 0
+                      or count(ancestor::method-group) &gt; 0
+                      or local-name(.)='constructor'
+                      or local-name(.)='copy-assignment'
+                      or local-name(.)='destructor'">
+        <listitem><xsl:copy-of select="$text"/></listitem>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$text"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Semantic descriptions of functions -->
+  <xsl:template name="function-requirements">
+    <xsl:param name="namespace-reference" select="false()"/>
+
+    <xsl:if test="$namespace-reference=false()">
+      <xsl:apply-templates select="purpose/*|purpose/text()"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="description/*"/>
+
+    <xsl:if test="parameter/description|signature/parameter/description|
+ requires|effects|postconditions|returns|throws| complexity|
+                  notes|rationale">
+      <variablelist spacing="compact">
+        <xsl:processing-instruction name="dbhtml">
+          list-presentation="table"
+        </xsl:processing-instruction>
+
+        <!-- Document parameters -->
+ <xsl:if test="parameter/description| signature/parameter/description">
+          <varlistentry>
+            <term>Parameters:</term>
+            <listitem>
+              <variablelist spacing="compact">
+                <xsl:processing-instruction name="dbhtml">
+                  list-presentation="table"
+                </xsl:processing-instruction>
+                <xsl:for-each select="parameter|signature/parameter">
+                             <xsl:sort select="attribute::name"/>
+                  <xsl:if test="description">
+                    <varlistentry>
+                      <term>
+                        <xsl:call-template name="monospaced">
+                          <xsl:with-param name="text" select="@name"/>
+                        </xsl:call-template>
+                      </term>
+                      <listitem>
+                        <xsl:apply-templates select="description/*"/>
+                      </listitem>
+                    </varlistentry>
+                  </xsl:if>
+                </xsl:for-each>
+              </variablelist>
+            </listitem>
+          </varlistentry>
+        </xsl:if>
+
+        <!-- Document rest of function's contract -->
+ <xsl:for-each select="requires|effects|postconditions|returns| throws|complexity|
+                      notes|rationale">
+          <varlistentry>
+ <term><xsl:call-template name="function.requirement.name"/>:</term>
+            <listitem>
+ <xsl:apply-templates select="./*|./text()" mode="annotation"/>
+            </listitem>
+          </varlistentry>
+        </xsl:for-each>
+
+      </variablelist>
+    </xsl:if>
+
+    <xsl:if test="para">
+      <xsl:message>
+ <xsl:text>Warning: Use of 'para' elements in a function is deprecated.&#10;</xsl:text>
+        <xsl:text>  Wrap them in a 'description' element.</xsl:text>
+      </xsl:message>
+      <xsl:call-template name="print.warning.context"/>
+      <xsl:apply-templates select="para"/>
+    </xsl:if>
+
+  </xsl:template>
+
+  <xsl:template name="function.requirement.name">
+    <xsl:param name="node" select="."/>
+    <xsl:choose>
+      <xsl:when test="local-name($node)='requires'">Requires</xsl:when>
+      <xsl:when test="local-name($node)='effects'">Effects</xsl:when>
+      <xsl:when test="local-name($node)='postconditions'">
+        <xsl:text>Postconditions</xsl:text>
+      </xsl:when>
+      <xsl:when test="local-name($node)='returns'">Returns</xsl:when>
+      <xsl:when test="local-name($node)='throws'">Throws</xsl:when>
+      <xsl:when test="local-name($node)='complexity'">Complexity</xsl:when>
+      <xsl:when test="local-name($node)='notes'">Notes</xsl:when>
+      <xsl:when test="local-name($node)='rationale'">Rationale</xsl:when>
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>Error: unhandled node type `</xsl:text>
+          <xsl:value-of select="local-name($node)"/>
+          <xsl:text>' in template function.requirement.name.</xsl:text>
+        </xsl:message>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Function reference -->
+  <xsl:template match="function|method" mode="reference">
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+ select="not (para|description|requires|effects|postconditions| returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1') and
+              not (local-name(.)='method')"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="function.documentation">
+        <xsl:with-param name="text">
+          <para>
+            <xsl:call-template name="preformatted">
+              <xsl:with-param name="text">
+                <xsl:call-template name="function">
+                  <xsl:with-param name="indentation" select="0"/>
+                  <xsl:with-param name="is-reference" select="true()"/>
+                  <xsl:with-param name="link-type" select="'anchor'"/>
+                  <xsl:with-param name="standalone" select="true()"/>
+                </xsl:call-template>
+              </xsl:with-param>
+            </xsl:call-template>
+          </para>
+          <xsl:call-template name="function-requirements"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Reference for functions at namespace level -->
+  <xsl:template match="function" mode="namespace-reference">
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+ select="not (para|description|requires|effects|postconditions| returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1')"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="reference-documentation">
+        <xsl:with-param name="name">
+          <xsl:text>Function </xsl:text>
+          <xsl:if test="template">
+            <xsl:text>template </xsl:text>
+          </xsl:if>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text" select="@name"/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="refname">
+          <xsl:call-template name="fully-qualified-name">
+            <xsl:with-param name="node" select="."/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+        <xsl:with-param name="anchor">
+          <xsl:call-template name="generate.id"/>
+        </xsl:with-param>
+        <xsl:with-param name="synopsis">
+          <xsl:call-template name="header-link"/>
+          <xsl:call-template name="function">
+            <xsl:with-param name="indentation" select="0"/>
+            <xsl:with-param name="is-reference" select="true()"/>
+            <xsl:with-param name="link-type" select="'none'"/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <xsl:call-template name="function-requirements">
+            <xsl:with-param name="namespace-reference" select="true()"/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="overloaded-function" mode="reference">
+    <xsl:variable name="name" select="@name"/>
+
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+ select="not (para|description|requires|effects|postconditions| returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1')"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="function.documentation">
+        <xsl:with-param name="text">
+          <para>
+            <xsl:attribute name="id">
+              <xsl:call-template name="generate.id"/>
+            </xsl:attribute>
+
+            <xsl:call-template name="preformatted">
+              <xsl:with-param name="text">
+                <xsl:for-each select="signature">
+                  <xsl:call-template name="function">
+                    <xsl:with-param name="indentation" select="0"/>
+                    <xsl:with-param name="is-reference" select="true()"/>
+                    <xsl:with-param name="name" select="$name"/>
+                    <xsl:with-param name="standalone" select="true()"/>
+                  </xsl:call-template>
+                </xsl:for-each>
+              </xsl:with-param>
+            </xsl:call-template>
+          </para>
+          <xsl:call-template name="function-requirements"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="overloaded-function" mode="namespace-reference">
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+ select="not (para|description|requires|effects|postconditions| returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1')"/>
+
+    <xsl:variable name="name" select="@name"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="reference-documentation">
+        <xsl:with-param name="name">
+          <xsl:text>Function </xsl:text>
+          <xsl:if test="template">
+            <xsl:text>template </xsl:text>
+          </xsl:if>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text" select="@name"/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="refname">
+          <xsl:call-template name="fully-qualified-name">
+            <xsl:with-param name="node" select="."/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+        <xsl:with-param name="anchor">
+          <xsl:call-template name="generate.id"/>
+        </xsl:with-param>
+        <xsl:with-param name="synopsis">
+          <xsl:call-template name="header-link"/>
+          <xsl:for-each select="signature">
+            <xsl:call-template name="function">
+              <xsl:with-param name="indentation" select="0"/>
+              <xsl:with-param name="is-reference" select="true()"/>
+              <xsl:with-param name="link-type" select="'none'"/>
+              <xsl:with-param name="name" select="$name"/>
+            </xsl:call-template>
+          </xsl:for-each>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <xsl:call-template name="function-requirements">
+            <xsl:with-param name="namespace-reference" select="true()"/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/global.xsl       Mon Feb  8 23:37:27 2010
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
+  <xsl:template name="global-synopsis">
+    <xsl:param name="indentation" select="0" />
+ <xsl:if test="not(local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() &gt; 1)">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation" />
+    </xsl:call-template>
+    <xsl:call-template name="global-synopsis-impl">
+      <xsl:with-param name="link-type" select="'link'" />
+    </xsl:call-template>
+  </xsl:template>
+  <xsl:template name="global-reference">
+    <xsl:call-template name="reference-documentation">
+      <xsl:with-param name="refname">
+        <xsl:call-template name="fully-qualified-name">
+          <xsl:with-param name="node" select="." />
+        </xsl:call-template>
+        <xsl:apply-templates select="specialization" />
+      </xsl:with-param>
+      <xsl:with-param name="purpose" select="purpose/*|purpose/text()" />
+      <xsl:with-param name="anchor">
+        <xsl:call-template name="generate.id" />
+      </xsl:with-param>
+      <xsl:with-param name="name">
+        <xsl:text>Global </xsl:text>
+        <xsl:call-template name="monospaced">
+          <xsl:with-param name="text" select="@name" />
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="synopsis">
+        <xsl:call-template name="header-link"/>
+        <xsl:call-template name="global-synopsis-impl">
+          <xsl:with-param name="link-type" select="'none'" />
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="text">
+        <xsl:apply-templates select="description" />
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+  <xsl:template name="global-synopsis-impl">
+    <xsl:param name="link-type" />
+    <xsl:if test="@specifiers">
+      <xsl:call-template name="highlight-keyword">
+        <xsl:with-param name="keyword" select="@specifiers" />
+      </xsl:call-template>
+      <xsl:text> </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates select="type/*|type/text()" mode="annotation" />
+    <xsl:text> </xsl:text>
+    <xsl:call-template name="link-or-anchor">
+      <xsl:with-param name="to">
+        <xsl:call-template name="generate.id" select="." />
+      </xsl:with-param>
+      <xsl:with-param name="text" select="@name" />
+      <xsl:with-param name="link-type" select="$link-type" />
+    </xsl:call-template>
+    <xsl:text>;</xsl:text>
+  </xsl:template>
+  <xsl:template match="data-member" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/html-help.xsl    Mon Feb  8 23:37:27 2010
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+ xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision";
+                version="1.0">
+
+  <!-- Import the HTML chunking stylesheet -->
+  <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl"/>
+
+  <xsl:param name="admon.style"/>
+  <xsl:param name="admon.graphics">1</xsl:param>
+  <xsl:param name="boostbook.verbose" select="0"/>
+  <xsl:param name="html.stylesheet" select="'boostbook.css'"/>
+  <xsl:param name="chapter.autolabel" select="1"/>
+  <xsl:param name="use.id.as.filename" select="1"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+  <xsl:param name="generate.manifest" select="1"/>
+  <xsl:param name="callout.graphics.number.limit">15</xsl:param>
+  <xsl:param name="draft.mode">no</xsl:param>
+  <xsl:param name="admon.graphics" select="1"/>
+
+  <xsl:template name="format.cvs.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+ <xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '/')"/>
+
+    <!-- Grab the month -->
+ <xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '/')"/>
+
+    <!-- Grab the year -->
+ <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+ <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' GMT')"/>
+  </xsl:template>
+
+
+  <xsl:template name="format.svn.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+ <xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '-')"/>
+
+    <!-- Grab the month -->
+ <xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '-')"/>
+
+    <!-- Grab the year -->
+ <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+    <xsl:variable name="text.notime"
+      select="substring-after($text.noday, ' ')"/>
+
+    <!-- Get the timezone -->
+ <xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+ <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' ', $timezone)"/>
+  </xsl:template>
+
+  <!-- We don't want refentry's to show up in the TOC because they
+       will merely be redundant with the synopsis. -->
+  <xsl:template match="refentry" mode="toc"/>
+
+  <!-- override the behaviour of some DocBook elements for better
+       rendering facilities -->
+
+  <xsl:template match = "programlisting[ancestor::informaltable]">
+     <pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
+  </xsl:template>
+
+  <xsl:template match = "refsynopsisdiv">
+     <h2 class = "{name(.)}-title">Synopsis</h2>
+     <div class = "{name(.)}">
+        <xsl:apply-templates/>
+     </div>
+  </xsl:template>
+
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/html-single.xsl  Mon Feb  8 23:37:27 2010
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+ xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision";
+                version="1.0">
+
+  <!-- Import the HTML stylesheet -->
+  <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
+  <xsl:import href="admon.xsl"/>
+
+  <xsl:param name="admon.style"/>
+  <xsl:param name="admon.graphics">1</xsl:param>
+  <xsl:param name="chapter.autolabel" select="0"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/html.xsl Mon Feb  8 23:37:27 2010
@@ -0,0 +1,313 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+ xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision";
+                version="1.0">
+
+  <!-- Import the HTML chunking stylesheet -->
+  <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
+  <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/current/html/math.xsl"/>
+
+  <xsl:import href="chunk-common.xsl"/>
+  <xsl:import href="docbook-layout.xsl"/>
+  <xsl:import href="navbar.xsl"/>
+  <xsl:import href="admon.xsl"/>
+  <xsl:import href="xref.xsl"/>
+  <xsl:import href="relative-href.xsl"/>
+  <xsl:import href="callout.xsl"/>
+
+  <xsl:param name="admon.style"/>
+  <xsl:param name="admon.graphics">1</xsl:param>
+  <xsl:param name="boostbook.verbose" select="0"/>
+  <xsl:param name="html.stylesheet" select="'boostbook.css'"/>
+  <xsl:param name="navig.graphics" select="1"/>
+  <xsl:param name="navig.graphics.extension" select="'.png'"/>
+  <xsl:param name="chapter.autolabel" select="1"/>
+  <xsl:param name="use.id.as.filename" select="1"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+  <xsl:param name="generate.manifest" select="1"/>
+  <xsl:param name="generate.section.toc.level" select="3"/>
+  <xsl:param name="doc.standalone">false</xsl:param>
+  <xsl:param name="chunker.output.indent">yes</xsl:param>
+  <xsl:param name="chunker.output.encoding">US-ASCII</xsl:param>
+ <xsl:param name="chunk.quietly" select="not(number($boostbook.verbose))"/>
+  <xsl:param name="toc.max.depth">2</xsl:param>
+  <xsl:param name="callout.graphics.number.limit">15</xsl:param>
+  <xsl:param name = "admon.graphics.path"
+            select = "concat($boost.root, '/doc/html/images/')"/>
+  <xsl:param name = "navig.graphics.path"
+            select = "concat($boost.root, '/doc/html/images/')"/>
+  <xsl:param name = "callout.graphics.path"
+            select = "concat($boost.root, '/doc/src/images/callouts/')"/>
+
+
+  <xsl:param name="admon.style">
+    <!-- Remove the style. Let the CSS do the styling -->
+</xsl:param>
+
+<!-- Always have graphics -->
+<xsl:param name="admon.graphics" select="1"/>
+
+  <xsl:param name="generate.toc">
+appendix  toc,title
+article/appendix  nop
+article   toc,title
+book      toc,title
+chapter   toc,title
+part      toc,title
+preface   toc,title
+qandadiv  toc
+qandaset  toc
+reference toc,title
+sect1     toc
+sect2     toc
+sect3     toc
+sect4     toc
+sect5     toc
+section   toc
+set       toc,title
+  </xsl:param>
+
+
+  <xsl:template name="format.cvs.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+ <xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '/')"/>
+
+    <!-- Grab the month -->
+ <xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '/')"/>
+
+    <!-- Grab the year -->
+ <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+ <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' GMT')"/>
+  </xsl:template>
+
+
+  <xsl:template name="format.svn.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+ <xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '-')"/>
+
+    <!-- Grab the month -->
+ <xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '-')"/>
+
+    <!-- Grab the year -->
+ <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+    <xsl:variable name="text.notime"
+      select="substring-after($text.noday, ' ')"/>
+
+    <!-- Get the timezone -->
+ <xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+ <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' ', $timezone)"/>
+  </xsl:template>
+
+  <!-- Footer Copyright -->
+  <xsl:template match="copyright" mode="boost.footer">
+    <xsl:if test="position() &gt; 1">
+      <br/>
+    </xsl:if>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'Copyright'"/>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:call-template name="dingbat">
+      <xsl:with-param name="dingbat">copyright</xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:call-template name="copyright.years">
+      <xsl:with-param name="years" select="year"/>
+      <xsl:with-param name="print.ranges" select="$make.year.ranges"/>
+      <xsl:with-param name="single.year.ranges"
+        select="$make.single.year.ranges"/>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:apply-templates select="holder" mode="titlepage.mode"/>
+  </xsl:template>
+
+  <!-- Footer License -->
+  <xsl:template match="legalnotice" mode="boost.footer">
+    <xsl:apply-templates select="para" mode="titlepage.mode" />
+  </xsl:template>
+
+  <xsl:template name="user.footer.content">
+    <table width="100%">
+      <tr>
+        <td align="left">
+          <xsl:variable name="revision-nodes"
+            select="ancestor-or-self::*
+                    [not (attribute::rev:last-revision='')]"/>
+          <xsl:if test="count($revision-nodes) &gt; 0">
+            <xsl:variable name="revision-node"
+              select="$revision-nodes[last()]"/>
+            <xsl:variable name="revision-text">
+              <xsl:value-of
+ select="normalize-space($revision-node/attribute::rev:last-revision)"/>
+            </xsl:variable>
+            <xsl:if test="string-length($revision-text) &gt; 0">
+              <p>
+                <small>
+                  <xsl:text>Last revised: </xsl:text>
+                  <xsl:choose>
+                    <xsl:when test="contains($revision-text, '/')">
+                      <xsl:call-template name="format.cvs.revision">
+ <xsl:with-param name="text" select="$revision-text"/>
+                      </xsl:call-template>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:call-template name="format.svn.revision">
+ <xsl:with-param name="text" select="$revision-text"/>
+                      </xsl:call-template>
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </small>
+              </p>
+            </xsl:if>
+          </xsl:if>
+        </td>
+        <td align="right">
+          <div class = "copyright-footer">
+            <xsl:apply-templates select="ancestor::*/*/copyright"
+              mode="boost.footer"/>
+            <xsl:apply-templates select="ancestor::*/*/legalnotice"
+              mode="boost.footer"/>
+          </div>
+        </td>
+      </tr>
+    </table>
+  </xsl:template>
+
+  <!-- We don't want refentry's to show up in the TOC because they
+       will merely be redundant with the synopsis. -->
+  <xsl:template match="refentry" mode="toc"/>
+
+  <!-- override the behaviour of some DocBook elements for better
+       rendering facilities -->
+
+  <xsl:template match = "programlisting[ancestor::informaltable]">
+     <pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
+  </xsl:template>
+
+  <xsl:template match = "refsynopsisdiv">
+     <h2 class = "{name(.)}-title">Synopsis</h2>
+     <div class = "{name(.)}">
+        <xsl:apply-templates/>
+     </div>
+  </xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template name="output.html.stylesheets">
+    <xsl:param name="stylesheets" select="''"/>
+
+    <xsl:choose>
+        <xsl:when test="contains($stylesheets, ' ')">
+            <link rel="stylesheet">
+                <xsl:attribute name="href">
+                    <xsl:call-template name="href.target.relative">
+ <xsl:with-param name="target" select="substring-before($stylesheets, ' ')"/>
+                    </xsl:call-template>
+                </xsl:attribute>
+                <xsl:if test="$html.stylesheet.type != ''">
+                    <xsl:attribute name="type">
+                        <xsl:value-of select="$html.stylesheet.type"/>
+                    </xsl:attribute>
+                </xsl:if>
+            </link>
+            <xsl:call-template name="output.html.stylesheets">
+ <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="$stylesheets != ''">
+            <link rel="stylesheet">
+                <xsl:attribute name="href">
+                    <xsl:call-template name="href.target.relative">
+ <xsl:with-param name="target" select="$stylesheets"/>
+                    </xsl:call-template>
+                </xsl:attribute>
+                <xsl:if test="$html.stylesheet.type != ''">
+                    <xsl:attribute name="type">
+                        <xsl:value-of select="$html.stylesheet.type"/>
+                    </xsl:attribute>
+                </xsl:if>
+            </link>
+        </xsl:when>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/index.xsl        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+  <xsl:template match="class-index">
+
+  </xsl:template>
+
+  <xsl:template match="function-index">
+
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/library.xsl      Mon Feb  8 23:37:27 2010
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+  <xsl:key name="library-categories" match="library"
+    use="libraryinfo/librarycategory/@name"/>
+
+  <xsl:template match="librarylist">
+    <itemizedlist spacing="compact">
+      <xsl:apply-templates select="//library"
+        mode="build-library-list">
+        <xsl:sort select="@name"/>
+      </xsl:apply-templates>
+    </itemizedlist>
+  </xsl:template>
+
+  <xsl:template name="library.link">
+    <xsl:param name="node" select="."/>
+    <xsl:param name="name" select="$node/attribute::name"/>
+
+    <xsl:choose>
+      <xsl:when test="$node/attribute::html-only = 1">
+        <xsl:variable name="url">
+          <xsl:choose>
+            <xsl:when test="$node/attribute::url">
+              <xsl:value-of select="$node/attribute::url"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="concat($boost.root,
+                                           '/libs/',
+                                           $node/attribute::dirname,
+                                           '/index.html')"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+        <ulink>
+          <xsl:attribute name="url">
+            <xsl:value-of select="$url"/>
+          </xsl:attribute>
+          <xsl:value-of select="$name"/>
+        </ulink>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:choose>
+              <xsl:when test="$node/attribute::id">
+                <xsl:value-of select="$node/attribute::id"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:call-template name="generate.id">
+                  <xsl:with-param name="node" select="$node"/>
+                </xsl:call-template>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="$name"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="library" mode="build-library-list">
+    <listitem>
+      <simpara>
+        <xsl:call-template name="library.link"/>
+        <xsl:text> - </xsl:text>
+        <xsl:apply-templates select="libraryinfo/librarypurpose"
+          mode="build-library-list"/>
+      </simpara>
+    </listitem>
+  </xsl:template>
+
+  <xsl:template match="librarypurpose" mode="build-library-list">
+    <xsl:apply-templates/>
+    <xsl:text>, from </xsl:text>
+    <xsl:apply-templates select="../author" mode="display-author-list"/>
+  </xsl:template>
+
+  <xsl:template match="author" mode="display-author-list">
+    <xsl:if test="(position() &gt; 1) and (count(../author) &gt; 2)">
+      <xsl:text>, </xsl:text>
+    </xsl:if>
+    <xsl:if test="(position() = count(../author)) and (position() &gt; 1)">
+      <xsl:if test="position() &lt; 3">
+        <xsl:text> </xsl:text>
+      </xsl:if>
+      <xsl:text>and </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates select="firstname/text()"/>
+    <xsl:text> </xsl:text>
+    <xsl:apply-templates select="surname/text()"/>
+    <xsl:if test="(position() = count(../author))">
+      <xsl:text>.</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="librarycategorylist">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="librarycategorydef">
+    <section>
+      <title><xsl:apply-templates/></title>
+      <xsl:variable name="name" select="@name"/>
+      <itemizedlist spacing="compact">
+        <xsl:apply-templates select="key('library-categories', $name)"
+          mode="build-library-list">
+          <xsl:sort select="@name"/>
+        </xsl:apply-templates>
+      </itemizedlist>
+    </section>
+  </xsl:template>
+
+  <xsl:template match="libraryinfo">
+    <chapterinfo>
+ <xsl:apply-templates select="author|authorgroup/author|copyright| legalnotice"/>
+    </chapterinfo>
+  </xsl:template>
+
+  <xsl:template match="librarypurpose|librarycategory"/>
+
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/lookup.xsl       Mon Feb  8 23:37:27 2010
@@ -0,0 +1,494 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+
+  <!-- Maximum length of directory and file names is 31 characters.
+       '.html' uses 5 characters.
+       31 - 5 = 26 -->
+  <xsl:param name="boost.max.id.part.length">26</xsl:param>
+
+  <!-- Generate an ID for the entity referenced -->
+  <xsl:template name="generate.id">
+    <xsl:param name="node" select="."/>
+    <xsl:apply-templates select="$node" mode="generate.id"/>
+  </xsl:template>
+
+  <xsl:template match="*" mode="generate.id">
+    <xsl:value-of select="generate-id(.)"/>
+    <xsl:text>-bb</xsl:text>
+  </xsl:template>
+
+  <xsl:template name="strip-qualifiers-non-template">
+    <xsl:param name="name"/>
+    <xsl:choose>
+      <xsl:when test="contains($name, '&gt;')">
+        <xsl:call-template name="strip-qualifiers-non-template">
+ <xsl:with-param name="name" select="substring-after($name, '&gt;')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="contains($name, '::')">
+        <xsl:call-template name="strip-qualifiers-non-template">
+ <xsl:with-param name="name" select="substring-after($name, '::')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$name"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="strip-balanced">
+    <xsl:param name="name"/>
+    <xsl:param name="open" select="'&lt;'"/>
+    <xsl:param name="close" select="'&gt;'"/>
+    <xsl:param name="depth" select="0"/>
+    <xsl:choose>
+      <xsl:when test="contains($name, $open)
+                and not(contains(substring-before($name, $open), $close))">
+        <xsl:call-template name="strip-balanced">
+ <xsl:with-param name="name" select="substring-after($name, $open)"/>
+          <xsl:with-param name="open" select="$open"/>
+          <xsl:with-param name="close" select="$close"/>
+          <xsl:with-param name="depth" select="$depth + 1"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="contains($name, $close) and ($depth &gt; 1)">
+        <xsl:call-template name="strip-balanced">
+ <xsl:with-param name="name" select="substring-after($name, $close)"/>
+          <xsl:with-param name="open" select="$open"/>
+          <xsl:with-param name="close" select="$close"/>
+          <xsl:with-param name="depth" select="$depth - 1"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="substring-after($name, $close)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="strip-qualifiers-template">
+    <xsl:param name="name"/>
+    <xsl:choose>
+      <xsl:when test="contains($name, '::')
+                and not(contains(substring-before($name, '::'), '&lt;'))">
+        <xsl:call-template name="strip-qualifiers-template">
+ <xsl:with-param name="name" select="substring-after($name, '::')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="rest">
+          <xsl:call-template name="strip-balanced">
+            <xsl:with-param name="name" select="$name"/>
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:choose>
+          <xsl:when test="$rest != ''">
+            <xsl:call-template name="strip-qualifiers-template">
+              <xsl:with-param name="name" select="$rest"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$name"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Strip the qualifiers off a qualified name and return the unqualified
+       name. For instance, "boost::python::function" would become just
+       "function".
+       Must handle ns::foo                    -> foo
+       Must handle ns::foo<bar::baz>          -> foo<bar::baz>
+       Must handle ns::foo<bar::baz>::nested  -> nested
+       Must handle ns::foo<x>::bar<y>         -> bar<y> -->
+  <xsl:template name="strip-qualifiers">
+    <xsl:param name="name"/>
+    <xsl:choose>
+      <xsl:when test="substring($name, string-length($name)) = '&gt;'">
+        <xsl:call-template name="strip-qualifiers-template">
+          <xsl:with-param name="name" select="$name"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="strip-qualifiers-non-template">
+          <xsl:with-param name="name" select="$name"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Build the fully-qualified id of the given node -->
+  <xsl:template name="fully-qualified-id">
+    <xsl:param name="node"/>
+
+    <xsl:apply-templates select="$node" mode="fully-qualified-name">
+      <xsl:with-param name="is.id" select="true()"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Build the fully-qualified name of the given node -->
+  <xsl:template name="fully-qualified-name">
+    <xsl:param name="node"/>
+    <xsl:apply-templates select="$node" mode="fully-qualified-name"/>
+  </xsl:template>
+
+  <!-- Hack to make the node we are building the current node so that the
+       ancestor:: syntax will work -->
+  <xsl:template match="*" mode="fully-qualified-name">
+    <xsl:param name="is.id" select="false()" />
+    <xsl:call-template name="build-fully-qualified-name">
+      <xsl:with-param name="is.id" select="$is.id"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- The real routine that builds a fully-qualified name for the current
+       node. -->
+  <xsl:template name="build-fully-qualified-name">
+    <xsl:param name="is.id" select="false()" />
+
+    <!-- The depth of qualified name element that we will print now-->
+    <xsl:param name="depth" select="1"/>
+
+    <!-- Determine the set of ancestor namespaces -->
+    <xsl:variable name="ancestors"
+      select="ancestor::namespace|
+                  ancestor::class|ancestor::struct|ancestor::union|
+ ancestor::class-specialization| ancestor::struct-specialization|ancestor::union-specialization"/>
+
+    <xsl:choose>
+      <xsl:when test="$depth &gt; count($ancestors)">
+        <xsl:apply-templates select="." mode="print-id-part">
+          <xsl:with-param name="is.id" select="$is.id"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:if test="name($ancestors[$depth])='namespace' or
+                      count(ancestor::free-function-group)=0">
+ <xsl:apply-templates select="$ancestors[$depth]" mode="print-id-part">
+            <xsl:with-param name="is.id" select="$is.id"/>
+          </xsl:apply-templates>
+          <xsl:choose>
+            <xsl:when test="$is.id"><xsl:text>.</xsl:text></xsl:when>
+            <xsl:otherwise><xsl:text>::</xsl:text></xsl:otherwise>
+          </xsl:choose>
+        </xsl:if>
+        <xsl:call-template name="build-fully-qualified-name">
+          <xsl:with-param name="is.id" select="$is.id"/>
+          <xsl:with-param name="depth" select="$depth + 1"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Print the part of a fully qualified name for a single element -->
+  <xsl:template match="*" mode="print-id-part">
+    <xsl:param name="is.id"/>
+
+    <xsl:variable name="part">
+      <xsl:apply-templates select="." mode="print-name"/>
+    </xsl:variable>
+
+    <xsl:variable name="unique-name">
+      <xsl:apply-templates select="." mode="unique.name"/>
+    </xsl:variable>
+
+    <xsl:choose>
+      <xsl:when test=
+        "$is.id and (
+          string-length($part) &gt; $boost.max.id.part.length or
+          $unique-name = 0 or
+          translate($part, '.&lt;&gt;;\:*?&quot;| ', '') != $part
+        )">
+ <xsl:variable name="normalized" select="translate(normalize-space(translate($part, '.&lt;&gt;;\:*?&quot;| _', ' ')), ' ', '_')"/>
+        <xsl:value-of select =
+          "concat(
+ substring($normalized, 1, $boost.max.id.part.length - string-length(generate-id(.) - 1)),
+            concat('_', generate-id(.)))"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$part"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Override this if an id might not be unique -->
+  <xsl:template match="*" mode="unique.name">
+    <xsl:value-of select="1"/>
+  </xsl:template>
+
+  <xsl:template match="function|overloaded-function" mode="unique.name">
+    <xsl:value-of select="number(count(key('named-entities',
+        translate(@name, $uppercase-letters, $lowercase-letters))) = 1)"/>
+  </xsl:template>
+
+  <!-- Print the name of the current node -->
+  <xsl:template match="*" mode="print-name">
+    <xsl:value-of select="@name"/>
+  </xsl:template>
+
+  <xsl:template match="template-arg" mode="print-name">
+    <xsl:if test="position() &gt; 1">
+      <xsl:text>, </xsl:text>
+    </xsl:if>
+    <xsl:value-of select="text()"/>
+    <xsl:if test="@pack=1">
+      <xsl:text>...</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template
+ match="struct-specialization|class-specialization| union-specialization"
+      mode="print-name">
+    <xsl:value-of select="@name"/>
+    <xsl:text>&lt;</xsl:text>
+ <xsl:apply-templates select="specialization/template-arg" mode="print-name"/>
+    <xsl:text>&gt;</xsl:text>
+  </xsl:template>
+
+  <xsl:template name="name-matches-node">
+    <!-- The name we are looking for -->
+    <xsl:param name="name"/>
+
+    <!-- The name to display -->
+    <xsl:param name="display-name" select="$name"/>
+
+    <!-- The context in which this name occurs -->
+    <xsl:param name="context"/>
+
+    <!-- The node that we are checking against -->
+    <xsl:param name="node"/>
+
+    <!-- The mode we are in. Can be one of:
+           matches: emits the matches as they are found (for debugging)
+           link: link to the node that was found
+         -->
+    <xsl:param name="mode" select="'matches'"/>
+
+ <!-- The index into the list of using directives for the context node -->
+    <xsl:param name="index" select="1"/>
+
+ <!-- The prefix we should append to the name when checking this node -->
+    <xsl:param name="prefix" select="''"/>
+
+    <xsl:choose>
+      <xsl:when test="count($node) &gt; 1">
+        <xsl:variable name="matches">
+          <xsl:call-template name="count-matches">
+            <xsl:with-param name="name" select="$name"/>
+            <xsl:with-param name="context" select="$context"/>
+            <xsl:with-param name="nodes" select="$node[position() = 1]"/>
+          </xsl:call-template>
+        </xsl:variable>
+
+        <xsl:choose>
+          <xsl:when test="$matches = 0">
+            <xsl:call-template name="name-matches-node">
+              <xsl:with-param name="name" select="$name"/>
+              <xsl:with-param name="display-name" select="$display-name"/>
+              <xsl:with-param name="context" select="$context"/>
+ <xsl:with-param name="node" select="$node[position() &gt; 1]"/>
+              <xsl:with-param name="mode" select="$mode"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="name-matches-node">
+              <xsl:with-param name="name" select="$name"/>
+              <xsl:with-param name="display-name" select="$display-name"/>
+              <xsl:with-param name="context" select="$context"/>
+              <xsl:with-param name="node" select="$node[position() = 1]"/>
+              <xsl:with-param name="mode" select="$mode"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:when test="count($node) = 1">
+ <!-- The fully-qualified name of the node we are checking against -->
+        <xsl:variable name="fully-qualified-name">
+          <xsl:call-template name="fully-qualified-name">
+            <xsl:with-param name="node" select="$node"/>
+          </xsl:call-template>
+        </xsl:variable>
+
+        <!-- The set of using directives for this context node -->
+        <xsl:variable name="directives"
+          select="$context/ancestor::*/using-namespace |
+                  $context/ancestor::namespace |
+                  $context/ancestor::*/using-class |
+                  $context/ancestor::class |
+                  $context/ancestor::struct"/>
+
+        <!-- The name of the current directive -->
+        <xsl:variable name="this-context">
+ <xsl:apply-templates select="$directives[$index]" mode="print-name"/>
+        </xsl:variable>
+
+        <!-- Check if we have a match -->
+        <xsl:variable name="have-match"
+          select="$fully-qualified-name = concat($prefix, $name)"/>
+
+        <xsl:if test="$have-match">
+          <xsl:choose>
+            <xsl:when test="$mode='matches'">
+              Match in namespace ::<xsl:value-of select="$prefix"/>
+            </xsl:when>
+            <xsl:when test="$mode='link'">
+              <xsl:call-template name="internal-link">
+                <xsl:with-param name="to">
+                  <xsl:call-template name="generate.id">
+                    <xsl:with-param name="node" select="$node"/>
+                  </xsl:call-template>
+                </xsl:with-param>
+                <xsl:with-param name="text" select="$display-name"/>
+              </xsl:call-template>
+            </xsl:when>
+          </xsl:choose>
+        </xsl:if>
+
+        <xsl:if test="(not($index &gt; count($directives))) and
+                      (not($have-match) or ($mode = 'matches'))">
+          <xsl:variable name="first-branch">
+            <xsl:if test="not ($prefix = '')">
+ <!-- Recurse and append the current context node to the prefix -->
+              <xsl:call-template name="name-matches-node">
+                <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="display-name" select="$display-name"/>
+                <xsl:with-param name="context" select="$context"/>
+                <xsl:with-param name="node" select="$node"/>
+                <xsl:with-param name="mode" select="$mode"/>
+                <xsl:with-param name="index" select="$index + 1"/>
+                <xsl:with-param name="prefix"
+                  select="concat($prefix, $this-context, '::')"/>
+              </xsl:call-template>
+            </xsl:if>
+          </xsl:variable>
+
+          <xsl:choose>
+            <xsl:when test="string($first-branch) != ''">
+              <xsl:copy-of select="$first-branch"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <!-- Recurse with just the current context node -->
+              <xsl:call-template name="name-matches-node">
+                <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="display-name" select="$display-name"/>
+                <xsl:with-param name="context" select="$context"/>
+                <xsl:with-param name="node" select="$node"/>
+                <xsl:with-param name="mode" select="$mode"/>
+                <xsl:with-param name="index" select="$index + 1"/>
+                <xsl:with-param name="prefix"
+                  select="concat($this-context, '::')"/>
+              </xsl:call-template>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:if>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Count the number of nodes in the set that match the given name and
+       lookup context -->
+  <xsl:template name="count-matches">
+    <xsl:param name="name"/>
+    <xsl:param name="context"/>
+    <xsl:param name="nodes"/>
+
+    <xsl:variable name="match-string">
+      <xsl:for-each select="$nodes">
+        <xsl:variable name="does-match">
+          <xsl:call-template name="name-matches-node">
+            <xsl:with-param name="name" select="$name"/>
+            <xsl:with-param name="context" select="$context"/>
+            <xsl:with-param name="node" select="."/>
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:if test="not($does-match='')">X</xsl:if>
+      </xsl:for-each>
+    </xsl:variable>
+    <xsl:value-of select="string-length($match-string)"/>
+  </xsl:template>
+
+  <xsl:template name="cxx-link-name">
+    <!-- The actual lookup node -->
+    <xsl:param name="lookup"/>
+
+    <!-- The type of name to lookup (e.g., class) -->
+    <xsl:param name="type"/>
+
+    <!-- The name we are looking for -->
+    <xsl:param name="name"/>
+
+    <!-- The name we will display  -->
+    <xsl:param name="display-name"/>
+
+    <!-- The name we are looking for (unqualified)-->
+    <xsl:param name="unqualified-name"/>
+
+ <!-- The list of nodes that match the lookup node in both name and type -->
+    <xsl:param name="nodes"/>
+
+    <!-- Count the number of nodes that match -->
+    <xsl:variable name="matches">
+      <xsl:call-template name="count-matches">
+        <xsl:with-param name="name" select="$name"/>
+        <xsl:with-param name="context" select="$lookup"/>
+        <xsl:with-param name="nodes" select="$nodes"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:choose>
+      <xsl:when test="$matches = 0">
+        <xsl:message>
+          <xsl:text>Cannot find </xsl:text>
+          <xsl:value-of select="$type"/>
+          <xsl:text> named '</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>'</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$display-name"/>
+      </xsl:when>
+      <xsl:when test="$matches = 1">
+        <xsl:for-each select="$nodes">
+          <xsl:call-template name="name-matches-node">
+            <xsl:with-param name="name" select="$name"/>
+            <xsl:with-param name="display-name" select="$display-name"/>
+            <xsl:with-param name="context" select="$lookup"/>
+            <xsl:with-param name="node" select="."/>
+            <xsl:with-param name="mode" select="'link'"/>
+          </xsl:call-template>
+        </xsl:for-each>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>Reference to </xsl:text>
+          <xsl:value-of select="$type"/>
+          <xsl:text> '</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>' is ambiguous. Found:</xsl:text>
+          <xsl:for-each select="$nodes">
+            <xsl:call-template name="name-matches-node">
+              <xsl:with-param name="name" select="$name"/>
+              <xsl:with-param name="context" select="$lookup"/>
+              <xsl:with-param name="node" select="."/>
+              <xsl:with-param name="mode" select="'matches'"/>
+            </xsl:call-template>
+          </xsl:for-each>
+        </xsl:message>
+        <xsl:call-template name="name-matches-node">
+          <xsl:with-param name="name" select="$name"/>
+          <xsl:with-param name="display-name" select="$display-name"/>
+          <xsl:with-param name="context" select="$lookup"/>
+          <xsl:with-param name="node" select="$nodes"/>
+          <xsl:with-param name="mode" select="'link'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
--- /dev/null
+++ /trunk/tools/boostbook/xsl/macro.xsl        Mon Feb  8 23:37:27 2010
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+  <xsl:template match="macro" mode="synopsis">
+    <xsl:param name="indentation" select="0"/>
+
+    <xsl:text>&#10;</xsl:text>
+    <xsl:if
+ test="not(local-name(preceding-sibling::*[position()=1])=local-name(.))">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <xsl:call-template name="macro-synopsis">
+      <xsl:with-param name="link-type" select="'link'"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="macro" mode="reference">
+    <xsl:call-template name="reference-documentation">
+      <xsl:with-param name="refname" select="@name"/>
+      <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+      <xsl:with-param name="anchor">
+        <xsl:call-template name="generate.id"/>
+      </xsl:with-param>
+      <xsl:with-param name="name">
+        <xsl:text>Macro </xsl:text>
+        <xsl:call-template name="monospaced">
+          <xsl:with-param name="text" select="@name"/>
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="synopsis">
+        <xsl:call-template name="header-link"/>
+        <xsl:call-template name="macro-synopsis">
+          <xsl:with-param name="link-type" select="'none'"/>
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="text">
+        <xsl:apply-templates select="description"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="macro-synopsis">
+    <xsl:param name="link-type"/>
+
+    <xsl:call-template name="link-or-anchor">
+      <xsl:with-param name="to">
+        <xsl:call-template name="generate.id" select="."/>
+      </xsl:with-param>
+      <xsl:with-param name="text" select="@name"/>
+      <xsl:with-param name="link-type" select="$link-type"/>
+    </xsl:call-template>
+
+    <xsl:if test="@kind='functionlike'">
+      <xsl:text>(</xsl:text>
+      <xsl:for-each select="macro-parameter">
+        <xsl:if test="position() &gt; 1">
+          <xsl:text>, </xsl:text>
+        </xsl:if>
+        <xsl:value-of select="@name"/>
+      </xsl:for-each>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="macro" mode="generate.id">
+    <xsl:value-of select="@name"/>
+    <xsl:if test="count(key('named-entities',
+        translate(@name, $uppercase-letters, $lowercase-letters)))!=1">
+      <xsl:text>_</xsl:text>
+      <xsl:value-of select="generate-id(.)"/>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>
=======================================
***Additional files exist in this changeset.***

Other related posts:

  • » [boost-doc-zh] r382 committed - 升级至1.42.0,第八批,more/, tools/ 目录,除 doc/ 目录以外全部升级完成,doc/ 目录稍后以 qbk/xml 文件... - boost-doc-zh