The xqueryupdate command takes an XQuery or XQuery Update file as its single argument and executes it. If an optional input XML file is specified, then this XML file is processed with the XQuery Update commands submitted in the XQuery(Update)-File. In this case, the updates can be applied directly to the input file or the updated XML data can be written to an output XML file. The input and output files are specified as options. If the XQuery(Update)-File contains only XQuery instructions and no XQuery Update instructions, then the command carries out a straightforward XQuery execution.
raptorxml xqueryupdate [options] XQuery(Update)-File |
•The argument XQuery(Update)-File is the path and name of the XQuery file (.xq) or XQuery Update (.xqu) file to be executed. If the file contains XQuery Update instructions, then these are executed on the input XML file. Otherwise, the command works as an XQuery execution command.
•You can specify whether XQuery Update 1.0 or 3.0 should be used. By default XQuery Update 3.0 is used.
Examples
Examples of the xqueryupdate command:
•raptorxml xqueryupdate --output=c:\Output.xml c:\TestQuery.xq (Writes the output of the XQuery file to the output file.)
•raptorxml xqueryupdate --input=c:\Input.xml --output=c:\Output.xml --updated-xml=asmainresult c:\UpdateFile.xqu (Updates Input.xml using the update instructions in UpdateFile.xqu, and writes the update to Output.xml.)
•raptorxml xqueryupdate --input=c:\Input.xml --output=c:\Output.xml --updated-xml=writeback c:\UpdateFile.xq (Updates Input.xml using the update instructions in UpdateFile.xq. The file Output.xml is not created.)
•raptorxml xqueryupdate --input=c:\Input.xml --output=c:\Output.xml --updated-xml=discard c:\TestQuery.xqu (Updates are discarded. The input file is not modified. The file Output.xml will be created, but will not contain any updated XML.)
•raptorxml xqueryupdate --input=c:\Input.xml --output=c:\Output.xml c:\TestQuery.xqu (Updates are discarded as in the previous example. This is because the default value of the --updated-xml option is discard.)
RaptorXML (and RaptorXMLServer for administration commands) on Windows raptorxml (and raptorxmlserver for administration commands) on Windows and Unix (Linux, Mac) * Note that lowercase (raptorxml and raptorxmlserver) works on all platforms (Windows, Linux, and Mac), while upper-lower (RaptorXML) works only on Windows and Mac. * Use forward slashes on Linux and Mac, backslashes on Windows. |
On Windows systems: When spaces or special characters occur in strings (for example in file or folder names, or company, person or product names), use quotes: for example, "My File". Note, however, that a backslash followed by a double-quotation mark (for example, "C:\My directory\") might not be read correctly. This is because the backslash character is also used to indicate the start of an escape sequence, and the escape sequence \" stands for the double-quotation mark character. If you want to escape this sequence of characters, use a preceding backslash, like this: \\". To summarize: If you need to write a file path that contains spaces or an end backslash, write it like this: "C:\My Directory\\". |
Options
Options are listed in short form (if available) and long form. You can use one or two dashes for both short and long forms. An option may or may not take a value. If it takes a value, it is written like this: --option=value. Values can be specified without quotes except in two cases: (i) when the value string contains spaces, or (ii) when explicitly stated in the description of the option that quotes are required. If an option takes a Boolean value and no value is specified, then the option's default value is TRUE. Use the --h, --help option to display information about the command.
--indent-characters = VALUE Specifies the character string to be used as indentation. |
--input = FILE The URL of the XML file to be transformed. |
--omit-xml-declaration = true|false Serialization option to specify whether the XML declaration should be omitted from the output or not. If true, there will be no XML declaration in the output document. If false, an XML declaration will be included. Default value is false. Note: Boolean option values are set to true if the option is specified without a value. |
output = FILE, xsltoutput = FILE The URL of the primary-output file. For example, in the case of multiple-file HTML output, the primary-output file will be the location of the entry point HTML file. Additional output files, such as generated image files, are reported as xslt-additional-output-files. If no --output or --xsltoutput option is specified, output is written to standard output. |
--output-encoding = VALUE The value of the encoding attribute in the output document. Valid values are names in the IANA character set registry. Default value is UTF-8. |
--output-indent = true|false If true, the output will be indented according to its hierarchic structure. If false, there will be no hierarchical indentation. Default is false. Note: Boolean option values are set to true if the option is specified without a value. |
--output-method = xml|html|xhtml|text Specifies the output format. Default value is xml. |
--p | --param = KEY:VALUE Specifies the value of an external parameter. An external parameter is declared in the XQuery document with the declare variable declaration followed by a variable name and then the external keyword followed by the trailing semi-colon. For example: declare variable $foo as xs:string external; The external keyword $foo becomes an external parameter, the value of which is passed at runtime from an external source. The external parameter is given a value with the CLI command. For example: --param=foo:'MyName' In the description statement above, KEY is the external parameter name, VALUE is the value of the external parameter, given as an XPath expression. Parameter names used on the CLI must be declared in the XQuery document. If multiple external parameters are passed values on the CLI, each must be given a separate --param option. Double quotes must be used if the XPath expression contains spaces. |
Specifies a global stylesheet parameter. KEY is the parameter name, VALUE is an XPath expression that provides the parameter value. Parameter names used on the CLI must be declared in the stylesheet. If multiple parameters are used, the --param switch must be used before each parameter. Double quotes must be used around the XPath expression if it contains a space—whether the space is in the XPath expression itself or in a string literal in the expression. For example: raptorxml xslt --input=c:\Test.xml --output=c:\Output.xml --param=date://node[1]/@att1 --p=title:'stringwithoutspace' --param=title:"'string with spaces'" --p=amount:456 c:\Test.xslt |
|
--xpath-static-type-errors-as-warnings = true|false If true, downgrades to warnings any type errors that are detected in the XPath static context. Whereas an error would cause the execution to fail, a warning would enable processing to continue. Default is false. |
--xquery-update-version = 1|1.0|3|3.0| Specifies whether the XQuery processor should use XQuery Update Facility 1.0 or XQuery Update Facility 3.0. Default value is 3. |
--keep-formatting = true|false Keeps the formatting of the target document to the maximum extent that this is possible. Default is: true. |
--updated-xml = discard|writeback|asmainresult Specifies how the updated XML file should be handled. •discard: The update is discarded and not written to file. Neither the input file nor the output file will be updated. Note that this is the default. •writeback: Writes the update back to the input XML file that is specified with the --input option. •asmainresult: Writes the update to the output XML file that is specified with the --output option. If the --output option is not specified, then the update is written to the standard output. In both cases, the input XML file will not be modified. Default is discard. |
|
--load-xml-with-psvi = true|false Enables validation of input XML files and generates post-schema-validation information for them. Default is: true. |
--schema-imports = load-by-schemalocation | load-preferring-schemalocation | load-by-namespace | load-combining-both | license-namespace-only Specifies the behaviour of xs:import elements, each of which has an optional namespace attribute and an optional schemaLocation attribute: <import namespace="someNS" schemaLocation="someURL">. The option specifies whether to load a schema document or just license a namespace, and, if a schema document is to be loaded, which information should be used to find it. Default: load-preferring-schemalocation. The behavior is as follows: •load-by-schemalocation: The value of the schemaLocation attribute is used to locate the schema, taking account of catalog mappings. If the namespace attribute is present, the namespace is imported (licensed). •load-preferring-schemalocation: If the schemaLocation attribute is present, it is used, taking account of catalog mappings. If no schemaLocation attribute is present, then the value of the namespace attribute is used via a catalog mapping. This is the default value. •load-by-namespace: The value of the namespace attribute is used to locate the schema via a catalog mapping. •load-combining-both: If either the namespace or schemaLocation attribute has a catalog mapping, then the mapping is used. If both have catalog mappings, then the value of the --schema-mapping option (XML/XSD option) decides which mapping is used. If no catalog mapping is present, the schemaLocation attribute is used. •license-namespace-only: The namespace is imported. No schema document is imported. |
--schemalocation-hints = load-by-schemalocation | load-by-namespace | load-combining-both | ignore Specifies the behavior of the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes: Whether to load a schema document, and, if yes, which information should be used to find it. Default: load-by-schemalocation. •The load-by-schemalocation value uses the URL of the schema location in the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes in XML instance documents. This is the default value. •The load-by-namespace value takes the namespace part of xsi:schemaLocation and an empty string in the case of xsi:noNamespaceSchemaLocation and locates the schema via a catalog mapping. •If load-combining-both is used and if either the namespace part or the URL part has a catalog mapping, then the catalog mapping is used. If both have catalog mappings, then the value of the --schema-mapping option (XML/XSD option) decides which mapping is used. If neither the namespace nor URL has a catalog mapping, the URL is used. •If the option's value is ignore, then the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes are both ignored. |
--schema-mapping = prefer-schemalocation | prefer-namespace If schema location and namespace are both used to find a schema document, specifies which of them should be preferred during catalog lookup. (If either the --schemalocation-hints or the --schema-imports option has a value of load-combining-both, and if the namespace and URL parts involved both have catalog mappings, then the value of this option specifies which of the two mappings to use (namespace mapping or URL mapping; the prefer-schemalocation value refers to the URL mapping).) Default is prefer-schemalocation. |
--xinclude = true|false Enables XML Inclusions (XInclude) support. Default value is false. When false, XInclude's include elements are ignored. Note: Boolean option values are set to true if the option is specified without a value. |
--xml-mode = wf|id|valid Specifies the XML processing mode to use for the XML instance document: wf=wellformed check; id=wellformed with ID/IDREF checks; valid=validation. Default value is wf. Note that a value of valid requires that each instance document loaded during processing references a DTD. If no DTD exists, an error is reported. |
--xml-mode-for-schemas = wf|id|valid Specifies the XML processing mode to use for XML schema documents: wf=wellformed check; id=wellformed with ID/IDREF checks; valid=validation. Default value is wf. Note that a value of valid requires that each schema document loaded during processing references a DTD. If no DTD exists, an error is reported. |
--xml-validation-error-as-warning = true|false If true, treats validation errors as warnings. If errors are treated as warnings, additional processing, such as XSLT transformations, will continue regardless of errors. Default is false. |
--xsd = FILE Specifies one or more XML Schema documents to use for the validation of XML instance documents. Add the option multiple times to specify more than one schema document. |
--xsd-version = 1.0|1.1|detect Specifies the W3C Schema Definition Language (XSD) version to use. Default is 1.0. This option can also be useful to find out in what ways a schema which is 1.0-compatible is not 1.1-compatible. The detect option is an Altova-specific feature. It enables the version of the XML Schema document (1.0 or 1.1) to be detected by reading the value of the vc:minVersion attribute of the document's <xs:schema> element. If the value of the @vc:minVersion attribute is 1.1, the schema is detected as being version 1.1. For any other value, or if the @vc:minVersion attribute is absent, the schema is detected as being version 1.0. |
|
--catalog = FILE Specifies the absolute path to a root catalog file that is not the installed root catalog file. The default value is the absolute path to the installed root catalog file (<installation-folder>\Altova\RaptorXMLServer2025\etc\RootCatalog.xml). See the section, XML Catalogs, for information about working with catalogs. |
--user-catalog = FILE Specifies the absolute path to an XML catalog to be used in addition to the root catalog. See the section, XML Catalogs, for information about working with catalogs. |
--enable-globalresources = true|false Enables global resources. Default value is false. Note: Boolean option values are set to true if the option is specified without a value. |
|
These options define the handling of special extension functions that are available in a number of Enterprise-level Altova products (such as XMLSpy Enterprise Edition). Their use is described in the user manuals of these products. --chartext-disable = true|false Disables chart extensions. Default value is false. Note: Boolean option values are set to true if the option is specified without a value. |
--dotnetext-disable = true|false Disables .NET extensions. Default value is false. Note: Boolean option values are set to true if the option is specified without a value. |
--jvm-location = FILE FILE specifies the location of the Java Virtual Machine (DLL on Windows, shared object on Linux). The JVM is needed if you use Java extension functions in your XSLT/XQuery code. Default is false. |
--javaext-barcode-location = FILE Specifies the path to the folder that contains the barcode extension file AltovaBarcodeExtension.jar. The path must be given in one of the following forms: •A file URI, for example: --javaext-barcode-location="file:///C:/Program Files/Altova/RaptorXMLServer2025/etc/jar/" •A Windows path with backslashes escaped, for example: --javaext-barcode-location="C:\\Program Files\\Altova\\RaptorXMLServer2025\\etc\\jar\\" |
--javaext-disable = true|false Disables Java extensions. Default value is false. Note: Boolean option values are set to true if the option is specified without a value. |
|
--error-format = text|shortxml|longxml Specifies the format of the error output. Default value is text. The other options generate XML formats, with longxml generating more detail. |
--error-limit = N | unlimited Specifies the error limit with a value range of 1 to 9999 or unlimited. The default value is 100. Processing stops when the error limit is reached. Useful for limiting processor use during validation/transformation. |
--info-limit = N | unlimited Specifies the information message limit in the range 1-65535 or unlimited. Processing continues if the specified info limit is reached, but further messages are not reported. The default value is 100. |
--help Displays help text for the command. For example, valany --h. (Alternatively the help command can be used with an argument. For example: help valany.) |
--listfile = true|false If true, treats the command's InputFile argument as a text file containing one filename per line. Default value is false. (An alternative is to list the files on the CLI with a space as separator. Note, however, that CLIs have a maximum-character limitation.) Note that the --listfile option applies only to arguments, and not to options. Note: Boolean option values are set to true if the option is specified without a value. |
--log-output = FILE Writes the log output to the specified file URL. Ensure that the CLI has write permission to the output location. |
--network-timeout = VALUE Specifies the timeout in milliseconds for remote I/O operations. Default is: 40000. |
--recurse = true|false Used to select files within sub-directories, including in ZIP archives. If true, the command's InputFile argument will select the specified file also in subdirectories. For example: "test.zip|zip\test.xml" will select files named test.xml at all folder levels of the zip folder. References to ZIP files must be given in quotes. The wildcard characters * and ? may be used. So, *.xml will select all .xml files in the (zip) folder. The option's default value is false. Note: Boolean option values are set to true if the option is specified without a value. |
--verbose = true|false A value of true enables output of additional information during validation. Default value is false. Note: Boolean option values are set to true if the option is specified without a value. |
--verbose-output = FILE Writes verbose output to FILE. |
--version Displays the version of RaptorXML Server. If used with a command, place --version before the command. |
--warning-limit = N | unlimited Specifies the warning limit in the range 1-65535 or unlimited. Processing continues if this limit is reached, but further warnings are not reported. The default value is 100. |
|