1
0
Fork 0
forked from fun/fun

Added very basic XML support using libxml2. (0.35.0)

This commit is contained in:
Johannes Findeisen 2025-12-09 03:59:49 +01:00
commit e65756226d
17 changed files with 436 additions and 3 deletions

17
examples/xml_minimal.fun Normal file
View file

@ -0,0 +1,17 @@
/*
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2025 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*
* Added: 2025-12-09
*/
// Minimal XML example using libxml2-backed builtins
doc = xml_parse("<root><item id=\"1\">a</item><item id=\"2\">b</item></root>")
print("doc handle=\(doc)")
root = xml_root(doc)
print("root name=\(xml_name(root)) text=\(xml_text(root))")