Package com.altova.raptorxml
Interface XQuery
public interface XQuery
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
static enum
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExternalVariable
(String name, String value) Add name and value for an external variable.void
Clear the list of external variables.boolean
Execute and save the result to file.Execute and return the result as string.boolean
executeUpdate
(String outputFile) Execute XQueryUpdate and save the result to file.Execute XQueryUpdate and return the result as string.Get the last error message from the engine.boolean
isValid()
Validates the XQuery fileboolean
Validates the XQueryUpdate filevoid
setChartExtensionsEnabled
(boolean enable) Enable or disable the chart extensions.void
setDotNetExtensionsEnabled
(boolean enable) Enable or disable the .NET extensions.void
setIndentCharacters
(String chars) Characters used for indentation.void
setInputXMLFileName
(String xmlFile) Set the file name for the input XML data.void
setInputXMLFromText
(String xmlText) Set the text value for the input XML data.void
setJavaExtensionsEnabled
(boolean enable) Enable or disable the Java extensions.void
setKeepFormatting
(boolean keep) Enable or disable the keeping of formatting on the output (to be used only for XQueryUpdate executions)void
setLoadXMLWithPSVI
(boolean load) Enable/disable loading XML with PSVIvoid
setOutputEncoding
(String encoding) Set the encoding for the result document.void
setOutputIndent
(boolean indent) Enable/disable the indentation option for the result document.void
setOutputMethod
(String outputMethod) Set the serialization method for the result document.void
setOutputOmitXMLDeclaration
(boolean omit) Enable/disable the serialization option omitXMLDeclaration for the result document.void
Set the write mode of the XQueryUpdate functionality (to be used only for XQueryUpdate executions)void
setVersion
(XQuery.ENUMXQueryVersion version) Set the XQuery versionvoid
setXincludeSupport
(boolean support) Enable/disable xinclude supportvoid
setXMLValidationErrorAsWarning
(boolean treat) Enable/disable treating XML validation errors as warningsvoid
Processing modevoid
setXQueryFileName
(String queryFile) Set file name of the XQuery document.void
setXQueryFromText
(String queryText) Set the text value for the XQuery statement.void
Set the XQuery Update Facility versionvoid
setXSDVersion
(XMLValidator.ENUMXSDVersion version) XSD specification version
-
Method Details
-
isValid
Validates the XQuery file- Throws:
RaptorXMLException
-
isValidUpdate
Validates the XQueryUpdate file- Throws:
RaptorXMLException
-
execute
Execute and save the result to file. In case of an error, use functiongetLastErrorMessage()
to get additional information.- Parameters:
outputFile
- path to result file- Returns:
- true on success, false on failure
- Throws:
RaptorXMLException
-
executeUpdate
Execute XQueryUpdate and save the result to file. In case of an error, use functiongetLastErrorMessage()
to get additional information.- Parameters:
outputFile
- path to result file- Returns:
- true on success, false on failure
- Throws:
RaptorXMLException
-
executeAndGetResultAsString
Execute and return the result as string. In case of an error, use functiongetLastErrorMessage()
to get additional information.- Returns:
- result as string.
- Throws:
RaptorXMLException
-
executeUpdateAndGetResultAsString
Execute XQueryUpdate and return the result as string. In case of an error, use functiongetLastErrorMessage()
to get additional information.- Returns:
- result as string.
- Throws:
RaptorXMLException
-
setVersion
Set the XQuery version- Parameters:
version
- The version: 1.0 or 3.0
-
setXqueryUpdateVersion
Set the XQuery Update Facility version- Parameters:
version
- The version: 1.0 or 3.0
-
setXQueryFileName
Set file name of the XQuery document.- Parameters:
queryFile
- an absolute URL giving the base location of the XQuery file
-
setInputXMLFileName
Set the file name for the input XML data. Please note that you have to use absolute URLs.- Parameters:
xmlFile
- an absolute URL giving the base location of the XML data
-
setXQueryFromText
Set the text value for the XQuery statement.- Parameters:
queryText
- a string containing the XQuery statement
-
setInputXMLFromText
Set the text value for the input XML data. Please note that you have to use absolute URLs.- Parameters:
xmlText
- a string containing XML data
-
setOutputEncoding
Set the encoding for the result document.- Parameters:
encoding
- a string containing an encoding name (for example: UTF-8, UTF-16, ASCII, 8859-1, 1252 )
-
setOutputIndent
void setOutputIndent(boolean indent) Enable/disable the indentation option for the result document. -
setOutputMethod
Set the serialization method for the result document.- Parameters:
outputMethod
- a string containing the serialization method. Valid values: xml, xhtml, html, text.
-
setOutputOmitXMLDeclaration
void setOutputOmitXMLDeclaration(boolean omit) Enable/disable the serialization option omitXMLDeclaration for the result document. -
addExternalVariable
Add name and value for an external variable.- Parameters:
name
- a valid QName as the variable namevalue
- value for the variable - value which will be evaluated as a string
-
clearExternalVariableList
void clearExternalVariableList()Clear the list of external variables. -
setDotNetExtensionsEnabled
void setDotNetExtensionsEnabled(boolean enable) Enable or disable the .NET extensions.- Parameters:
enable
- 'true' to enable, 'false' otherwise
-
setJavaExtensionsEnabled
void setJavaExtensionsEnabled(boolean enable) Enable or disable the Java extensions.- Parameters:
enable
- 'true' to enable, 'false' otherwise
-
setChartExtensionsEnabled
void setChartExtensionsEnabled(boolean enable) Enable or disable the chart extensions.- Parameters:
enable
- 'true' to enable, 'false' otherwise
-
getLastErrorMessage
String getLastErrorMessage()Get the last error message from the engine.- Returns:
- last error message
-
setXSDVersion
XSD specification version- Parameters:
version
- Version to be used by the validation engine
-
setXincludeSupport
void setXincludeSupport(boolean support) Enable/disable xinclude support -
setXMLValidationMode
Processing mode- Parameters:
mode
- XML Validation mode to be used by the validation engine
-
setIndentCharacters
Characters used for indentation. -
setLoadXMLWithPSVI
void setLoadXMLWithPSVI(boolean load) Enable/disable loading XML with PSVI -
setXMLValidationErrorAsWarning
void setXMLValidationErrorAsWarning(boolean treat) Enable/disable treating XML validation errors as warnings -
setUpdatedXMLWriteMode
Set the write mode of the XQueryUpdate functionality (to be used only for XQueryUpdate executions) -
setKeepFormatting
void setKeepFormatting(boolean keep) Enable or disable the keeping of formatting on the output (to be used only for XQueryUpdate executions)
-