[
https://issues.apache.org/jira/browse/ODFTOOLKIT-414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123297#comment-15123297
]
Svante Schubert commented on ODFTOOLKIT-414:
--------------------------------------------
It might have something to do that there are two XML nodes with the same name,
but one is an attribute, the other an element
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-style_style
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#element-style_style
My guess is they were mistaken here.
I will finish my current patch before I start something aside, perhaps someone
can take a look into it meanwhile?
Thanks in advance.
Svante
> 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)