https://github.com/whothefluff/abap-xml-renderer
ABAP to XML
https://github.com/whothefluff/abap-xml-renderer
abap xml xml-renderer
Last synced: 28 days ago
JSON representation
ABAP to XML
- Host: GitHub
- URL: https://github.com/whothefluff/abap-xml-renderer
- Owner: whothefluff
- Created: 2025-01-11T21:58:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-12T15:56:46.000Z (over 1 year ago)
- Last Synced: 2025-01-12T16:37:06.428Z (over 1 year ago)
- Topics: abap, xml, xml-renderer
- Language: ABAP
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# abap-xml-renderer
ABAP variables to XML format
## Use
- Create an instance of the simple renderer (**optionally** passing static mappings for the names of the tags),
which implements _ZIF_XML_RENDERER_ and handles internal tables, structures, and elemental variables[^1]:
```abap
final(xml_renderer) = new zcl_simple_xml_renderer( ).
```
[^1]: You can also implement interface _ZIF_XML_RENDERER_ yourself to create the XML file however you prefer
- Call the process method with an XML Writer and a variable as arguments:
```abap
final(writer) = cl_sxml_string_writer=>create( ).
xml_renderer->process( i_writer = cast #( writer )
i_data = VAR ).
```
- Use the writer as usual:
```abap
final(encoded_xml) = writer->get_output( ).
```
### Example
You can run class _ZCL_XML_SIMPLE_RENDERER_EG_APP_ to see how a short XML file can be generated.
# dependencies:
- https://github.com/whothefluff/abap-exceptions
- https://github.com/whothefluff/abap-messages