Rishi Khan wrote:
> When trying to add an 'info' section to a docbook5 document, XXE does 
> not list allowed elements. To reproduce this problem:
> 1) Open new Docbook5 book file
> 2) Select the 'title' element under the book
> 3) Choose 'Insert After'.
> 4) Choose 'info' element from the list.
> 5) Select 'info' element.
> 6) Choose 'Insert After'.

No, select "Insert" (i.e. insert into) because the newly inserted info 
element is completely empty.

Note that the newly inserted info element is underlined using a jagged 
red line in the node path bar.

You'll see
---
(text)
*
---
listed in the Edit tool.



> 7) There are no options. It should say:
> abstract, address, annotation, artpagenums, author, authorgroup, 
> authorinitials, bibliocoverage, biblioid, bibliomisc, bibliomset, 
> bibliorelation, biblioset, bibliosource, collab, confgroup, contractnum, 
> contractsponsor, copyright, cover, date, edition, editor, extendedlink, 
> issuenum, itermset, keywordset, legalnotice, mediaobject, org, orgname, 
> othercredit, pagenums, printhistory, productname, productnumber, 
> pubdate, publisher, publishername, releaseinfo, revhistory, 
> seriesvolnums, subjectset, volumenum.

No. Such elements are allowed inside an info element and not after it.




> 
> 
> What is the problem?

A hard to solve one (I'm not talking about the fact that you used 
"Insert After" instead of "Insert").

DocBook 5 has several info elements all having different content models. 
When confronted with such info elements, XMLmind XML Editor is more or 
less lost and enters into lenient mode (until the ambiguity has been 
removed by the user).

In lenient mode, XMLmind XML Editor is no longer able to suggest the 
right child elements. The user needs to specify herself the contents of 
the ambiguous element in every possible detail (which tedious, 
unintuitive, error prone, etc).

The solution is to add to docbook5.xxe these templates for the info element:

---
   <elementTemplate name="title" selectable="override">
     <info xmlns="http://docbook.org/ns/docbook";>
       <title></title>
       <author><personname></personname></author>
       <pubdate></pubdate>
     </info>
   </elementTemplate>

   <elementTemplate name="no_title" selectable="override">
     <info xmlns="http://docbook.org/ns/docbook";>
       <author><personname></personname></author>
       <pubdate></pubdate>
     </info>
   </elementTemplate>
---

(We did that for imagedata and indexterm and forgot to do that for info.)

Now, when a title element (of a book, but also of a chapter or a 
section) is not sufficient, you can replace it with an info (having a 
title)or insert an info (having no title) after it.

This works 100% intuitively for chapter/title and section/title, but not 
for book/title because book has a truly ambiguous overall content model 
(a book can have no title at all! Probably a mistake in the RELAX NG 
schema).

For book/title, select the title and replace it by info(title). The 
other option, Insert info(no_title) after the title is still considered 
to be ambiguous by XMLmind XML Editor, so don't use it.










Reply via email to