// create Saxon IdentityTransformer final Transformer transformer = new TransformerFactoryImpl().newTransformer(); // set up holder for the output final TinyBuilder outputTarget = new TinyBuilder( new PipelineConfiguration(new Configuration())); // transform into Saxon's immutable TinyTree transformer.transform(xml, outputTarget); // extract the whole XML as TinyNode final TinyNodeImpl tinyNode = outputTarget.getTree().getNode(0); // wrap TinyNode as DOM final NodeOverNodeInfo nodeOverNodeInfo = DocumentOverNodeInfo.wrap(tinyNode); // cast to DOM final Document doc = (Document) nodeOverNodeInfo;
public void setPipelineConfiguration(PipelineConfiguration pipe) { PipelineConfiguration pipe2 = new PipelineConfiguration(pipe); pipe2.setLocationProvider(this); super.setPipelineConfiguration(pipe2); }
public void setPipelineConfiguration(PipelineConfiguration pipe) { PipelineConfiguration pipe2 = new PipelineConfiguration(pipe); pipe2.setLocationProvider(this); super.setPipelineConfiguration(pipe2); }
/** * Set configuration information. This must only be called before any events * have been read. * @param pipe the pipeline configuration */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.pipe.setLocationProvider(this); config = pipe.getConfiguration(); ignoreIgnorable = config.getStripsWhiteSpace() != Whitespace.NONE; }
/** * Set configuration information. This must only be called before any events * have been read. */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.pipe.setLocationProvider(this); ignoreIgnorable = pipe.getConfiguration().getStripsWhiteSpace() != Whitespace.NONE; }
/** * Set configuration information. This must only be called before any events * have been read. */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.pipe.setLocationProvider(this); ignoreIgnorable = pipe.getConfiguration().getStripsWhiteSpace() != Whitespace.NONE; }
/** * Set configuration information. This must only be called before any events * have been read. * @param pipe the pipeline configuration */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.pipe.setLocationProvider(this); config = pipe.getConfiguration(); ignoreIgnorable = config.getStripsWhiteSpace() != Whitespace.NONE; }
public Document createInternalDOM(Source input) throws TransformerException { Configuration config = new Configuration(); PipelineConfiguration pipeConfig = new PipelineConfiguration(config); TinyBuilder builder = new TinyBuilder(pipeConfig); Transformer t = Xslt.createIdentityTransformer(XsltVersion.XSLT2); t.transform(input, builder); NodeInfo node = builder.getCurrentRoot(); return (Document)NodeOverNodeInfo.wrap(node); }
public static BaseURIAwareXMLStreamReader nodeReader(NodeInfo node, Configuration configuration) throws XPathException { PullFromIterator provider= new PullFromIterator(node.iterate()); provider.setPipelineConfiguration(new PipelineConfiguration(configuration)); return new BaseURIAwarePullToStax( provider, node.getBaseURI() == null ? null : URI.create(node.getBaseURI())); }
/** * Set configuration information. This must only be called before any events * have been read. */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.namePool = pipe.getConfiguration().getNamePool(); ignoreIgnorable = pipe.getConfiguration().getParseOptions().getSpaceStrippingRule() != NoElementsSpaceStrippingRule.getInstance(); }
/** * Set configuration information. This must only be called before any events * have been read. */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.namePool = pipe.getConfiguration().getNamePool(); ignoreIgnorable = pipe.getConfiguration().getParseOptions().getSpaceStrippingRule() != NoElementsSpaceStrippingRule.getInstance(); }
/** * Make a PipelineConfiguration from the properties of this Configuration * * @return a new PipelineConfiguration * @since 8.4 */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(this); pipe.setURIResolver(getURIResolver()); pipe.setParseOptions(new ParseOptions(defaultParseOptions)); pipe.setErrorListener(getErrorListener()); return pipe; }
/** * Make a PipelineConfiguration from the properties of this Configuration * * @return a new PipelineConfiguration * @since 8.4 */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(this); pipe.setURIResolver(getURIResolver()); pipe.setParseOptions(new ParseOptions(defaultParseOptions)); pipe.setErrorListener(getErrorListener()); return pipe; }
final PipelineConfiguration newPipe = new PipelineConfiguration(oldPipe); final ErrorListener oldErrorListener = controller.getErrorListener(); if (onError == URIQueryParameters.ON_ERROR_IGNORE) {
final PipelineConfiguration newPipe = new PipelineConfiguration(oldPipe); final ErrorListener oldErrorListener = controller.getErrorListener(); if (onError == URIQueryParameters.ON_ERROR_IGNORE) {
/** * Make a PipelineConfiguration from the properties of this Configuration * @return a new PipelineConfiguration * @since 8.4 */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(); pipe.setConfiguration(this); pipe.setErrorListener(getErrorListener()); pipe.setURIResolver(getURIResolver()); pipe.setSchemaURIResolver(getSchemaURIResolver()); pipe.setHostLanguage(getHostLanguage()); pipe.setExpandAttributeDefaults(isExpandAttributeDefaults()); return pipe; }
final PipelineConfiguration oldPipe = context.getConfiguration().makePipelineConfiguration(); oldPipe.setController(context.getController()); final PipelineConfiguration newPipe = new PipelineConfiguration(oldPipe); final UnfailingErrorListener oldErrorListener = controller == null ? new StandardErrorListener() : controller.getErrorListener();
/** * Make a PipelineConfiguration from the properties of this Configuration * * @return a new PipelineConfiguration * @since 8.4 */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(); pipe.setConfiguration(this); pipe.setErrorListener(getErrorListener()); pipe.setURIResolver(getURIResolver()); pipe.setSchemaURIResolver(getSchemaURIResolver()); pipe.setHostLanguage(getHostLanguage()); pipe.setExpandAttributeDefaults(isExpandAttributeDefaults()); pipe.setUseXsiSchemaLocation(useXsiSchemaLocation); return pipe; }
/** * Make a PipelineConfiguration based on the properties of this Controller. * <p> * This interface is intended primarily for internal use, although it may be necessary * for applications to call it directly if they construct pull or push pipelines * @return a newly constructed PipelineConfiguration holding a reference to this * Controller as well as other configuration information. */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(); pipe.setConfiguration(getConfiguration()); pipe.setErrorListener(getErrorListener()); pipe.setURIResolver(userURIResolver==null ? standardURIResolver : userURIResolver); pipe.setSchemaURIResolver(schemaURIResolver); pipe.setExpandAttributeDefaults(getConfiguration().isExpandAttributeDefaults()); pipe.setUseXsiSchemaLocation(((Boolean)getConfiguration().getConfigurationProperty( FeatureKeys.USE_XSI_SCHEMA_LOCATION)).booleanValue()); pipe.setController(this); final Executable executable = getExecutable(); if (executable != null) { // can be null for an IdentityTransformer pipe.setLocationProvider(executable.getLocationMap()); pipe.setHostLanguage(executable.getHostLanguage()); } return pipe; }
/** * Make a PipelineConfiguration based on the properties of this Controller. * <p> * This interface is intended primarily for internal use, although it may be necessary * for applications to call it directly if they construct pull or push pipelines * @return a newly constructed PipelineConfiguration holding a reference to this * Controller as well as other configuration information. */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(); pipe.setConfiguration(getConfiguration()); pipe.setErrorListener(getErrorListener()); pipe.setURIResolver(userURIResolver==null ? standardURIResolver : userURIResolver); pipe.setSchemaURIResolver(schemaURIResolver); pipe.setExpandAttributeDefaults(getConfiguration().isExpandAttributeDefaults()); pipe.setController(this); final Executable executable = getExecutable(); if (executable != null) { // can be null for an IdentityTransformer pipe.setLocationProvider(executable.getLocationMap()); pipe.setHostLanguage(executable.getHostLanguage()); } return pipe; }