public void setPipelineConfiguration(PipelineConfiguration pipe) { if (pipe != null) { super.setPipelineConfiguration(pipe); if (context == null) { Controller controller = pipe.getController(); if (controller != null) { context = controller.newXPathContext(); } } if (element == null) { element = new Orphan(pipe.getConfiguration()); element.setNodeKind(Type.ELEMENT); } } }
/** * Create a serialization pipeline to implement a user-defined output method. This method is protected * so that it can be customized in a user-written SerializerFactory * * @param method the name of the user-defined output method, as a QName in Clark format * (that is "{uri}local"). * @param props the serialization properties * @param pipe the pipeline configuration information * @return a Receiver acting as the entry point to the serialization pipeline * @throws XPathException if a failure occurs */ protected SequenceReceiver createUserDefinedOutputMethod(String method, Properties props, PipelineConfiguration pipe) throws XPathException { Receiver userReceiver;// See if this output method is recognized by the Configuration userReceiver = pipe.getConfiguration().makeEmitter(method, props); userReceiver.setPipelineConfiguration(pipe); if (userReceiver instanceof ContentHandlerProxy && "yes".equals(props.getProperty(SaxonOutputKeys.SUPPLY_SOURCE_LOCATOR))) { if (pipe.getConfiguration().isCompileWithTracing() && pipe.getController() != null) { pipe.getController().addTraceListener( ((ContentHandlerProxy) userReceiver).getTraceListener()); } else { throw new XPathException( "Cannot use saxon:supply-source-locator unless tracing was enabled at compile time", SaxonErrorCode.SXSE0002); } } return userReceiver instanceof SequenceReceiver ? (SequenceReceiver)userReceiver : new TreeReceiver(userReceiver); }
/** * Create a serialization pipeline to implement a user-defined output method. This method is protected * so that it can be customized in a user-written SerializerFactory * * @param method the name of the user-defined output method, as a QName in Clark format * (that is "{uri}local"). * @param props the serialization properties * @param pipe the pipeline configuration information * @return a Receiver acting as the entry point to the serialization pipeline * @throws XPathException if a failure occurs */ protected SequenceReceiver createUserDefinedOutputMethod(String method, Properties props, PipelineConfiguration pipe) throws XPathException { Receiver userReceiver;// See if this output method is recognized by the Configuration userReceiver = pipe.getConfiguration().makeEmitter(method, props); userReceiver.setPipelineConfiguration(pipe); if (userReceiver instanceof ContentHandlerProxy && "yes".equals(props.getProperty(SaxonOutputKeys.SUPPLY_SOURCE_LOCATOR))) { if (pipe.getConfiguration().isCompileWithTracing() && pipe.getController() != null) { pipe.getController().addTraceListener( ((ContentHandlerProxy) userReceiver).getTraceListener()); } else { throw new XPathException( "Cannot use saxon:supply-source-locator unless tracing was enabled at compile time", SaxonErrorCode.SXSE0002); } } return userReceiver instanceof SequenceReceiver ? (SequenceReceiver)userReceiver : new TreeReceiver(userReceiver); }
/** * Create a serialization pipeline to implement a user-defined output method. This method is protected * so that it can be customized in a user-written SerializerFactory * @param method the name of the user-defined output method, as a QName in Clark format * (that is "{uri}local"). * @param props the serialization properties * @param pipe the pipeline configuration information * @return a Receiver acting as the entry point to the serialization pipeline * @throws XPathException if a failure occurs */ protected Receiver createUserDefinedOutputMethod(String method, Properties props, PipelineConfiguration pipe) throws XPathException { Receiver userReceiver;// See if this output method is recognized by the Configuration userReceiver = pipe.getConfiguration().makeEmitter(method, pipe.getController()); userReceiver.setPipelineConfiguration(pipe); if (userReceiver instanceof ContentHandlerProxy && "yes".equals(props.getProperty(SaxonOutputKeys.SUPPLY_SOURCE_LOCATOR))) { if (pipe.getConfiguration().isCompileWithTracing()) { pipe.getController().addTraceListener( ((ContentHandlerProxy)userReceiver).getTraceListener()); } else { XPathException de = new XPathException( "Cannot use saxon:supply-source-locator unless tracing was enabled at compile time"); de.setErrorCode(SaxonErrorCode.SXSE0002); throw de; } } return userReceiver; }
public void setPipelineConfiguration(PipelineConfiguration pipe) { if (pipe != null) { super.setPipelineConfiguration(pipe); if (context == null) { Controller controller = pipe.getController(); if (controller != null) { context = controller.newXPathContext(); } } if (element == null) { element = new Orphan(pipe.getConfiguration()); element.setNodeKind(Type.ELEMENT); } } }
public void setPipelineConfiguration(PipelineConfiguration pipe) { if (pipe != null) { super.setPipelineConfiguration(pipe); if (context == null) { Controller controller = pipe.getController(); if (controller != null) { context = controller.newXPathContext(); } } if (element == null) { element = new Orphan(pipe.getConfiguration()); element.setNodeKind(Type.ELEMENT); } } }
private static Receiver makeValidator(Receiver receiver, String systemId, ParseOptions options) throws XPathException { PipelineConfiguration pipe = receiver.getPipelineConfiguration(); Configuration config = pipe.getConfiguration(); int sv = options.getSchemaValidationMode(); if (sv != Validation.PRESERVE && sv != Validation.DEFAULT) { Controller controller = pipe.getController(); if (controller != null && !controller.getExecutable().isSchemaAware() && sv != Validation.STRIP) { throw new XPathException("Cannot use schema-validated input documents when the query/stylesheet is not schema-aware"); } } return receiver; }
private static Receiver makeValidator(Receiver receiver, String systemId, ParseOptions options) throws XPathException { PipelineConfiguration pipe = receiver.getPipelineConfiguration(); Configuration config = pipe.getConfiguration(); int sv = options.getSchemaValidationMode(); if (sv != Validation.PRESERVE && sv != Validation.DEFAULT) { Controller controller = pipe.getController(); if (controller != null && !controller.getExecutable().isSchemaAware() && sv != Validation.STRIP) { throw new XPathException("Cannot use schema-validated input documents when the query/stylesheet is not schema-aware"); } } return receiver; }
Object obj = pipe.getConfiguration().getInstance(csname, pipe.getController().getClassLoader()); if (obj instanceof PluggableCharacterSet) { return (PluggableCharacterSet)obj;
} else if (pipe.getController() != null) { if (mutable) { TreeModel model = pipe.getController().getModel(); if (model.isMutable()) { builder = pipe.getController().makeBuilder(); } else { builder = new LinkedTreeBuilder(pipe); builder = pipe.getController().makeBuilder();
Object obj = pipe.getConfiguration().getInstance(csname, pipe.getController().getClassLoader()); if (obj instanceof PluggableCharacterSet) { return (PluggableCharacterSet)obj;
} else if (pipe.getController() != null) { if (mutable) { TreeModel model = pipe.getController().getModel(); if (model.isMutable()) { builder = pipe.getController().makeBuilder(); } else { builder = new LinkedTreeBuilder(pipe); builder = pipe.getController().makeBuilder();
if ("yes".equals(props.getProperty(SaxonOutputKeys.SUPPLY_SOURCE_LOCATOR))) { if (pipe.getConfiguration().isCompileWithTracing()) { pipe.getController().addTraceListener(proxy.getTraceListener()); } else { XPathException de = new XPathException("Cannot use saxon:supply-source-locator unless tracing was enabled at compile time"); String useMaps = props.getProperty(SaxonOutputKeys.USE_CHARACTER_MAPS); if (useMaps != null) { Controller controller = (pipe == null ? null : pipe.getController()); if (controller == null) { XPathException de = new XPathException("Cannot use character maps in an environment with no Controller"); } else { userReceiver = pipe.getConfiguration().makeEmitter(method, pipe.getController()); userReceiver.setPipelineConfiguration(pipe); if (userReceiver instanceof ContentHandlerProxy && "yes".equals(props.getProperty(SaxonOutputKeys.SUPPLY_SOURCE_LOCATOR))) { if (pipe.getConfiguration().isCompileWithTracing()) { pipe.getController().addTraceListener( ((ContentHandlerProxy)userReceiver).getTraceListener()); } else {
if ("yes".equals(props.getProperty(SaxonOutputKeys.SUPPLY_SOURCE_LOCATOR))) { if (pipe.getConfiguration().isCompileWithTracing()) { pipe.getController().addTraceListener(proxy.getTraceListener()); } else { XPathException de = new XPathException("Cannot use saxon:supply-source-locator unless tracing was enabled at compile time"); String useMaps = props.getProperty(SaxonOutputKeys.USE_CHARACTER_MAPS); if (useMaps != null) { Controller controller = (pipe == null ? null : pipe.getController()); if (controller == null) { XPathException de = new XPathException("Cannot use character maps in an environment with no Controller");
if (pipe.getController() != null) { Builder b = pipe.getController().makeBuilder(); if (b instanceof TinyBuilder) { ((TinyBuilder) b).setStatistics(pipe.getConfiguration().getTreeStatistics().SOURCE_DOCUMENT_STATISTICS); if (pipe.getController().isStylesheetStrippingTypeAnnotations()) { s = pipe.getConfiguration().getAnnotationStripper(s);
if (pipe.getController() != null) { Builder b = pipe.getController().makeBuilder(); if (b instanceof TinyBuilder) { ((TinyBuilder) b).setStatistics(Statistics.SOURCE_DOCUMENT_STATISTICS); if (pipe.getController().isStylesheetStrippingTypeAnnotations()) { s = pipe.getConfiguration().getAnnotationStripper(s);
proxy.setOutputProperties(props); if ("yes".equals(props.getProperty(SaxonOutputKeys.SUPPLY_SOURCE_LOCATOR))) { if (config.isCompileWithTracing() && pipe.getController() != null) { pipe.getController().addTraceListener(proxy.getTraceListener()); } else { throw new XPathException(
proxy.setOutputProperties(props); if ("yes".equals(props.getProperty(SaxonOutputKeys.SUPPLY_SOURCE_LOCATOR))) { if (config.isCompileWithTracing() && pipe.getController() != null) { pipe.getController().addTraceListener(proxy.getTraceListener()); } else { throw new XPathException(
next = s; } else if (stripSpace == Whitespace.XSLT) { Controller controller = pipe.getController(); if (controller != null) { next = controller.makeStripper(next);
/** * Create a TinyTree to hold a document or element node. * @throws net.sf.saxon.trans.XPathException */ private void createTree() throws XPathException { PipelineConfiguration pipe = getPipelineConfiguration(); builder = pipe.getController().makeBuilder(); builder.setPipelineConfiguration(pipe); builder.setSystemId(getSystemId()); builder.setTiming(false); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(getPipelineConfiguration()); ComplexContentOutputter cco = new ComplexContentOutputter(); cco.setHostLanguage(getPipelineConfiguration().getHostLanguage()); cco.setPipelineConfiguration(getPipelineConfiguration()); cco.setReceiver(reducer); outputter = cco; outputter.setSystemId(systemId); outputter.setPipelineConfiguration(getPipelineConfiguration()); outputter.open(); }