Bug 56730 - [Patch] NPE occurs when exporting a xslx as an XML if attached schema contains ref elements
Summary: [Patch] NPE occurs when exporting a xslx as an XML if attached schema contain...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.11-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2014-07-16 14:48 UTC by Marc
Modified: 2014-08-28 21:41 UTC (History)
0 users



Attachments
Fixes NPE when exporting xml schema containing elements with ref attributes (8.19 KB, application/x-gzip)
2014-07-16 14:50 UTC, Marc
Details
This is the right attachment (7.91 KB, application/x-gzip)
2014-07-16 15:00 UTC, Marc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc 2014-07-16 14:48:23 UTC
A NPE occurs when exporting a xslx as an XML document if the attached schema contains ref elements. 

Here is an example of a xml schema which POI can't handle beacause of the xs:element ref attribute

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:element name="Entry" type="Type_Entry"/>
    <xs:complexType name="Type_Entry">
        <xs:sequence>
             <xs:element ref="REFELEMENT" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:element name="REFELEMENT" type="xs:double"/>

</xs:schema>

I'm going to provide a patch for this issue.
Comment 1 Marc 2014-07-16 14:50:13 UTC
Created attachment 31819 [details]
Fixes NPE when exporting xml schema containing elements with ref attributes
Comment 2 Marc 2014-07-16 15:00:26 UTC
Created attachment 31820 [details]
This is the right attachment
Comment 3 Dominik Stadler 2014-08-28 21:41:58 UTC
Thanks for the patch, this is fixed for 3.11 via r1621209.