/** * Test whether this object model recognizes a particular kind of JAXP Source object, * and if it does, send the contents of the document to a supplied Receiver, and return true. * Otherwise, return false. * <p> * This implementation returns true only if the source is a DOMSource whose contained node is a * a "NodeOverNodeInfo". */ public boolean sendSource(Source source, Receiver receiver, PipelineConfiguration pipe) throws XPathException { if (source instanceof DOMSource) { Node startNode = ((DOMSource)source).getNode(); if (startNode instanceof NodeOverNodeInfo) { NodeInfo base = ((NodeOverNodeInfo)startNode).getUnderlyingNodeInfo(); Sender driver = new Sender(pipe); driver.send(base, receiver); return true; } } return false; }
/** * Validate an instance document supplied as a Source object * @param source the instance document to be validated. The call getSystemId() applied to * this source object must return the base URI used for dereferencing any xsi:schemaLocation * or xsi:noNamespaceSchemaLocation attributes * @throws SaxonApiException if the source document is found to be invalid */ public void validate(Source source) throws SaxonApiException { Receiver receiver = getReceiver(config, source.getSystemId()); PipelineConfiguration pipe = receiver.getPipelineConfiguration(); try { new Sender(pipe).send(source, receiver, true); } catch (XPathException e) { throw new SaxonApiException(e); } }
/** * Evaluate in a general context */ public Item evaluateItem(XPathContext c) throws XPathException { Controller controller = c.getController(); AtomicValue content = (AtomicValue)argument[0].evaluateItem(c); StringReader sr = new StringReader(content.getStringValue()); InputSource is = new InputSource(sr); is.setSystemId(baseURI); Source source = new SAXSource(is); source.setSystemId(baseURI); Builder b = controller.makeBuilder(); Receiver s = b; source = AugmentedSource.makeAugmentedSource(source); ((AugmentedSource)source).setStripSpace(Whitespace.XSLT); if (controller.getExecutable().stripsInputTypeAnnotations()) { s = controller.getConfiguration().getAnnotationStripper(s); } try { new Sender(controller.makePipelineConfiguration()).send(source, s); return b.getCurrentRoot(); } catch (XPathException err) { throw new XPathException(err); } }
/** * Evaluate in a general context */ public Item evaluateItem(XPathContext c) throws XPathException { Controller controller = c.getController(); AtomicValue content = (AtomicValue)argument[0].evaluateItem(c); StringReader sr = new StringReader(content.getStringValue()); InputSource is = new InputSource(sr); is.setSystemId(baseURI); Source source = new SAXSource(is); source.setSystemId(baseURI); Builder b = controller.makeBuilder(); Receiver s = b; source = AugmentedSource.makeAugmentedSource(source); ((AugmentedSource)source).setStripSpace(Whitespace.XSLT); if (controller.getExecutable().stripsInputTypeAnnotations()) { s = controller.getConfiguration().getAnnotationStripper(s); } try { new Sender(controller.makePipelineConfiguration()).send(source, s); return b.getCurrentRoot(); } catch (XPathException err) { throw new XPathException(err); } }
/** * Evaluate in a general context */ public Item evaluateItem(XPathContext c) throws XPathException { Controller controller = c.getController(); AtomicValue content = (AtomicValue)argument[0].evaluateItem(c); StringReader sr = new StringReader(content.getStringValue()); InputSource is = new InputSource(sr); is.setSystemId(baseURI); Source source = new SAXSource(is); source.setSystemId(baseURI); Builder b = controller.makeBuilder(); Receiver s = b; source = AugmentedSource.makeAugmentedSource(source); ((AugmentedSource)source).setStripSpace(Whitespace.XSLT); if (controller.getExecutable().stripsInputTypeAnnotations()) { s = controller.getConfiguration().getAnnotationStripper(s); } try { new Sender(controller.makePipelineConfiguration()).send(source, s); NodeInfo node = b.getCurrentRoot(); b.reset(); return node; } catch (XPathException err) { throw new XPathException(err); } }
((AugmentedSource)ss).setStripSpace(stripSpace); new Sender(pipe).send(source, builder); TinyDocumentImpl doc = (TinyDocumentImpl)builder.getCurrentRoot(); return (Document)DocumentOverNodeInfo.wrap(doc);
out = controller.getConfiguration().getAnnotationStripper(out); new Sender(pipe).send(source, out);
out = controller.getConfiguration().getAnnotationStripper(out); new Sender(pipe).send(source, out);
new Sender(pipe).send(source, out); } catch (XPathException e) { e.maybeSetLocation(locator);
NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(receiver); new Sender(pipe).send(source, reducer, true); } catch (XPathException err) { Throwable cause = err.getException();
NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(receiver); new Sender(pipe).send(source, reducer, true); } catch (XPathException err) { Throwable cause = err.getException();
new Sender(pipe).send(source, receiver); } catch (XPathException err) { throw XPathException.makeXPathException(err);
new Sender(pipe).send(source, receiver); } catch (XPathException err) { throw XPathException.makeXPathException(err);
new Sender(pipe).send(source, receiver); } catch (XPathException err) { throw XPathException.makeXPathException(err);
new Sender(config.makePipelineConfiguration()).send(source, grabber);
new Sender(config.makePipelineConfiguration()).send(source, grabber);
Sender sender = new Sender(sourceBuilder.getPipelineConfiguration()); Receiver r = sourceBuilder; if (config.isStripsAllWhiteSpace() || executable.stripsWhitespace() ||
Sender sender = new Sender(sourceBuilder.getPipelineConfiguration()); Receiver r = sourceBuilder; if (config.isStripsAllWhiteSpace() || executable.stripsWhitespace() ||
Sender sender = new Sender(pipe); AugmentedSource aug = AugmentedSource.makeAugmentedSource(styleSource); aug.setSchemaValidationMode(Validation.STRIP);
Sender sender = new Sender(pipe); AugmentedSource aug = AugmentedSource.makeAugmentedSource(styleSource); aug.setSchemaValidationMode(Validation.STRIP);