==================================================================== */
package org.apache.poi.xssf.eventusermodel;
+import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_SPREADSHEETML;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
public void startElement(String uri, String localName, String name,
Attributes attributes) throws SAXException {
- if ("sst".equals(name)) {
+ if (uri != null && ! uri.equals(NS_SPREADSHEETML)) {
+ return;
+ }
+
+ if ("sst".equals(localName)) {
String count = attributes.getValue("count");
if(count != null) this.count = Integer.parseInt(count);
String uniqueCount = attributes.getValue("uniqueCount");
this.strings = new ArrayList<String>(this.uniqueCount);
characters = new StringBuffer();
- } else if ("si".equals(name)) {
+ } else if ("si".equals(localName)) {
characters.setLength(0);
- } else if ("t".equals(name)) {
+ } else if ("t".equals(localName)) {
tIsOpen = true;
}
}
public void endElement(String uri, String localName, String name)
throws SAXException {
- if ("si".equals(name)) {
+ if (uri != null && ! uri.equals(NS_SPREADSHEETML)) {
+ return;
+ }
+
+ if ("si".equals(localName)) {
strings.add(characters.toString());
- } else if ("t".equals(name)) {
+ } else if ("t".equals(localName)) {
tIsOpen = false;
}
}