sXML Library - Formats
The formats supported by sXML Library are represented by the constants of the interface IF_SXML:
- XML 1.0 (constant IF_SXML=>CO_XT_XML10)
- XOP (constant IF_SXML=>CO_XT_XOP)
stringfor the character string. The second component PARTS is a hashed table for the byte strings. The key column CONTENT_ID is the reference target for the references in the xop:Include elements. The column BINARY_DATA has the type
xstringand the raw data is passed to this column.
- Binary XML (constant IF_SXML=>CO_XT_BINARY)
- JSON (constant IF_SXML=>CO_XT_JSON)
When an XML writer is created, the format created by the writer is defined as follows:
- For all formats except XOP, the factory methods CREATE of the various writers have an input parameter TYPE to which the value of the constants above can be passed. The XML 1.0 format is used by default. The character format can be passed to the input parameter ENCODING. The default value is UTF-8. Writers Binary XML only accept the default.
- Only the special class CL_SXML_XOP_WRITER can be used for the XOP format. The factory method CREATE of this class does not need an input parameter. XOP writers always return data objects with the type IF_SXML_XOP=>XOP_PACKAGE.
When an XML reader is created, it detects the format of the data passed to the parameter INPUT of the factory method CREATE. The same reader classes can be used for all formats except XOP. Only the special class CL_SXML_XOP_READER can be used for the XOP format. The factory method CREATE of this class expects an actual parameter of the type IF_SXML_XOP=>XOP_PACKAGE.
7.31 | 7.40 | 7.54
- The attribute TYPE declared in the interface IF_SXML contains the type of every XML reader and XML writer or the format it is editing. The possible values of the attribute are the same as those of the constants CO_XT_... of the interface.
- XML readers and XML writers of a particular XML format can be used to transform this format to another format.
- An XML writer (with the character format "UTF16BE" or "UTF16LE" that was passed to parameter ENCODING) uses the byte order mark (BOM) required by the XML standard as the prefix for the written XML data.