Re: Is it possible?
Hussein Shafie <[email protected]>
| Newsgroups | gmane.editors.xxe.general |
|---|---|
| Message-ID | <[email protected]> |
On 11/28/20 10:40 AM, Pere Porta Roca wrote: > I have written 10 book documents, everyone at its own (in an independent > way from one other). > Now, I'm considering to gather 5 of them in order to issue a single > book, with its page numbering of the whole, and the other 5 in another > single book also with its own pagination. > > The number of pages of everyone of the two resulting books is about 600 > pages. > > Is this possible to do? May be. See PREREQUISITES at the very end of this email. > And if yes, how do I do it? > Your question is not related to our product XMLmind XML Editor (XXE). It's a question about DocBook. However I'll do my best to help you. --> At first, I thought about DocBook element <set>. A <set> is a collection of books. See https://tdg.docbook.org/tdg/5.1/set.html Having never used a <set> before. I gave it a try and it works except that each "simple" book has its own page numbering. See attached (DocBook 5.1) sample: book1.xml, book2.xml, mybooks.xml, mybooks.pdf --> Second idea: create a "super" book having <part> elements and assuming that your "simple" books does not have <part>s, 0) Start XXE and turn on option "Allow Advanced Use Of XInclude", found in Options|Preferences, Edit section. See http://www.xmlmind.com/xmleditor/_distrib/doc/help/editOptions.html#allowAdvancedXInclude 1) Use "File|New" to create a book. Replace first <chapter> of this new book by a <part> using the "Edit" tool. 2) Create one <part> for each your "simple" books in the "super" book. 3) Save this "super" book to disk. Example: attached empy_superbook.xml 4) Open each "simple" book in XXE. 5) Select all the chapters of the "simple" book. 6) Use Ctrl+Shift-C to copy them by reference. 7) Switch to the "super" book and select all the <chapter> children of a <part>. 8) Use Ctrl-V to paste there a reference to all the chapters you have copied during step (4). 9) Repeat (4) to (8) for each your "simple" books. I tried this and it gave me a result which may be close to what you want. See attached superbook.xml, superbook.pdf. ========================================================================== PREREQUISITES FOR THIS TO WORK - All your "simple" books have have exactly the same document type, that is, all DocBook 4.5 OR all DocBook 5.0 OR all DocBook 5.1. - All your "simple" books must comprise <chapter>s and not <part>s. - Have a good knowledge of XMLmind XML Editor (selection of a range of elements, copy by reference, etc). ========================================================================== -- XMLmind XML Editor Support List [email protected] http://www.xmlmind.com/mailman/listinfo/xmleditor-support
book1.xml
(text/xml, 1.7 KB)
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.1" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title>My first book</title>
<author>
<personname><firstname>Hussein</firstname><surname>Shafie</surname></personname>
<affiliation>
<orgname>XMLmind Software</orgname>
<address><street>35 rue Louis Leblanc</street>,
<postcode>78120</postcode> <city>Rambouillet</city>,
<country>France</country>,
Phone: <phone>+33 (0)</phone>9 52 80 80 37,
Web: <otheraddr><link xlink:href="http://www.xmlmind.com/xmleditor/">www.xmlmind.com/xmleditor</link></otheraddr>
Email: <email>[email protected]</email> (public mailing list)</address>
</affiliation>
</author>
<pubdate>November 30, 2020</pubdate>
<abstract>
<para>This is my first book.</para>
</abstract>
</info>
<chapter>
<title>First chapter</title>
<section>
<title>First section</title>
<para>First paragraph.</para>
</section>
</chapter>
<chapter>
<title>Second chapter</title>
<section>
<title>First section</title>
<para>First paragraph.</para>
</section>
</chapter>
<chapter>
<title>Third chapter</title>
<section>
<title>First section</title>
<para>First paragraph.</para>
</section>
</chapter>
</book>
book2.xml
(text/xml, 1.8 KB)
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.1" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title>My <emphasis>second</emphasis> book</title>
<author>
<personname><firstname>Hussein</firstname><surname>Shafie</surname></personname>
<affiliation>
<orgname>XMLmind Software</orgname>
<address><street>35 rue Louis Leblanc</street>,
<postcode>78120</postcode> <city>Rambouillet</city>,
<country>France</country>,
Phone: <phone>+33 (0)</phone>9 52 80 80 37,
Web: <otheraddr><link xlink:href="http://www.xmlmind.com/xmleditor/">www.xmlmind.com/xmleditor</link></otheraddr>
Email: <email>[email protected]</email> (public mailing list)</address>
</affiliation>
</author>
<pubdate>November 30, 2020</pubdate>
<abstract>
<para>This is my <emphasis>second</emphasis> book.</para>
</abstract>
</info>
<chapter>
<title>First chapter</title>
<section>
<title>First section</title>
<para>First paragraph.</para>
</section>
</chapter>
<chapter>
<title>Second chapter</title>
<section>
<title>First section</title>
<para>First paragraph.</para>
</section>
</chapter>
<chapter>
<title>Third chapter</title>
<section>
<title>First section</title>
<para>First paragraph.</para>
</section>
</chapter>
</book>
empy_superbook.xml
(text/xml, 1.4 KB)
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.1" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title/>
<author>
<personname><firstname/><surname/></personname>
<affiliation>
<orgname/>
</affiliation>
</author>
<pubdate/>
</info>
<part>
<title/>
<chapter>
<title/>
<section>
<title/>
<para/>
</section>
</chapter>
</part>
<part>
<title/>
<chapter>
<title/>
<section>
<title/>
<para/>
</section>
</chapter>
</part>
<part>
<title/>
<chapter>
<title/>
<section>
<title/>
<para/>
</section>
</chapter>
</part>
<part>
<title/>
<chapter>
<title/>
<section>
<title/>
<para/>
</section>
</chapter>
</part>
<part>
<title/>
<chapter>
<title/>
<section>
<title/>
<para/>
</section>
</chapter>
</part>
</book>
mybooks.pdf
(application/pdf, 47 KB) - not displayed
mybooks.xml
(text/xml, 1.3 KB)
<?xml version="1.0" encoding="UTF-8"?>
<set version="5.1" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title>My set of books</title>
<author>
<personname><firstname>Hussein</firstname><surname>Shafie</surname></personname>
<affiliation>
<orgname>XMLmind Software</orgname>
<address><street>35 rue Louis Leblanc</street>,
<postcode>78120</postcode> <city>Rambouillet</city>,
<country>France</country>,
Phone: <phone>+33 (0)</phone>9 52 80 80 37,
Web: <otheraddr><link xlink:href="http://www.xmlmind.com/xmleditor/">www.xmlmind.com/xmleditor</link></otheraddr>
Email: <email>[email protected]</email> (public mailing list)</address>
</affiliation>
</author>
<pubdate>November 30, 2020</pubdate>
<abstract>
<para>This is my set of books.</para>
</abstract>
</info>
<xi:include href="book1.xml" xpointer="element(/1)"/>
<xi:include href="book2.xml" xpointer="element(/1)"/>
</set>
superbook.pdf
(application/pdf, 44.4 KB) - not displayed
superbook.xml
(text/xml, 3.1 KB)
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.1" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title>My "super" book</title>
<author>
<personname><firstname>Hussein</firstname><surname>Shafie</surname></personname>
<affiliation>
<orgname>XMLmind Software</orgname>
<address><street>35 rue Louis Leblanc</street>,
<postcode>78120</postcode> <city>Rambouillet</city>,
<country>France</country>,
Phone: <phone>+33 (0)</phone>9 52 80 80 37,
Web: <otheraddr><link xlink:href="http://www.xmlmind.com/xmleditor/">www.xmlmind.com/xmleditor</link></otheraddr>
Email: <email>[email protected]</email> (public mailing list)</address>
</affiliation>
</author>
<pubdate>November 30, 2020</pubdate>
<abstract>
<para>This is my "super" book.</para>
</abstract>
</info>
<part>
<info>
<title>My first book</title>
<author>
<personname><firstname>Hussein</firstname><surname>Shafie</surname></personname>
<affiliation>
<orgname>XMLmind Software</orgname>
<address><street>35 rue Louis Leblanc</street>,
<postcode>78120</postcode> <city>Rambouillet</city>,
<country>France</country>,
Phone: <phone>+33 (0)</phone>9 52 80 80 37,
Web: <otheraddr><link xlink:href="http://www.xmlmind.com/xmleditor/">www.xmlmind.com/xmleditor</link></otheraddr>
Email: <email>[email protected]</email> (public mailing list)</address>
</affiliation>
</author>
<pubdate>November 30, 2020</pubdate>
<abstract>
<para>This is my first book.</para>
</abstract>
</info>
<xi:include href="book1.xml"
xpointer="xpointer(/*/*[position() >= 2 and position() <= last()])"/>
</part>
<part>
<info>
<title>My <emphasis>second</emphasis> book</title>
<author>
<personname><firstname>Hussein</firstname><surname>Shafie</surname></personname>
<affiliation>
<orgname>XMLmind Software</orgname>
<address><street>35 rue Louis Leblanc</street>,
<postcode>78120</postcode> <city>Rambouillet</city>,
<country>France</country>,
Phone: <phone>+33 (0)</phone>9 52 80 80 37,
Web: <otheraddr><link xlink:href="http://www.xmlmind.com/xmleditor/">www.xmlmind.com/xmleditor</link></otheraddr>
Email: <email>[email protected]</email> (public mailing list)</address>
</affiliation>
</author>
<pubdate>November 30, 2020</pubdate>
<abstract>
<para>This is my <emphasis>second</emphasis> book.</para>
</abstract>
</info>
<xi:include href="book2.xml"
xpointer="xpointer(/*/*[position() >= 2 and position() <= last()])"/>
</part>
</book>