On 06/16/2011 05:55 PM, Boris Goldowsky wrote:
> I'm seeing a crash on the XML file below. Tried with several versions
> of XXE, including 4.6 pro and 4.9.1 personal, using the DTBook
> extension, and keep getting the same error. I trimmed down the XML to a
> close-to-minimal valid file that shows the problem.
>
> Backtrace that I am seeing starts with:
>
> Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
> com.xmlmind.xmledit.styledview.DivisionVP cannot be cast to
> com.xmlmind.xmledit.styledgadget.Paragraph
> at
> com.xmlmind.xmledit.styledview.InlineGroupView.appendGadgets(InlineGroupView.java:117)
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE dtbook PUBLIC "-//NISO//DTD dtbook 2005-2//EN"
> "http://www.daisy.org/z3986/2005/dtbook-2005-2.dtd">
> <dtbook xmlns="http://www.daisy.org/z3986/2005/dtbook/" version="2005-2"
> xml:lang="En-US">
> <head>
> </head>
> <book>
> <bodymatter>
> <level1>
> <h1>LESSON 1</h1>
> <list type="ol" enum="1">
> <li>List:
> <list type="ul">
> <li><lic>*</lic> Conservation<pagenum id="p006"
> page="normal">6</pagenum></li>
> <li><lic>*</lic> Minimizing the carbon footprint of the site</li>
> </list>
> </li>
> </list>
> </level1>
> </bodymatter>
> </book>
> </dtbook>
>
>
> Any clues what's wrong here? The XML is valid, as far as I can see, and
> the extension has loaded lots of other DTBook files properly.
>
Well, you have uncovered a bug because XXE is never supposed to raise a
ClassCastException.
We have made the piece of code (InlineGroupView) which raised this
exception more robust. The bug fix will be found in the next release of XXE.
This exception was caused by the following excerpts from dtbook.css:
---
li:contains-element(lic) {
display: table-row;
}
lic {
display: table-cell;
}
---
Replacing the above styles by something simpler suffices to workaround
this bug:
---
li:contains-element(lic) {
display: block;
}
lic {
display: inline;
}
---
This being said, we strongly advise you not to use "display:table-row;"
for any element whose parent is not itself "display:table;". Doing so is
still likely to crash XXE. Moreover the way XXE renders this use of
"display:table-row;" is unpredictable.
---
PS: I had to replace :
---
@import url("xxe-config:xhtml/css/xhtml_table.imp");
---
by:
---
@import url("xxe-config:common/css/xhtml_table.imp");
---
See http://www.xmlmind.com/xmleditor/changes.html#v4.8.0
---
Incompatibilities:
...
The support code and the CSS stylesheets for CALS tables and for XHTML
forms and tables are now found in XXE_install_dir/addon/config/common/.
Previously, these resources were found in
XXE_install_dir/addon/config/docbook/ and in
XXE_install_dir/addon/config/xhtml/. These changes should be
transparent, unless you reference these resources in your own custom
configurations.
...
---
---
PPS: The following new facility added to v4.9.1 cannot help you in
styling an li element containing zero or more lic elements.
http://www.xmlmind.com/xmleditor/changes.html#v4.9.1
---
Extension property column-count allows to render repeating elements as a
table and this, even when the element acting as table does not contain
child elements acting as table rows. That is, the element acting as
table directly contains child elements acting as table cells. When this
is the case, XXE has to automatically generate anonymous table rows.
---
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support