Re: Allow <info> as root element?
Thomas Schraitle <[email protected]> Wed, 30 Nov 2022 21:54:01 +0100
| Newsgroups | gmane.text.docbook.misc |
|---|---|
| Message-ID | <[email protected]> |
Hi,
On 30.11.22 14:05, Dave Pawson wrote:
>
>> Sure it can work. However, if I load a file with <info> as root, my XML=
editor
>> _will_ complain. To avoid it, I'm forced to either a) make a DocBook
>> customization and allow <info>, or b) wrap artificial structural DocBoo=
k
>> elements around. Both are problematic in their own ways as I was trying=
to explain.
>
> I simply don't see how? Docbook is flexible and RNG allows v.easy custom=
ization?
> If your editor doesn't do what you want, use another tool?
That's not the point. It's not about my XML editor, it's about the DocBook
schema that doesn't allow <info> as possible root element.
If I use the standard DocBook (without customization) I have the limitatio=
n
described above.
>>> [...]
>>>> Yes, technically possible, but still a restriction. Additionally, I'm=
forced to
>>>> add an XPointer expression into the <xi:include> element just to sele=
ct the
>>>> info. Sounds like a detour to me. :)
>
> Sorry, not to me. Never used xpointer for such.
> Unsure why you need to link into the 'external' info section, especially=
the way
> you say you want to use it?
See, you also agree it would be cumbersome. ;)
Let's assume I want to share an <info> element between different articles.=
We
use standard DocBook.
As standard DocBook doesn't allow <info> as root, I have to wrap some
artificial element around my <info>. Could be basically anything that is
possible as start element. Maybe we use <topic>:
=2D----[ metadata.xml ]
<topic>
<title>...</title>
<info xml:id=3D"metadata">
<!-- my metainformation that I want to share between my articles -->
</info>
</topic>
=2D----
In my real articles, I have to link to this artificial article.
=2D----
<article>
<title>...</title>
<xi:include href=3D"metadata.xml" xpointer=3D"metadata"/>
</article>
=2D----
Sure, if I remove the artificial <topic>, we could avoid this xpointer
attribute. However, that would render my metadata.xml in my XML editor as =
invalid.
>> XIncludes aren't the problem per se. Maybe it works for your documents.=
I'm
>> glad it works for you. But not all documents are the same. If we can't =
use
>> <info> as root, we are forced to do all sorts of workarounds. Perhaps i=
t was
>> always the case.
>
> But you can with one line of rng?
If you customize it, it's not DocBook anymore. :)
I've described a solution in another mail to Norm. Perhaps it would be nee=
ded
to create another, _official_ customization like the Publishers, ITS, and =
the
others that are offered. This schema could allow <info> as additional root
element. Problem solved, XML editor happy.
>> However, in terms of topic-oriented writing, it becomes annoying when y=
ou are
>> restricted by the schema.
>
> Which sounds like the schema is the problem?
Yes, that's what I'm saying. :-)
> Validation is a tool to use for your own workflow.
And...?
>> Probably it boils down to that DocBook allows many ways to process it. =
Some
>> produce valid results other invalid intermediate results or something i=
n
>> between. DocBook doesn't define one way to do it, for the better or wor=
se.
>
> For many of us (me included) it is for the better. I took the work the g=
roup did
> and adapted it for my use? Sounds like you could do the same and are qui=
te
> resistant to such adaptation?
I see the flexibility of DocBook also as an advantage. This flexibility wo=
rks
quite well with classic documentation which follows books or articles. How=
ever,
it falls a bit apart when you try to follow a more topic-oriented approach=
.
=2D-
Gru=C3=9F/Regards
Thomas Schraitle