@Deprecated public static boolean typeof(final XPathContext context, final String nodeTypeName, final String fullTypeName, final String shortTypeName) { return TypeOfFunction.typeof((Node) ((ElementNode) context.getContextItem()).getUnderlyingNode(), nodeTypeName, fullTypeName, shortTypeName); }
public static boolean typeIsExactly(final XPathContext context, final String fullTypeName) { return TypeIsExactlyFunction.typeIsExactly((Node) ((ElementNode) context.getContextItem()).getUnderlyingNode(), fullTypeName); } }
public static double metric(final XPathContext context, final String metricKeyName) { return MetricFunction.getMetric((Node) ((ElementNode) context.getContextItem()).getUnderlyingNode(), metricKeyName); }
public static boolean typeIs(final XPathContext context, final String fullTypeName) { return TypeIsFunction.typeIs((Node) ((ElementNode) context.getContextItem()).getUnderlyingNode(), fullTypeName); }
/** * Evaluate a pattern as a boolean expression, returning true if the context item matches the pattern * @param context the evaluation context * @return true if the context item matches the pattern * @throws XPathException if an error occurs during pattern matching */ public final boolean effectiveBooleanValue(XPathContext context) throws XPathException { return matches(context.getContextItem(), context); }
/** * Callback from ElementCreator when constructing an element * @param context XPath dynamic evaluation context * @return the namecode of the element to be constructed * @throws XPathException */ public int getNameCode(XPathContext context) throws XPathException { return ((NodeInfo)context.getContextItem()).getNameCode(); }
/** * Callback from ElementCreator when constructing an element * @param context XPath dynamic evaluation context * @return the namecode of the element to be constructed * @throws XPathException */ public int getNameCode(XPathContext context) throws XPathException { return ((NodeInfo)context.getContextItem()).getNameCode(); }
/** * Get the base URI of a copied element node (the base URI is retained in the new copy) * @param context XPath dynamic evaluation context * @return the base URI */ public String getNewBaseURI(XPathContext context) { return ((NodeInfo)context.getContextItem()).getBaseURI(); }
public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException { if (context.getContextItem() instanceof NodeInfo) { return new AnyURIValue( ((NodeInfo) context.getContextItem()).getSystemId()); } throw new XPathException( "Unexpected XPath context for saxon:system-id"); } };
public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException { if (context.getContextItem() instanceof NodeInfo) { return new Int64Value( ((NodeInfo) context.getContextItem()) .getColumnNumber()); } throw new XPathException( "Unexpected XPath context for saxon:column-number"); } };
@Deprecated public static boolean typeof(final XPathContext context, final String nodeTypeName, final String fullTypeName, final String shortTypeName) { return TypeOfFunction.typeof((Node) ((ElementNode) context.getContextItem()).getUnderlyingNode(), nodeTypeName, fullTypeName, shortTypeName); }
/** * Evaluate the expression */ public Item evaluateItem(XPathContext context) throws XPathException { Item item = context.getContextItem(); if (item == null) { dynamicError("The context item is absent", getErrorCodeForUndefinedContext(), context); } return item; }
/** * Evaluate the expression */ public Item evaluateItem(XPathContext context) throws XPathException { Item item = context.getContextItem(); if (item==null) { dynamicError("The context item is not set", getErrorCodeForUndefinedContext(), context); } return item; }
/** * Evaluate the expression */ public Item evaluateItem(XPathContext context) throws XPathException { Item item = context.getContextItem(); if (item == null) { dynamicError("The context item is absent", getErrorCodeForUndefinedContext(), context); } return item; }
/** * Iterate over the value of the expression */ /*@NotNull*/ public SequenceIterator<?> iterate(XPathContext context) throws XPathException { Item<?> item = context.getContextItem(); if (item == null) { dynamicError("The context item is absent", getErrorCodeForUndefinedContext(), context); } return SingletonIterator.makeIterator(item); }
private static NodeInfo getContextRoot(XPathContext context) throws XPathException { Item contextItem = context.getContextItem(); if (contextItem == null) { throw new XPathException("Cannot call the key() function when there is no context item", "XTDE1270", context); } else if (!(contextItem instanceof NodeInfo)) { throw new XPathException("Cannot call the key() function when the context item is not a node", "XTDE1270", context); } return ((NodeInfo) contextItem).getRoot(); }
/** * Iterate over the value of the expression */ /*@NotNull*/ public SequenceIterator<?> iterate(XPathContext context) throws XPathException { Item<?> item = context.getContextItem(); if (item == null) { dynamicError("The context item is absent", getErrorCodeForUndefinedContext(), context); } return SingletonIterator.makeIterator(item); }
/** * Iterate over the value of the expression */ public SequenceIterator iterate(XPathContext context) throws XPathException { Item item = context.getContextItem(); if (item==null) { dynamicError("The context item is not set", getErrorCodeForUndefinedContext(), context); } return SingletonIterator.makeIterator(item); }
private static NodeInfo getContextRoot(XPathContext context) throws XPathException { Item contextItem = context.getContextItem(); if (contextItem == null) { throw new XPathException("Cannot call the key() function when there is no context item", "XTDE1270", context); } else if (!(contextItem instanceof NodeInfo)) { throw new XPathException("Cannot call the key() function when the context item is not a node", "XTDE1270", context); } return ((NodeInfo) contextItem).getRoot(); }
public SequenceIterator<ExternalObject<ItemWithMergeKeys>> map(XPathContext context) throws XPathException { Item<?> currentItem = context.getContextItem(); manualIterator.setContextItem(currentItem); ItemWithMergeKeys newItem = new ItemWithMergeKeys(currentItem, ms.mergeKeyDefinitions, ms.sourceName, keyContext); return SingletonIterator.makeIterator(new ObjectValue<>(newItem)); }; }