From: Andreas Beeker Date: Fri, 21 Nov 2014 01:06:39 +0000 (+0000) Subject: the subdir element needs to be included otherwise certain xmlbean operations (e.g... X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d3dee868ef23e2c3830617148060d9b3425af7f7;p=poi.git the subdir element needs to be included otherwise certain xmlbean operations (e.g. selectPath) can't find the corresponding xmlbeans classes git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1640846 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java index 0550c1a91f..64920225ae 100644 --- a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java +++ b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java @@ -32,6 +32,7 @@ import java.util.Map; import java.util.Vector; import java.util.jar.JarEntry; import java.util.jar.JarFile; +import java.util.regex.Pattern; import junit.framework.TestCase; @@ -133,10 +134,11 @@ public final class OOXMLLite { //finally copy the compiled .xsb files System.out.println("Copying .xsb resources"); JarFile jar = new JarFile(_ooxmlJar); + Pattern p = Pattern.compile("schemaorg_apache_xmlbeans/(system|element)/.*\\.xsb"); try { for(Enumeration e = jar.entries(); e.hasMoreElements(); ){ JarEntry je = e.nextElement(); - if(je.getName().matches("schemaorg_apache_xmlbeans/system/\\w+/\\w+\\.xsb")) { + if(p.matcher(je.getName()).matches()) { File destFile = new File(_destDest, je.getName()); copyFile(jar.getInputStream(je), destFile); }