Skip to content

RuifengFu/XMLParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XMLParser

XML Parser is an XML parsing library written in MoonBit. It can parse XML strings into structured data, supporting basic elements, attributes, comments, CDATA, processing instructions, etc., of XML documents. The library is implemented using parser combinators.

Examples

let str =
#|<?xml version="1.0"?>
#|<root>
#|  Text before
#|  <child empty="true"/>
#|  Text between
#|  <?php echo "processing instruction" ?>
#|  <![CDATA[Preserving <tags> in CDATA]]>
#|  <!-- A comment here -->
#|  <child>
#|    Nested text
#|    <grandchild />
#|    More nested text
#|  </child>
#|  Text after
#|</root>
let xml = @lib.xml_from_string(str)
let xml = @lib.xml_from_iter(str.iter())
let (xml, ctx) = @lib.xml_from_string_with_ctx(str)
let xml = xml.unwrap()
println(xml)

TestCase

You can download testsuite from w3c

About

a xmlparser lib in MoonBit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors