throws IOException {
ComponentSelector serializerSelector = null;
Serializer serializer = null;
// this.manager does not have Serializer
ComponentManager manager = CocoonComponentManager.getSitemapComponentManager();
try {
serializerSelector = (ComponentSelector) manager.lookup(Serializer.ROLE + "Selector");
serializer = (Serializer)serializerSelector.select("xml");
ByteArrayOutputStream os = new ByteArrayOutputStream();
serializer.setOutputStream(os);
toSAX(serializer);
return new ByteArrayInputStream(os.toByteArray());
// } catch (ServiceException e) {
// throw new CascadingIOException("Could not lookup pipeline components", e);
} catch (ComponentException e) {
throw new CascadingIOException("Could not lookup pipeline components", e);
} catch (Exception e) {
throw new CascadingIOException("Exception during processing of " + getURI(), e);
} finally {
if (serializer != null) {
serializerSelector.release(serializer);
}
if (serializerSelector != null) {
manager.release(serializerSelector);
}
}
}