1
0
Fork 0
forked from fun/fun

Some XML examples documentation fixes. (0.37.1)

This commit is contained in:
Johannes Findeisen 2025-12-10 23:42:00 +01:00
commit b2986075cb
6 changed files with 185 additions and 1 deletions

View file

@ -27,3 +27,84 @@ else
print(xml.name(root))
print("root text:")
print(xml.text(root))
/* Expected output:
doc handle:
<?xml version="1.0" encoding="UTF-8"?>
<company name="Acme Corp">
<departments>
<department id="eng" name="Engineering">
<team name="Platform">
<member id="u1">Alice</member>
<member id="u2">Bob</member>
</team>
<team name="Product">
<member id="u3">Carol</member>
</team>
</department>
<department id="ops" name="Operations">
<team name="SRE">
<member id="u4">Dave</member>
</team>
</department>
</departments>
<offices>
<office city="Berlin" country="DE"/>
<office city="Paris" country="FR"/>
</offices>
<note>Welcome to Acme!</note>
</company>
root name:
<?xml version="1.0" encoding="UTF-8"?>
<company name="Acme Corp">
<departments>
<department id="eng" name="Engineering">
<team name="Platform">
<member id="u1">Alice</member>
<member id="u2">Bob</member>
</team>
<team name="Product">
<member id="u3">Carol</member>
</team>
</department>
<department id="ops" name="Operations">
<team name="SRE">
<member id="u4">Dave</member>
</team>
</department>
</departments>
<offices>
<office city="Berlin" country="DE"/>
<office city="Paris" country="FR"/>
</offices>
<note>Welcome to Acme!</note>
</company>
root text:
<?xml version="1.0" encoding="UTF-8"?>
<company name="Acme Corp">
<departments>
<department id="eng" name="Engineering">
<team name="Platform">
<member id="u1">Alice</member>
<member id="u2">Bob</member>
</team>
<team name="Product">
<member id="u3">Carol</member>
</team>
</department>
<department id="ops" name="Operations">
<team name="SRE">
<member id="u4">Dave</member>
</team>
</department>
</departments>
<offices>
<office city="Berlin" country="DE"/>
<office city="Paris" country="FR"/>
</offices>
<note>Welcome to Acme!</note>
</company>
*/