In v1.0o, the attribute selector with "xml:lang" always returns an empty table. An example is as follows.
kpse.set_program_name("luatex")
local dom = require("luaxml-domobject")
local document = [[
<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0">
<locale xml:lang="en-US">
</locale>
<locale xml:lang="zh-CN">
</locale>
</style>
]]
local obj = dom.parse(document)
for i, locale in ipairs(obj:query_selector("locale[xml:lang=\"en-US\"]")) do
print(i, locale:get_element_name(), locale:get_attribute("xml:lang"))
end
This is mainly because the colon is not included in the attr_name pattern.
Some comments in the code say that luaxml doesn't support XML namespaces and elements must be queried with "namespace|element". But the "|" only works with tag name not attribute name.
In v1.0o, the attribute selector with "xml:lang" always returns an empty table. An example is as follows.
This is mainly because the colon is not included in the
attr_name
pattern.https://github.com/michal-h21/LuaXML/blob/30b13e41b0e2450a5e99ca908589fb07f0419266/luaxml-parse-query.lua#L24
Some comments in the code say that
luaxml
doesn't support XML namespaces and elements must be queried with"namespace|element"
. But the "|
" only works with tag name not attribute name.