aboutsummaryrefslogtreecommitdiff
path: root/core/encoding/xml/example
diff options
context:
space:
mode:
Diffstat (limited to 'core/encoding/xml/example')
-rw-r--r--core/encoding/xml/example/xml_example.odin8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/encoding/xml/example/xml_example.odin b/core/encoding/xml/example/xml_example.odin
index 24a277de6..82938c223 100644
--- a/core/encoding/xml/example/xml_example.odin
+++ b/core/encoding/xml/example/xml_example.odin
@@ -2,6 +2,7 @@ package xml_example
import "core:encoding/xml"
import "core:mem"
+import "core:strings"
import "core:fmt"
Error_Handler :: proc(pos: xml.Pos, fmt: string, args: ..any) {
@@ -28,7 +29,12 @@ _main :: proc() {
doc, err := xml.parse(DOC, OPTIONS, FILENAME, Error_Handler)
defer xml.destroy(doc)
- xml.print(doc)
+ buf: strings.Builder
+ defer strings.destroy_builder(&buf)
+ w := strings.to_writer(&buf)
+
+ xml.print(w, doc)
+ println(strings.to_string(buf))
if err != .None {
printf("Parse error: %v\n", err)