Sanny Sanoff created ODFTOOLKIT-414:
---------------------------------------

             Summary: 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


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)

Reply via email to