[
https://issues.apache.org/jira/browse/ODFTOOLKIT-414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123395#comment-15123395
]
Sanny Sanoff commented on ODFTOOLKIT-414:
-----------------------------------------
I don't have proper solution, because I don't have ODF toolkit project set up
nor do I have timeslice to get deep into detail and authors idea.
For fast solution, I removed "style:style" from mIncubatorElements set, this is
workaround that lets document parser complete without exception, that's it.
Regards,
San.
> ClassCast: OdfStyle cannot be OdfAttribute on some <style:column-sep> (maybe
> new openoffice?)
> ---------------------------------------------------------------------------------------------
>
> Key: ODFTOOLKIT-414
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-414
> Project: ODF Toolkit
> Issue Type: Bug
> Components: odfdom
> Affects Versions: 0.6.2-incubating
> Environment: any
> Reporter: Sanny Sanoff
> Labels: easyfix
>
> this part in content.xml causes the classcast:
> <style:column-sep style:width="0.002cm"
> style:color="#000000" style:height="100%" style:style="solid"/>
> this does not:
> <style:column-sep style:width="0.002cm"
> style:color="#000000" style:height="100%"/>
> Here is the source code (OdfXMLFactory.java):
> OdfAttribute attr = null;
> // lookup registered attribute class for qname
> Class attributeClass = getOdfAttributeClass(name);
> // if a class was registered create an instance of that class
> if (attributeClass != null) {
> // line 256:
> attr = (OdfAttribute) getNodeFromClass(dom,
> attributeClass);
> ^^^^^^^^^^^^^^^^^^^
> Here's the full stack trace:
> java.lang.ClassCastException:
> org.odftoolkit.odfdom.incubator.doc.style.OdfStyle cannot be cast to
> org.odftoolkit.odfdom.pkg.OdfAttribute
> at
> org.odftoolkit.odfdom.pkg.OdfXMLFactory.newOdfAttribute(OdfXMLFactory.java:256)
> at
> org.odftoolkit.odfdom.pkg.OdfFileDom.createAttributeNS(OdfFileDom.java:332)
> at
> org.odftoolkit.odfdom.pkg.OdfFileDom.createAttributeNS(OdfFileDom.java:322)
> at
> org.odftoolkit.odfdom.pkg.OdfFileSaxHandler.startElement(OdfFileSaxHandler.java:104)
> at
> org.odftoolkit.odfdom.pkg.rdfa.MultiContentHandler.startElement(MultiContentHandler.java:83)
> at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
> Source)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)