Fix bug 58760: non-standard namespace-key breaks parsing XLSX files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1722433 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c7baa89709
commit
7f105042ba
@ -259,9 +259,6 @@ public class TestAllFiles {
|
||||
// non-TNEF files
|
||||
EXPECTED_FAILURES.add("ddf/Container.dat");
|
||||
EXPECTED_FAILURES.add("ddf/47143.dat");
|
||||
|
||||
// will be fixed as part of bug 58760
|
||||
EXPECTED_FAILURES.add("spreadsheet/58760.xlsx");
|
||||
}
|
||||
|
||||
private static final Set<String> IGNORED = new HashSet<String>();
|
||||
|
@ -320,7 +320,7 @@ public final class PackageRelationshipCollection implements
|
||||
// Check OPC compliance M4.1 rule
|
||||
boolean fCorePropertiesRelationship = false;
|
||||
|
||||
NodeList nodeList = root.getElementsByTagName(PackageRelationship.RELATIONSHIP_TAG_NAME);
|
||||
NodeList nodeList = root.getElementsByTagNameNS(PackageNamespaces.RELATIONSHIPS, PackageRelationship.RELATIONSHIP_TAG_NAME);
|
||||
int nodeCount = nodeList.getLength();
|
||||
for (int i = 0; i < nodeCount; i++) {
|
||||
Element element = (Element)nodeList.item(i);
|
||||
|
@ -377,7 +377,7 @@ public abstract class ContentTypeManager {
|
||||
Document xmlContentTypetDoc = DocumentHelper.readDocument(in);
|
||||
|
||||
// Default content types
|
||||
NodeList defaultTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagName(DEFAULT_TAG_NAME);
|
||||
NodeList defaultTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagNameNS(TYPES_NAMESPACE_URI, DEFAULT_TAG_NAME);
|
||||
int defaultTypeCount = defaultTypes.getLength();
|
||||
for (int i = 0; i < defaultTypeCount; i++) {
|
||||
Element element = (Element) defaultTypes.item(i);
|
||||
@ -387,7 +387,7 @@ public abstract class ContentTypeManager {
|
||||
}
|
||||
|
||||
// Overriden content types
|
||||
NodeList overrideTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagName(OVERRIDE_TAG_NAME);
|
||||
NodeList overrideTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagNameNS(TYPES_NAMESPACE_URI, OVERRIDE_TAG_NAME);
|
||||
int overrideTypeCount = overrideTypes.getLength();
|
||||
for (int i = 0; i < overrideTypeCount; i++) {
|
||||
Element element = (Element) overrideTypes.item(i);
|
||||
|
@ -2879,7 +2879,6 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
||||
* ! Rule: Package require content types when retrieving a part from a package. [M.1.14]
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void test58760() throws Exception {
|
||||
Workbook wb = XSSFTestDataSamples.openSampleWorkbook("58760.xlsx");
|
||||
assertEquals(1, wb.getNumberOfSheets());
|
||||
|
Loading…
Reference in New Issue
Block a user