Bug 47616 - Schema element is saved without standard namespace
Summary: Schema element is saved without standard namespace
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-31 07:55 UTC by Roberto Manicardi
Modified: 2015-07-07 20:04 UTC (History)
0 users



Attachments
The original XLSX file (13.04 KB, application/octet-stream)
2009-07-31 07:55 UTC, Roberto Manicardi
Details
The file modified by POI (10.85 KB, application/octet-stream)
2009-07-31 07:55 UTC, Roberto Manicardi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Manicardi 2009-07-31 07:55:24 UTC
Created attachment 24073 [details]
The original XLSX file

Hi,

I've tried the new tool to import XML into XSLSX files using the Custom XML mapping and I found a problem.

If you load an XSLS file, import data from XML and then save the XLSX back to file, the xmlMaps.xml part becomes corrupted.

I've attached two XLSX file to show the problem.

If you open the original xmlMaps.xml file it looks like this:

<Schema 
   ID="Schema13" 
   Namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
   
  <xsd:schema 
    targetNamespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
    elementFormDefault="qualified"
    xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"  
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">


while the file saved from POI looks like this:

<Schema 
   ID="Schema13" 
   Namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
   <xsd:schema 
      targetNamespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
      elementFormDefault="qualified" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">


It seems that the xmlns attribute of the inner xsd:schema element is removed by XMLBeans (I don't know if it's not saved or not readed from the original file).
Comment 1 Roberto Manicardi 2009-07-31 07:55:47 UTC
Created attachment 24074 [details]
The file modified by POI
Comment 2 Yegor Kozlov 2009-08-13 10:49:51 UTC
Roberto,

please post a complete example how to reproduce the problem - I don't quite understand what is wrong. 

Load / Save of the attached file works OK. 
I tried to apply the code from TestXSSFImportFromXML.testMultiTable() to the attached file and it produced a valid xlsx output.

Basically, you need to tell XmlBeans that you are saving a file with additional namespaces. A good example how to do it is XSSFDrawing.commit().

Yegor
Comment 3 Dominik Stadler 2015-07-07 20:04:50 UTC
No update since a long time and the bug is not reproducible, therefore closing this WORKSFORME for now, please post more information if you still think there is a bug.