[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] DcBk assembly- contentonly=true - is including the meta-info of discarded subsuming root element - Is this correct behavior?
Hi Otto,My understanding is that contentonly strips off the root element; omittitles strips the titles from the resource. See e.g.
http://tdg.docbook.org/tdg/5.1/module.htmlHowever, when you're using contentonly and omittitles to aggregate several resources into a single module, there is still a problem with spurious info elements appearing in the output. I raised an issue on this back in March:
https://github.com/docbook/xslt10-stylesheets/issues/26 I also submitted a pull request to fix this: https://github.com/docbook/xslt10-stylesheets/pull/30 I think this is related to the problem you describe.(I'm finding it hard to think of cases when an author would need separate contentonly and omittitles functionality. When you're aggregating several resources into a single module, contentonly would always imply omittitles, for the second and subsequent resources anyway.)
Cheers -- Simon Dew simonjabadaw@gmail.com https://janiveer.github.io On 21/09/17 19:42, Otto Hirr wrote:
Greetings, I am beginning to use DocBook Assemblies. I may have a misunderstanding of "contentonly" attribute of "module" element. The //contentonly="true"// seems to pull in the meta info of the subsuming "topic" 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. By way of running the sample topics and assemble shown below, it seems the implementation of //contentonly="true"//, is simply to discard the root element, "topic". This would be a strict elimination of the subsuming element, "topic." However this simplistic kind of implementation would then leave the info which is a meta-detail of the now-discarded "topic" element. This results in an invalid docbook file. (Below I give two topics, an assemble, the output generated, and the output I would have expected.) (My understanding is that OxygenXMLv19 is providing 1.79.2, which is the environment in which I ran this sample file set.) It would seem that the logical complete implementation would be to discard the topic-root-element and any accompanying meta details of the info-element which is associated with the topic-root-element. Please correct any misunderstanding I have, still very much a beginner of DocBook. Also, should there be an xml:base generated for each item that is transcluded (if that is the correct term)? Best regards, ..Otto ====Topic1====file:prob1-topic1.xml====> <?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> <====Topic1==== ====Topic2====file:prob1-topic2.xml====> <?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> <====Topic2==== ====Assembly====file:prob1-assy1.xml> <?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> <====Assembly==== ====Result====> <?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> <====Result==== ====Result of what I thought should be generated====> <?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> <====Result of what I thought should be generated==== --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]