Documentation
¶
Overview ¶
Package xmlpath provides xmlpath for lua.
Example (Full) ¶
xmlpath.compile, xmlpath.load, xmlpath_node_ud, xmlpath_path_ud, xmlpath_iter_ud
state := lua.NewState()
Preload(state)
source := `
local xmlpath = require("xmlpath")
local data = [[
<channels>
<channel id="1" xz1="600" />
<channel id="2" />
<channel id="x" xz2="600" />
</channels>
]]
local data_path = "//channel/@id"
local node, err = xmlpath.load(data)
if err then error(err) end
local path, err = xmlpath.compile(data_path)
if err then error(err) end
local iter = path:iter(node)
for k, v in pairs(iter) do print(v:string()) end
`
if err := state.DoString(source); err != nil {
log.Fatal(err.Error())
}
Output: 1 2 x
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodeToString ¶
NodeToString lua xmlpath_node_ud:string() returns string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.