Martin Goik wrote:
> Switching from Xmlmind 3 to 4.1 shows a weird behavior when opening
> documents created with 3.6.2. The following example is a simplified
> version from an 3.6.2 created Docbooc 5 conformant instance:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <book version="5.0" xmlns="http://docbook.org/ns/docbook";
>       xmlns:xlink="http://www.w3.org/1999/xlink";
>       xmlns:xi="http://www.w3.org/2001/XInclude";
>       xmlns:svg="http://www.w3.org/2000/svg";
>       xmlns:ns="http://docbook.org/ns/docbook";
>       xmlns:mml="http://www.w3.org/1998/Math/MathML";
>       xmlns:html="http://www.w3.org/1999/xhtml";>
>   <info>
>         <orgname>Hdm</orgname>
>   </info>
>   <chapter>
>     <title>Some text</title>
>     <para>A paragraph.</para>
>   </chapter>
> </book>
> 
> If I now try to add a second chapter by hitting "ctrl-j" taking the
> existing chapter as the context node an empty "<chapter/> is inserted.
> But it does not contain a mandatory title plus a block level element as
> child nodes. So contrary to the old behavior the resulting document is
> invalid.

There is no bug and no regression here: with 
<info><orgname>Hdm</orgname></info>, XXE (v3.6 or v4 or v4.1) has 
switched to *lenient* editing mode (which means that XXE allows to 
insert any element).

Notice the jagged lines in the node path bar (see attached screen shots) 
which show you that XXE is at loss with an info element without title.

Excerpt of http://www.xmlmind.com/xmleditor/changes.html:
---
     If you need to add meta-info to a DocBook 5 book, please restrict 
yourself to replacing its title element by an info(title) template. Do 
not replace the title  element by info(no_title) and do not insert 
info(no_title) after the title element as this would cause XMLmind XML 
Editor to automatically switch to lenient mode.

     This limitation is specific to the title and meta-info of a book 
(because the title element is optional in info(title) which makes the 
content model truly ambiguous). There is no such problem for the title 
and meta-info of a chapter or a section.
---

See also 
http://www.xmlmind.com/xmleditor/_distrib/doc/rngsupport/friendly_content_models.html#unfriendly_content_models




> Even more strange: The new Xmlmind 4.1 creates a different dummy <info>
> namely:
> 
> ...
>   <info>
>     <title></title>
> 
>     <author>
>       <personname><firstname></firstname><surname></surname></personname>
> 
>       <affiliation>
>         <orgname></orgname>
>       </affiliation>
>     </author>
> 
>     <pubdate></pubdate>
>   </info>
> ...
> 
> Using this one works fine.

This change is a simple workaround for the above problem.




> On the other hand without asking authors to manually do the
> corresponding change older Docbook 5 instances cannot be edited.
> 

No, suffice to insert a title before orgname and then a #text in the 
title and XXE will automatically switch to strict editing mode. Of 
course, it is best to never, ever, use in your document templates a 
book/info element without a title.




> System: Xmlmind 4.1.0 running on linux , java version 1.5.0_16, Plugins
> see attached png file. Minor CSS and XSL modifications, no RelaxNG
> schema modifications from our side.
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lenient_mode1.png
Type: image/png
Size: 10305 bytes
Desc: not available
Url : 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20081114/e338bcd5/attachment.png
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lenient_mode2.png
Type: image/png
Size: 9012 bytes
Desc: not available
Url : 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20081114/e338bcd5/attachment-0001.png
 

Reply via email to