diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-03-21 09:47:34 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-03-21 09:47:34 +0100 |
commit | f47b4939787074397c9ea37c1d892a1f7ccc7290 (patch) | |
tree | 7768be58efe0faab8e2dccb999686c6a674bf0d7 /tex/context/base/mkiv/lxml-aux.lua | |
parent | f923c957a3b322ae3ee8e7a0b20df1580869bee7 (diff) | |
download | context-f47b4939787074397c9ea37c1d892a1f7ccc7290.tar.gz |
2018-03-21 09:24:00
Diffstat (limited to 'tex/context/base/mkiv/lxml-aux.lua')
-rw-r--r-- | tex/context/base/mkiv/lxml-aux.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/lxml-aux.lua b/tex/context/base/mkiv/lxml-aux.lua index 59760cb94..78cf1d6bd 100644 --- a/tex/context/base/mkiv/lxml-aux.lua +++ b/tex/context/base/mkiv/lxml-aux.lua @@ -1022,3 +1022,29 @@ function xml.totable(x,strip,flat) return convert(x,strip,flat) end end + +-- namespace, name, attributes +-- name, attributes +-- name + +function xml.rename(e,namespace,name,attributes) + if type(e) ~= "table" or not e.tg then + return + end + if type(name) == "table" then + attributes = name + name = namespace + namespace = "" + elseif type(name) ~= "string" then + attributes = { } + name = namespace + namespace = "" + end + if type(attributes) ~= "table" then + attributes = { } + end + e.ns = namespace + e.rn = namespace + e.tg = name + e.at = attributes +end |