Docbook assembly contentonly - problem(?)
Posted: Wed Sep 20, 2017 11:29 pm
Greetings,
Beginning to use DocBook Assemblies.
The contentonly="true" seems to pull in the meta info of the subsuming element. I was under impression from another source that the contentonly would pull in the content of the subsuming element without the meta-information of the subsuming element.
Sample: 2 topics and 1 assembly as follows:
topic1:
topic2:
assembly:
Which generates the following:
The info elements of the included topics should not be there, as I understand.
I thought the correct output would be similar to the following:
It seems the implementation of contentonly=true is simply to discard the root element, topic. However this simplistic kind of implementation would then leave the info which is a meta-detail of the now-discarded root element.
It would seem that the logical complete implementation would be to discard the root-element and any accompanying meta details of the info-element which is associated with the root-element.
Please correct any misunderstanding I have, still very much a beginner.
Also, should there be an xml:base generated for each item that is transcluded (if that is the correct term)?
Best regards,
..Otto
Beginning to use DocBook Assemblies.
The contentonly="true" seems to pull in the meta info of the subsuming element. I was under impression from another source that the contentonly would pull in the content of the subsuming element without the meta-information of the subsuming element.
Sample: 2 topics and 1 assembly as follows:
topic1:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.1/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.1/sch/docbook.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<topic xml:id="t1" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.1" >
<info> <title>prob1-topic1</title> </info>
<para>Paragraph contained in topic #1.</para>
</topic>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.1/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.1/sch/docbook.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<topic xml:id="t2" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.1" >
<info> <title>prob1-topic2</title> </info>
<para>Paragraph contained in topic #2.</para>
</topic>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.1/rng/assembly.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.1/sch/assembly.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<assembly version="5.1" xmlns="http://docbook.org/ns/docbook">
<resources>
<resource href="prob1-topic1.xml" xml:id="topic1"/>
<resource href="prob1-topic2.xml" xml:id="topic2"/>
</resources>
<structure renderas="book">
<merge><title>Book title of sample assembly of topics</title></merge>
<module renderas="chapter" xml:id="chapter1">
<merge><title>Title of first chapter</title></merge>
<module contentonly="true" resourceref="topic1"/>
<module contentonly="true" resourceref="topic2"/>
</module>
</structure>
</assembly>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook" version="5.1">
<info>
<title>Book title of sample assembly of topics</title>
</info>
<chapter xml:id="chapter1">
<info>
<title>Title of first chapter</title>
</info>
<info xmlns:xlink="http://www.w3.org/1999/xlink">
<title>prob1-topic1</title>
</info>
<para xmlns:xlink="http://www.w3.org/1999/xlink">Paragraph contained in topic #1.</para>
<info xmlns:xlink="http://www.w3.org/1999/xlink">
<title>prob1-topic2</title>
</info>
<para xmlns:xlink="http://www.w3.org/1999/xlink">Paragraph contained in topic #2.</para>
</chapter>
</book>
I thought the correct output would be similar to the following:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook" version="5.1">
<info>
<title>Book title of sample assembly of topics</title>
</info>
<chapter xml:id="chapter1">
<info>
<title>Title of first chapter</title>
</info>
<para xmlns:xlink="http://www.w3.org/1999/xlink">Paragraph contained in topic #1.</para>
<para xmlns:xlink="http://www.w3.org/1999/xlink">Paragraph contained in topic #2.</para>
</chapter>
</book>
It would seem that the logical complete implementation would be to discard the root-element and any accompanying meta details of the info-element which is associated with the root-element.
Please correct any misunderstanding I have, still very much a beginner.
Also, should there be an xml:base generated for each item that is transcluded (if that is the correct term)?
Best regards,
..Otto