Package com.altova.raptorxml
Interface XQuery
public interface XQuery
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalVariable(String name, String value) Add name and value for an external variable.voidClear the list of external variables.booleanExecute and save the result to file.Execute and return the result as string.booleanexecuteUpdate(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.booleanisValid()Validates the XQuery filebooleanValidates the XQueryUpdate filevoidsetChartExtensionsEnabled(boolean enable) Enable or disable the chart extensions.voidsetDotNetExtensionsEnabled(boolean enable) Enable or disable the .NET extensions.voidsetIndentCharacters(String chars) Characters used for indentation.voidsetInputXMLFileName(String xmlFile) Set the file name for the input XML data.voidsetInputXMLFromText(String xmlText) Set the text value for the input XML data.voidsetJavaExtensionsEnabled(boolean enable) Enable or disable the Java extensions.voidsetKeepFormatting(boolean keep) Enable or disable the keeping of formatting on the output (to be used only for XQueryUpdate executions)voidsetLoadXMLWithPSVI(boolean load) Enable/disable loading XML with PSVIvoidsetOutputEncoding(String encoding) Set the encoding for the result document.voidsetOutputIndent(boolean indent) Enable/disable the indentation option for the result document.voidsetOutputMethod(String outputMethod) Set the serialization method for the result document.voidsetOutputOmitXMLDeclaration(boolean omit) Enable/disable the serialization option omitXMLDeclaration for the result document.voidSet the write mode of the XQueryUpdate functionality (to be used only for XQueryUpdate executions)voidsetVersion(XQuery.ENUMXQueryVersion version) Set the XQuery versionvoidsetXincludeSupport(boolean support) Enable/disable xinclude supportvoidsetXMLValidationErrorAsWarning(boolean treat) Enable/disable treating XML validation errors as warningsvoidProcessing modevoidsetXQueryFileName(String queryFile) Set file name of the XQuery document.voidsetXQueryFromText(String queryText) Set the text value for the XQuery statement.voidSet the XQuery Update Facility versionvoidsetXSDVersion(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)
-