-
Notifications
You must be signed in to change notification settings - Fork 4
bkersten/lua-xpath
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
lua-xpath is a simple XPath library to help stay sane while working with XML in Lua Dependencies ------------------ LuaExpat and Lua Object Model (http:https://matthewwild.co.uk/projects/luaexpat/index.html) Usage -------- local lom = require "lxp.lom" local xpath = require "xpath" local xml = [[ <root> <node foo="bar">sample text</node> <node>other text</node> </root> ]] local xml_tree = lom.parse(xml) local nodes = xpath.selectNodes(xml_tree, '/root/node[@foo="bar"]/text()') for _,val in ipairs(nodes) do print(val) end The output will be "sample text"
About
A simple XPath library to help stay sane while working with XML in Lua
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published