/** * Return the Controller object * * @param c the XPath dynamic context * @return the Controller */ public static Controller getController(XPathContext c) { return c.getController(); }
/** * Return the Controller object * * @param c the XPath dynamic context * @return the Controller */ public static Controller getController(XPathContext c) { return c.getController(); }
/** * Return the Controller object * * @param c the XPath dynamic context * @return the Controller */ public static Controller getController(XPathContext c) { return c.getController(); }
/** * Switch tracing off. Only works if tracing was enabled at compile time. * * @param c the XPath dynamic context */ public static void pauseTracing(XPathContext c) { c.getController().pauseTracing(true); }
/** * Switch tracing off. Only works if tracing was enabled at compile time. * * @param c the XPath dynamic context */ public static void pauseTracing(XPathContext c) { c.getController().pauseTracing(true); }
/** * Resume tracing. Only works if tracing was originally enabled * but is currently paused. * * @param c the XPath dynamic context */ public static void resumeTracing(XPathContext c) { c.getController().pauseTracing(false); }
/** * Compute a document key */ protected static DocumentURI computeDocumentKey(String href, String baseURI, PackageData packageData, XPathContext c) throws XPathException { // Resolve relative URI Controller controller = c.getController(); URIResolver resolver = controller.getURIResolver(); if (resolver == null) { resolver = controller.getStandardURIResolver(); } return computeDocumentKey(href, baseURI, packageData, resolver, true); }
/** * Compute a document key */ protected static DocumentURI computeDocumentKey(String href, String baseURI, PackageData packageData, XPathContext c) throws XPathException { // Resolve relative URI Controller controller = c.getController(); URIResolver resolver = controller.getURIResolver(); if (resolver == null) { resolver = controller.getStandardURIResolver(); } return computeDocumentKey(href, baseURI, packageData, resolver, true); }
public void outputWarning(Item item, XPathContext context) { String id = item instanceof NodeInfo ? "the node " + Navigator.getPath((NodeInfo) item) : "the atomic value " + item.getStringValue(); XPathException warning = new XPathException("No user-defined template rule matches " + id, "XTDE0555"); context.getController().getErrorListener().warning(warning); }
@Override public Receiver resolve( XPathContext context, String href, String baseUri, SerializationProperties properties) throws XPathException { StreamResult result = resolve(href, baseUri); SerializerFactory factory = context.getConfiguration().getSerializerFactory(); PipelineConfiguration pipe = context.getController().makePipelineConfiguration(); return factory.getReceiver(result, properties, pipe); }
public void outputWarning(Item item, XPathContext context) { String id = item instanceof NodeInfo ? "the node " + Navigator.getPath((NodeInfo) item) : "the atomic value " + item.getStringValue(); XPathException warning = new XPathException("No user-defined template rule matches " + id, "XTDE0555"); context.getController().getErrorListener().warning(warning); }
public TailCall processLeavingTail(XPathContext context) throws XPathException { Controller controller = context.getController(); String prefix = evaluatePrefix(context); String uri = expandChildren(context).toString(); checkPrefixAndUri(prefix, uri, context); int nscode = controller.getNamePool().allocateNamespaceCode(prefix, uri); SequenceReceiver out = context.getReceiver(); out.namespace(nscode, ReceiverOptions.REJECT_DUPLICATES); return null; }
public TailCall processLeavingTail(XPathContext context) throws XPathException { Controller controller = context.getController(); String prefix = evaluatePrefix(context); String uri = expandChildren(context).toString(); checkPrefixAndUri(prefix, uri, context); int nscode = controller.getNamePool().allocateNamespaceCode(prefix, uri); SequenceReceiver out = context.getReceiver(); out.namespace(nscode, ReceiverOptions.REJECT_DUPLICATES); return null; }
public NodeInfo convert(Object object, XPathContext context) throws XPathException { ParseOptions options = new ParseOptions(); Controller controller = context.getController(); if (controller != null) { options.setSchemaValidationMode(controller.getSchemaValidationMode()); } return context.getConfiguration().buildDocumentTree((Source) object, options).getRootNode(); }
public NodeInfo convert(Object object, XPathContext context) throws XPathException { ParseOptions options = new ParseOptions(); Controller controller = context.getController(); if (controller != null) { options.setSchemaValidationMode(controller.getSchemaValidationMode()); } return context.getConfiguration().buildDocumentTree((Source) object, options).getRootNode(); }
private void notifyListener(String label, Value val, XPathContext context) { InstructionDetails info = (InstructionDetails)getInstructionInfo(); info.setConstructType(Location.TRACE_CALL); info.setNamespaceResolver(resolver); info.setProperty("label", label); info.setProperty("value", val); TraceListener listener = context.getController().getTraceListener(); listener.enter(info, context); listener.leave(info); }
private void notifyListener(String label, Value val, XPathContext context) { InstructionDetails info = (InstructionDetails)getInstructionInfo(); info.setConstructType(Location.TRACE_CALL); info.setNamespaceResolver(resolver); info.setProperty("label", label); info.setProperty("value", val); TraceListener listener = context.getController().getTraceListener(); listener.enter(info, context); listener.leave(info); }
@Override public void processTuple(XPathContext context) throws XPathException { Controller controller = context.getController(); if (controller.isTracing()) { ClauseInfo baseInfo = new ClauseInfo(baseClause); baseInfo.setNamespaceResolver(traceClause.getNamespaceResolver()); controller.getTraceListener().enter(baseInfo, context); destination.processTuple(context); controller.getTraceListener().leave(baseInfo); } else { destination.processTuple(context); } }
public void notifyListener(String label, Sequence<?> val, SourceLocator loc, XPathContext context) { InstructionDetails info = new InstructionDetails(); info.setConstructType(LocationKind.TRACE_CALL); info.setLineNumber(loc.getLineNumber()); info.setSystemId(loc.getSystemId()); info.setProperty("label", label); info.setProperty("value", val); TraceListener listener = context.getController().getTraceListener(); listener.enter(info, context); listener.leave(info); }
public void notifyListener(String label, Sequence<?> val, SourceLocator loc, XPathContext context) { InstructionDetails info = new InstructionDetails(); info.setConstructType(LocationKind.TRACE_CALL); info.setLineNumber(loc.getLineNumber()); info.setSystemId(loc.getSystemId()); info.setProperty("label", label); info.setProperty("value", val); TraceListener listener = context.getController().getTraceListener(); listener.enter(info, context); listener.leave(info); }