bruno 2003/05/20 13:49:57
Modified: src/java/org/apache/cocoon/transformation
XIncludeTransformer.java
Log:
in setDocumentLocator, check that systemid is not null before using it.
Revision Changes Path
1.3 +13 -10
cocoon-2.1/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java
Index: XIncludeTransformer.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XIncludeTransformer.java 20 May 2003 11:59:22 -0000 1.2
+++ XIncludeTransformer.java 20 May 2003 20:49:57 -0000 1.3
@@ -323,15 +323,18 @@
getLogger().debug("setDocumentLocator called " +
locator.getSystemId());
}
- Source source = resolver.resolveURI(locator.getSystemId());
- try {
- xmlBaseSupport.setDocumentLocation(source.getURI());
- // only for the "root" XIncludePipe, we'll have to set
the href here, in the other cases
- // the href is taken from the xi:include href attribute
- if (href == null)
- href = source.getURI();
- } finally {
- resolver.release(source);
+ // When using SAXON to serialize a DOM tree to SAX, a
locator is passed with a "null" system id
+ if (locator.getSystemId() != null) {
+ Source source =
resolver.resolveURI(locator.getSystemId());
+ try {
+ xmlBaseSupport.setDocumentLocation(source.getURI());
+ // only for the "root" XIncludePipe, we'll have to
set the href here, in the other cases
+ // the href is taken from the xi:include href
attribute
+ if (href == null)
+ href = source.getURI();
+ } finally {
+ resolver.release(source);
+ }
}
} catch (Exception e) {
throw new CascadingRuntimeException("Error in
XIncludeTransformer while trying to resolve base URL for document", e);