Changeset 193 for trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
- Timestamp:
- 03/15/08 06:11:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
r192 r193 259 259 net.sf.saxon.TransformerFactoryImpl 260 260 261 HOWEVER, docx4all encounters http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6396599 262 263 java.util.prefs.FileSystemPreferences syncWorld 264 WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: java.lang.IllegalArgumentException: Not supported: indent-number 265 266 every 30 seconds 267 268 The workaround implemented is to remove META-INF/services from the xalan jar 269 to prevent xalan being picked up as the default provider for jaxp transform, 270 so we have to use it explicitly. 271 272 .. which means 273 274 System.setProperty("javax.xml.transform.TransformerFactory", "org.apache.xalan.processor.TransformerFactoryImpl"); 275 261 276 (unfortunately, there is no com.sun.org.apache.xalan.processor.TransformerFactoryImpl, 262 277 so we have to bundle xalan jar, which is 2.7 MB … … 269 284 That gets us from 2.7 MB to 1.85 MB. 270 285 271 ButSun already has:286 Sun already has: 272 287 273 288 com.sun.org.apache.xpath; 274 289 com.sun.org.apache.xml.internal.dtm; 275 com.sun.org.apache.xalan.internal.extensions|lib|res |templates290 com.sun.org.apache.xalan.internal.extensions|lib|res 276 291 277 So why not refactor Xalan and leave all that out as well?292 so you might think we can refactor Xalan to point to those, and them out of our jar. 278 293 294 well, it turns out that its too messy leaving out org.apache.xpath or xalan.extensions 279 295 280 HOWEVER, docx4all encounters http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6396599 281 282 java.util.prefs.FileSystemPreferences syncWorld 283 WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: java.lang.IllegalArgumentException: Not supported: indent-number 284 285 every 30 seconds 286 287 The workaround implemented is to remove META-INF/services from the xalan jar 288 to prevent xalan being picked up as the default provider for jaxp transform, 289 so we have to use it explicitly. 290 291 .. which means 292 293 System.setProperty("javax.xml.transform.TransformerFactory", "org.apache.xalan.processor.TransformerFactoryImpl"); 296 so you have to keep xalan.extensions, processor, serialize, trace, transformer 297 298 leaving out just org.apache.xalan.resources and org.apache.xpath.resources 299 only gets us down to 1.5 MB. (and that's with just jar cvf xalan-minimal.jar org/apache/xalan org/apache/xpath 300 - we'd still need to include org/apache/xml) 301 302 ie once you include the whole of org.apache.xpath, you may as well just go with the 1.85 MB :( 294 303 295 304 */ 296 297 305 298 306 javax.xml.transform.TransformerFactory tfactory = javax.xml.transform.TransformerFactory.newInstance();
Note: See TracChangeset
for help on using the changeset viewer.
