XML Parser for file endpoint
Use the XML Parser to read and write XML documents. The XML Parser uses the XLXP implementation of the StAX (JSR-173) specification. StAX is a cursor-based XML Parser that can both read from and write to XML.
This XML Parser is much faster than the traditional DOM-based Simple XML Parser because it does not need to load the whole XML structure in memory like DOM does. To access the XML Parser configuration parameters:
- Add a File endpoint.
- On the File endpoint configuration page, click Parser and select XML Parser from the list.
- Expand the Parser section to view the parameters.
Parameters
- Simple XPath
- Specify the value used (an expression similar to XPath) to discover elements to interpret them as entries. This parameter is also used to display the structure of the XML document to be written.
- Entry Tag
- Name of the element that holds each entry that is passed to the XML Parser.
- Value Tag
- Name of the element that holds each attribute value that is passed to the XML Parser.
- Comment
- Add your comments. The comment is not considered while parsing data.
- Detailed Log
- Select this check box to generate log messages with detailed debug information.
We can also configure the following advanced parameters. Under the Parser section, expand Advanced to view these parameters.
- Prefix to Namespace map
- Specify the list of mappings between the prefix and namespace in the following format: prefix=namespace.
- Separate each mapping with a vertical bar (|).
- If the prefix starts with $, it is considered as a default namespace declaration.
- The default value is prefix=namespace.
- XSD Schema Location
- Specify the schema location, which is used for display purposes only.
- Character Encoding
- Character encoding to use for reading or writing. The default value is UTF-8.
- For more information, go to the SDI documentation and search for Character Encoding in the XML Parser.
- Static Attribute Declarations
- Specify the declarations for attributes and prefixes. They are written with the static elements that are specified in the Simple XPath field.
- The following text is provided in this field by default:
<!-- this is an example for statically declared XML attributes/namespaces --> <!-- DocRoot xmlns="defaultNS" attr1="val2"> <Entry xmlns:p1="p1NS" p1:attr2="val2" /> </DocRoot-->- Ignore repeating XML declarations while reading
- Select this check box to always acknowledge the first XML declaration and to ignore the subsequent declarations.
- Coalescing
- Select this check box to coalesce adjacent character data sections.
- Omit XML declaration when writing
- Select this check box to suppress writing an XML declaration to the output. This option is useful for appending to an existing XML file.
- Multi-rooted Document
- Select this check box to output each entry as a stand-alone element, which creates a multi-rooted document.
- Indent Output
- Select this check box to indent the output according to the depth of the statement lines. The result is cosmetic only; it has no bearing upon the semantic content of the output file.
- Permit invalid XML characters when writing
- Select this check box to include the invalid XML characters in the XML tags. If this check box is not selected, an exception occurs during write operations on the XML document.
For detailed information about the XML Parser and examples of its usage, go to the SDI documentation and search for XML Parser.
Parent topic:
File parsers