Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75766 - in trunk/tools/quickbook: src test test/xinclude test/xinclude/sub
From: dnljms_at_[hidden]
Date: 2011-12-01 19:05:19


Author: danieljames
Date: 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
New Revision: 75766
URL: http://svn.boost.org/trac/boost/changeset/75766

Log:
Quickbook: Fix xmlbase and xinclude path handling.
Added:
   trunk/tools/quickbook/test/xinclude/
   trunk/tools/quickbook/test/xinclude/Jamfile.v2 (contents, props changed)
   trunk/tools/quickbook/test/xinclude/sub/
   trunk/tools/quickbook/test/xinclude/sub/stub.xml (contents, props changed)
   trunk/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold
      - copied, changed from r75759, /trunk/tools/quickbook/test/xinclude-1_1.gold
   trunk/tools/quickbook/test/xinclude/xinclude-1_1.gold (contents, props changed)
      - copied, changed from r75759, /trunk/tools/quickbook/test/xinclude-1_1.gold
   trunk/tools/quickbook/test/xinclude/xinclude-1_1.quickbook (contents, props changed)
   trunk/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold
      - copied, changed from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.gold
   trunk/tools/quickbook/test/xinclude/xmlbase1-1_6.gold
      - copied, changed from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.gold
   trunk/tools/quickbook/test/xinclude/xmlbase1-1_6.quickbook
      - copied, changed from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.quickbook
   trunk/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold
      - copied, changed from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.gold
   trunk/tools/quickbook/test/xinclude/xmlbase2-1_6.gold (contents, props changed)
      - copied, changed from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.gold
   trunk/tools/quickbook/test/xinclude/xmlbase2-1_6.quickbook (contents, props changed)
      - copied, changed from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.quickbook
Removed:
   trunk/tools/quickbook/test/xinclude-1_1.gold
   trunk/tools/quickbook/test/xinclude-1_1.quickbook
   trunk/tools/quickbook/test/xmlbase-1_6.gold
   trunk/tools/quickbook/test/xmlbase-1_6.quickbook
Text files modified:
   trunk/tools/quickbook/src/actions.cpp | 7 ++++---
   trunk/tools/quickbook/test/Jamfile.v2 | 3 +--
   trunk/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold | 4 +++-
   trunk/tools/quickbook/test/xinclude/xinclude-1_1.gold | 4 +++-
   trunk/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold | 4 +++-
   trunk/tools/quickbook/test/xinclude/xmlbase1-1_6.gold | 4 +++-
   trunk/tools/quickbook/test/xinclude/xmlbase1-1_6.quickbook | 2 ++
   trunk/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold | 6 ++++--
   trunk/tools/quickbook/test/xinclude/xmlbase2-1_6.gold | 6 ++++--
   trunk/tools/quickbook/test/xinclude/xmlbase2-1_6.quickbook | 4 +++-
   10 files changed, 30 insertions(+), 14 deletions(-)

Modified: trunk/tools/quickbook/src/actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions.cpp (original)
+++ trunk/tools/quickbook/src/actions.cpp 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -1708,18 +1708,19 @@
     xinclude_path calculate_xinclude_path(value const& p, quickbook::actions& actions)
     {
         fs::path path = check_path(p, actions);
+ fs::path full_path = path;
 
         // If the path is relative
         if (!path.has_root_directory())
         {
             // Resolve the path from the current file
- path = actions.current_file->path.parent_path() / path;
+ full_path = actions.current_file->path.parent_path() / path;
 
             // Then calculate relative to the current xinclude_base.
- path = path_difference(actions.xinclude_base, path);
+ path = path_difference(actions.xinclude_base, full_path);
         }
 
- return xinclude_path(path, detail::escape_uri(detail::path_to_generic(path)));
+ return xinclude_path(full_path, detail::escape_uri(detail::path_to_generic(path)));
     }
 
     void xinclude_action(quickbook::actions& actions, value xinclude)

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -17,6 +17,7 @@
 build-project snippets ;
 build-project "include" ;
 build-project versions ;
+build-project xinclude ;
 
 import quickbook-testing : quickbook-test quickbook-error-test ;
 
@@ -107,8 +108,6 @@
     [ quickbook-error-test version-0_1-fail ]
     [ quickbook-error-test version-1_7-fail ]
     [ quickbook-error-test version-2_0-fail ]
- [ quickbook-test xinclude-1_1 : : : <quickbook-xinclude-base>../src ]
- [ quickbook-test xmlbase-1_6 : : : <quickbook-xinclude-base>../src ]
     [ quickbook-test xml_escape-1_2 ]
     [ quickbook-test xml_escape-1_5 ]
 

Deleted: trunk/tools/quickbook/test/xinclude-1_1.gold
==============================================================================
--- trunk/tools/quickbook/test/xinclude-1_1.gold 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
+++ (empty file)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<article id="include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
- <title>Include</title>
- <xi:include href="../test/stub.xml" />
-</article>

Deleted: trunk/tools/quickbook/test/xinclude-1_1.quickbook
==============================================================================
--- trunk/tools/quickbook/test/xinclude-1_1.quickbook 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
+++ (empty file)
@@ -1,3 +0,0 @@
-[article Include]
-
-[xinclude stub.xml]

Added: trunk/tools/quickbook/test/xinclude/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/xinclude/Jamfile.v2 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2005 João Abecasis
+#
+# 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)
+#
+
+project test/xinclude
+ : requirements
+ <toolset>msvc:<debug-symbols>off
+ ;
+
+import quickbook-testing : quickbook-test quickbook-error-test ;
+
+path-constant xinclude_base1 : ../.. ;
+path-constant xinclude_base2 : sub ;
+
+test-suite quickbook.test :
+ [ quickbook-test xinclude-1_1 : : : <quickbook-xinclude-base>$(xinclude_base1) ]
+ [ quickbook-test xmlbase1-1_6 : : : <quickbook-xinclude-base>$(xinclude_base1) ]
+ [ quickbook-test xmlbase2-1_6 : : : <quickbook-xinclude-base>$(xinclude_base1) ]
+ [ quickbook-test xinclude-1_1-alt : xinclude-1_1.quickbook : xinclude-1_1-alt.gold : <quickbook-xinclude-base>$(xinclude_base2) ]
+ [ quickbook-test xmlbase1-1_6-alt : xmlbase1-1_6.quickbook : xmlbase1-1_6-alt.gold : <quickbook-xinclude-base>$(xinclude_base2) ]
+ [ quickbook-test xmlbase2-1_6-alt : xmlbase2-1_6.quickbook : xmlbase2-1_6-alt.gold : <quickbook-xinclude-base>$(xinclude_base2) ]
+ ;

Added: trunk/tools/quickbook/test/xinclude/sub/stub.xml
==============================================================================

Copied: trunk/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold (from r75759, /trunk/tools/quickbook/test/xinclude-1_1.gold)
==============================================================================
--- /trunk/tools/quickbook/test/xinclude-1_1.gold (original)
+++ trunk/tools/quickbook/test/xinclude/xinclude-1_1-alt.gold 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -2,5 +2,7 @@
 <!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
 <article id="include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>Include</title>
- <xi:include href="../test/stub.xml" />
+ <xi:include href="../../stub.xml" />
+ <xi:include href="../stub.xml" />
+ <xi:include href="stub.xml" />
 </article>

Copied: trunk/tools/quickbook/test/xinclude/xinclude-1_1.gold (from r75759, /trunk/tools/quickbook/test/xinclude-1_1.gold)
==============================================================================
--- /trunk/tools/quickbook/test/xinclude-1_1.gold (original)
+++ trunk/tools/quickbook/test/xinclude/xinclude-1_1.gold 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -2,5 +2,7 @@
 <!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
 <article id="include" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>Include</title>
- <xi:include href="../test/stub.xml" />
+ <xi:include href="test/stub.xml" />
+ <xi:include href="test/xinclude/stub.xml" />
+ <xi:include href="test/xinclude/sub/stub.xml" />
 </article>

Added: trunk/tools/quickbook/test/xinclude/xinclude-1_1.quickbook
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/xinclude/xinclude-1_1.quickbook 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -0,0 +1,5 @@
+[article Include]
+
+[xinclude ../stub.xml]
+[xinclude stub.xml]
+[xinclude sub/stub.xml]

Copied: trunk/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold (from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.gold)
==============================================================================
--- /trunk/tools/quickbook/test/xmlbase-1_6.gold (original)
+++ trunk/tools/quickbook/test/xinclude/xmlbase1-1_6-alt.gold 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
 <article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
- xml:base="../test" xmlns:xi="http://www.w3.org/2001/XInclude">
+ xml:base=".." xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>XInclude with xmlbase</title>
+ <xi:include href="../stub.xml" />
   <xi:include href="stub.xml" />
+ <xi:include href="sub/stub.xml" />
 </article>

Copied: trunk/tools/quickbook/test/xinclude/xmlbase1-1_6.gold (from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.gold)
==============================================================================
--- /trunk/tools/quickbook/test/xmlbase-1_6.gold (original)
+++ trunk/tools/quickbook/test/xinclude/xmlbase1-1_6.gold 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
 <article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
- xml:base="../test" xmlns:xi="http://www.w3.org/2001/XInclude">
+ xml:base="test/xinclude" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>XInclude with xmlbase</title>
+ <xi:include href="../stub.xml" />
   <xi:include href="stub.xml" />
+ <xi:include href="sub/stub.xml" />
 </article>

Copied: trunk/tools/quickbook/test/xinclude/xmlbase1-1_6.quickbook (from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.quickbook)
==============================================================================
--- /trunk/tools/quickbook/test/xmlbase-1_6.quickbook (original)
+++ trunk/tools/quickbook/test/xinclude/xmlbase1-1_6.quickbook 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -3,4 +3,6 @@
 [xmlbase .]
 ]
 
+[xinclude ../stub.xml]
 [xinclude stub.xml]
+[xinclude sub/stub.xml]

Copied: trunk/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold (from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.gold)
==============================================================================
--- /trunk/tools/quickbook/test/xmlbase-1_6.gold (original)
+++ trunk/tools/quickbook/test/xinclude/xmlbase2-1_6-alt.gold 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
 <article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
- xml:base="../test" xmlns:xi="http://www.w3.org/2001/XInclude">
+ xml:base="../../include" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>XInclude with xmlbase</title>
- <xi:include href="stub.xml" />
+ <xi:include href="../stub.xml" />
+ <xi:include href="../xinclude/stub.xml" />
+ <xi:include href="../xinclude/sub/stub.xml" />
 </article>

Copied: trunk/tools/quickbook/test/xinclude/xmlbase2-1_6.gold (from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.gold)
==============================================================================
--- /trunk/tools/quickbook/test/xmlbase-1_6.gold (original)
+++ trunk/tools/quickbook/test/xinclude/xmlbase2-1_6.gold 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
 <article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
- xml:base="../test" xmlns:xi="http://www.w3.org/2001/XInclude">
+ xml:base="test/include" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>XInclude with xmlbase</title>
- <xi:include href="stub.xml" />
+ <xi:include href="../stub.xml" />
+ <xi:include href="../xinclude/stub.xml" />
+ <xi:include href="../xinclude/sub/stub.xml" />
 </article>

Copied: trunk/tools/quickbook/test/xinclude/xmlbase2-1_6.quickbook (from r75759, /trunk/tools/quickbook/test/xmlbase-1_6.quickbook)
==============================================================================
--- /trunk/tools/quickbook/test/xmlbase-1_6.quickbook (original)
+++ trunk/tools/quickbook/test/xinclude/xmlbase2-1_6.quickbook 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
@@ -1,6 +1,8 @@
 [article XInclude with xmlbase
 [quickbook 1.6]
-[xmlbase .]
+[xmlbase ../include]
 ]
 
+[xinclude ../stub.xml]
 [xinclude stub.xml]
+[xinclude sub/stub.xml]

Deleted: trunk/tools/quickbook/test/xmlbase-1_6.gold
==============================================================================
--- trunk/tools/quickbook/test/xmlbase-1_6.gold 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
+++ (empty file)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<article id="xinclude_with_xmlbase" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
- xml:base="../test" xmlns:xi="http://www.w3.org/2001/XInclude">
- <title>XInclude with xmlbase</title>
- <xi:include href="stub.xml" />
-</article>

Deleted: trunk/tools/quickbook/test/xmlbase-1_6.quickbook
==============================================================================
--- trunk/tools/quickbook/test/xmlbase-1_6.quickbook 2011-12-01 19:05:17 EST (Thu, 01 Dec 2011)
+++ (empty file)
@@ -1,6 +0,0 @@
-[article XInclude with xmlbase
-[quickbook 1.6]
-[xmlbase .]
-]
-
-[xinclude stub.xml]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk