/** * Create a IdentityTransformerHandler and initialise variables. The constructor is protected, because * the Filter should be created using newTransformerHandler() in the SAXTransformerFactory * class * @param controller the Controller for this transformation */ protected IdentityTransformerHandler(Controller controller) { this.controller = controller; setPipelineConfiguration(controller.makePipelineConfiguration()); }
/** * Create a IdentityTransformerHandler and initialise variables. The constructor is protected, because * the Filter should be created using newTransformerHandler() in the SAXTransformerFactory * class * @param controller the Controller for this transformation */ protected IdentityTransformerHandler(Controller controller) { this.controller = controller; setPipelineConfiguration(controller.makePipelineConfiguration()); }
/** * Override the behaviour of startDocument() in ReceivingContentHandler */ public void startDocument() throws SAXException { if (result==null) { result = new StreamResult(System.out); } try { Properties props = controller.getOutputProperties(); PipelineConfiguration pipe = controller.makePipelineConfiguration(); SerializerFactory sf = getConfiguration().getSerializerFactory(); setReceiver(sf.getReceiver(result, pipe, props)); setPipelineConfiguration(pipe); } catch (XPathException err) { throw new SAXException(err); } super.startDocument(); }
/** * Override the behaviour of startDocument() in ReceivingContentHandler */ public void startDocument() throws SAXException { if (result==null) { result = new StreamResult(System.out); } try { Properties props = controller.getOutputProperties(); PipelineConfiguration pipe = controller.makePipelineConfiguration(); Configuration config = getConfiguration(); SerializerFactory sf = config.getSerializerFactory(); Receiver out = sf.getReceiver(result, pipe, props); setPipelineConfiguration(pipe); int stripSpace = config.getStripsWhiteSpace(); if (stripSpace == Whitespace.ALL) { Stripper s = new AllElementStripper(); s.setStripAll(); s.setPipelineConfiguration(pipe); s.setUnderlyingReceiver(out); out = s; } setReceiver(out); } catch (XPathException err) { throw new SAXException(err); } super.startDocument(); }