10.3.37 getXmlDecl (gets the XML declaration)
Syntax
getXmlDecl item-name [file-path-name]
Description
This command searches for XML declaration from the XML file specified for argument and outputs the value of the specified item.
Arguments
- item-name
-
This command specifies the item name of the XML declaration to be obtained.
- file-path-name
-
This command specifies the path of a XML file. If you do not specify the file path name, input from the standard input.
Output to the standard output
Value of the item of XML declaration
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
Not less than 1 |
Termination with an error |
Notes
-
If matching item is not found, the command terminates with an error.
-
If the value of the matched item is null character string, the command terminates with an error.
Examples
XML data (data.xml) <?xml version="1.0" encoding="UTF-8" standalone="no"?> <data> … </data> getXmlDecl encoding data.xml # "UTF-8" is output.