Page 1 of 1

Separate legalnotice content into separate file?

Posted: Fri Jun 21, 2013 1:34 am
by eskwayrd
Hi,

I have several DocBook books that all share common <legalnotice> content. I'd like to separate the <legalnotice> content into a separate file and include it like I would a chapter. When the <legalnotice> content is included from the separate file, the Author view shows that it has been included, but when a book is transformed to PDF, the <legalnotice> content does not appear on the verso side of the cover. The <legalnotice> content does appear as expected when it is part of the book file, just not when included.

My legalnotice content is in a file "legal_notice.xml", with content like:

Code: Select all


<?xml version="1.0" encoding="UTFx-8"?>
<legalnotice>
<para>...</para>
</legalnotice>
and I include it in my books with:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://www.oasis-open.org/docbook/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>A Book</title>

<info>
<xi:include href="legalnotice.xml"/>
</info>

<!--- rest of book -->
</book>
I have also attempted to make the legalnotice.xml a chapter file, and use <xi:include href="legalnotice.xml" xpointer="legalnotice">. Again, the Author view shows that the targeted content is included, but not in a transformed PDF.

Any suggestions appreciated.

Re: Separate legalnotice content into separate file?

Posted: Fri Jun 21, 2013 5:48 pm
by sorin_ristache
Hi,
eskwayrd wrote:When the <legalnotice> content is included from the separate file, the Author view shows that it has been included, but when a book is transformed to PDF, the <legalnotice> content does not appear on the verso side of the cover. The <legalnotice> content does appear as expected when it is part of the book file, just not when included.
Do you mean that the content of the legal notice shows up in the PDF output when you include inline in the <book> element the legal notice content, but not when you include it using XInclude? If this is your case then please make sure you have XInclude processing enabled by going to menu Options -> Preferences -> XML -- XML Parser, the XInclude Options section. By default XInclude is enabled in Oxygen, so you disabled it at some point when using Oxygen.


Regards,
Sorin

Re: Separate legalnotice content into separate file?

Posted: Fri Jun 21, 2013 6:49 pm
by eskwayrd
sorin wrote: Do you mean that the content of the legal notice shows up in the PDF output when you include inline in the <book> element the legal notice content, but not when you include it using XInclude?
Yes.
sorin wrote: If this is your case then please make sure you have XInclude processing enabled by going to menu Options -> Preferences -> XML -- XML Parser, the XInclude Options section. By default XInclude is enabled in Oxygen, so you disabled it at some point when using Oxygen.
XInclude is enabled. All my chapter content is included into the <book> and appears in the transformed PDF.

Additional tinkering has resolved the issue. My legalnotice.xml preamble was incorrect. It should be:

Code: Select all


<?xml version="1.0" encoding="UTFx-8"?>
<legalnotice xmlns="http://docbook.org/ns/docbook">
oXygen considers this to be an error when viewing just legalnotice.xml, but appears to be valid when viewing the <book> file, and the <legalnotice> content is now included in the transformed PDF.