mirror of
https://github.com/fox0430/nim-xerces
synced 2026-01-01 23:11:28 +00:00
No description
| .github/workflows | ||
| examples | ||
| lowlevel | ||
| tests | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| xerces.nim | ||
| xerces.nimble | ||
nim-xerces
Nim bindings for Apache Xerces-C++.
Requirements
- Nim >= 2.0.6
- Apache Xerces-C++
Installtion
nimble install xerces
Usage
import pkg/xerces
const xmlData = """<?xml version="1.0"?>
<root>
<item id="1">Hello</item>
</root>"""
proc main() =
XMLPlatformUtils.initialize()
defer: XMLPlatformUtils.terminate()
let doc = parseXMLString(xmlData)
defer: doc.release()
let root = doc.getDocumentElement()
echo "Root: ", root.tagName()
for item in doc.getElementsByTagName("item"):
echo "Item: ", item.textContent()
when isMainModule:
main()
Build
nim cpp -r yourfile.nim
Note
Add the following lines to your .nimble
backend = "cpp"
License
MIT