Platforms to show: All Mac Windows Linux Cross-Platform

Back to XPathProcessorMBS class.

XPathProcessorMBS.AddParameters(values as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Sets parameters given values in the dictionary.

This is a convenience function.
We loop over the entries in the dictionary, convert keys to XdmAtomicValue and values XdmValue objects internally and set parameters.

XPathProcessorMBS.AddProperties(values as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Sets properties given values in the dictionary.

This is a convenience function.
We loop over the entries in the dictionary, convert keys and values to string and set properties.

XPathProcessorMBS.clearParameters

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Clear parameter values set.

XPathProcessorMBS.clearProperties

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Clears all properties.

XPathProcessorMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Default constructor.

Creates a Saxon-HE XPath product

See also:

XPathProcessorMBS.Constructor(other as XPathProcessorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The copy constructor.

See also:

XPathProcessorMBS.Constructor(SaxonProcessor as SaxonProcessorMBS, CWD as String = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Constructor with the SaxonProcessor supplied.

SaxonProcessor: The SaxonProcessor object
CWD: The current working directory

See also:

XPathProcessorMBS.declareNamespace(prefix as String, uri as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Declare a namespace binding as part of the static context for XPath.

prefix: The namespace prefix. If the value is a zero-length string, this method sets the default namespace for elements and types.
uri: The namespace URI. It is possible to specify a zero-length string to "undeclare" a namespace; in this case the prefix will not be available for use, except in the case where the prefix is also a zero length string, in which case the absence of a prefix implies that the name is in no namespace. Assume the prefix or uri is "".

XPathProcessorMBS.declareVariable(name as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Declare a variable as part of the static context for XPath expressions.

compiled using this XPathCompiler.
It is an error for the XPath expression to refer to a variable unless it has been declared. This method declares the existence of the variable, but it does not bind any value to the variable; that is done later, when the XPath expression is evaluated. The variable is allowed to have any type (that is, the required type is item()*).

name: The name of the variable, expressions as a clark name string

XPathProcessorMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The destructor.

XPathProcessorMBS.effectiveBooleanValue(xpathStr as String, encoding as string = "") as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Evaluate the XPath expression, returning the effective boolean value of the result.

xpathStr: supplied as a character string
encoding: the encoding of the string.

If not specified then the platform default encoding is used.

XPathProcessorMBS.evaluate(xpathStr as String, encoding as string = "") as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Compile and evaluate an XPath expression

xpathStr: supplied as a character string
encoding: the encoding of the string. If not specified then the platform default encoding is used.

Returns a XdmValueMBS representing the results of the expression.

XPathProcessorMBS.evaluateSingle(xpathStr as String, encoding as string = "") as XdmItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Compile and evaluate an XPath expression.
Example
Var processor As New SaxonProcessorMBS
Var xpathProc As XPathProcessorMBS = processor.newXPathProcessor

// parse XML
Var Input As XdmNodeMBS = processor.parseXmlFromString("<out><person>text1</person><person>text2</person><person>text3</person></out>")
xpathProc.ContextItem = Input

Var result As XdmItemMBS = xpathProc.evaluateSingle("//person[1]")
Var message As String = result.StringValue

MessageBox message // shows text1

The result is expected to be a single XdmItem or nil.

xpathStr: supplied as a character string
encoding: the encoding of the string. If not specified then the platform default encoding is used.

Returns a XdmItemMBS object or nullptr if the expression returns an empty sequence. If the expression returns a sequence of more than one item, any items after the first are ignored.

Some examples using this method:

XPathProcessorMBS.importSchemaNamespace(URI as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Import a schema namespace.

Here we add the element and attribute declarations and type definitions contained in a given namespace to the static context for the XPath expression.

This method will not cause the schema to be loaded. This method will not fail if the schema has not been loaded (but in that case the set of declarations and definitions made available to the XPath expression is empty). The schema document for the specified namespace may be loaded before or after this method is called.

This method does not bind a prefix to the namespace. That must be done separately, using the declareNamespace(String, String) method.

uri: The schema namespace to be imported. To import declarations in a no-namespace schema, supply a zero-length string.

XPathProcessorMBS.ParameterValue(name as String) as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Get/Set a parameter.

Name: The name of the parameter, as a string.
For namespaced parameter use the JAXP solution i.e. "{uri}name" value of the query parameter.
Assign "" to clear a previously set value.

Some of the properties on this class may just internally set/get a parameter.
(Read and Write computed property)

XPathProcessorMBS.PropertyValue(name as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
A property specific to the processor in use.

Some of the properties on this class may just internally set/get a property.
(Read and Write computed property)

XPathProcessorMBS.removeParameter(name as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Remove a parameter (name, value) pair.

Please pass the name of the parameter.
Returns outcome of the removal, true if found.

The items on this page are in the following plugins: MBS XML Plugin.


The biggest plugin in space...