[publican-list] Common Content with Sets

Jeff Fearn jfearn at redhat.com
Sat Aug 4 07:58:12 UTC 2012


On 08/01/2012 10:33 PM, Kendall Moore wrote:
> Hi Josh,
>
> Thanks for the response. Let me try to outline what I'm doing a bit
> better here.
>
> I am attempting to use the common section once in each book.  Inside of
> this section, there are sub-sections which have IDs that are referenced
> a few places in each book. Mostly in the sense that I say "Please refer
> to *here* for more detailed information" where here is a link to one of
> the IDs.
>
> And some code...
>
> <book id="Book_A">
> ...
>    <xi:include href="../common/Introduction.xml" />
>    <xi:include href="some_chapter_which_hrefs_intro.xml" />
> ...
> </book>
>
> <book id="Book_B">
> ...
>    <xi:include href="../common/Introduction.xml" />
>    <xi:include href="some_chapter_which_hrefs_intro.xml" />
> ...
> </book>
>
> For this example it may be possible to re-write the Introduction to
> better suit my needs and avoid this, but I will come across the same
> issue with another piece of shared code shortly and figured I may as
> well tackle the issue from the beginning.
>
> The errors I get when running publican have to do with being unable to
> load Introduction.xml because the IDs are already in use by the time the
> second book attempts to use it.

Hi Kendal, it's XSLT that is complaining about the duplicate IDs, 
publican is just passing them back.

This is a known limitation of stand alone sets. For distributed sets we 
have a work around, which is basically to run clean_ids on the temporary 
XML. It might be possible to do this for standalone sets but it almost 
never makes sense because you can't build books in standalone sets by 
themselves since the paths to the common files will break, and having 
the same introduction in multiple places in a single payload isn't great.

You might have more luck doing a distributed set if you really need to 
build the books standalone and in the set.

Cheers, Jeff.




More information about the publican-list mailing list