summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua25
1 files changed, 9 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
index ed0f03fd8c7..78cf1d6bd58 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
@@ -134,12 +134,10 @@ end
function xml.collect_tags(root, pattern, nonamespace)
local collected = xmlapplylpath(root,pattern)
if collected then
- local t = { }
- local n = 0
+ local t, n = { }, 0
for c=1,#collected do
- local e = collected[c]
- local ns = e.ns
- local tg = e.tg
+ local e = collected[c]
+ local ns, tg = e.ns, e.tg
n = n + 1
if nonamespace then
t[n] = tg
@@ -228,7 +226,7 @@ function xml.delete(root,pattern)
if trace_manipulations then
report('deleting',pattern,c,e)
end
- local d = p.dt
+ local d = p.dt
local ni = e.ni
if ni <= #d then
if false then
@@ -315,10 +313,8 @@ local function inject_element(root,pattern,whatever,prepend)
local element = root and xmltoelement(whatever,root)
local collected = element and xmlapplylpath(root,pattern)
local function inject_e(e)
- local r = e.__p__
- local d = r.dt
- local k = e.ni
- local rri = r.ri
+ local r = e.__p__
+ local d, k, rri = r.dt, e.ni, r.ri
local edt = (rri and d[rri].dt) or (d and d[k] and d[k].dt)
if edt then
local be, af
@@ -358,8 +354,7 @@ local function insert_element(root,pattern,whatever,before) -- todo: element als
local collected = element and xmlapplylpath(root,pattern)
local function insert_e(e)
local r = e.__p__
- local d = r.dt
- local k = e.ni
+ local d, k = r.dt, e.ni
if not before then
k = k + 1
end
@@ -865,10 +860,8 @@ function xml.separate(x,pattern)
report_xml("warning: xml.separate changes root")
x = d
end
- local t = { "\n" }
- local n = 1
- local i = 1
- local nd = #d
+ local t, n = { "\n" }, 1
+ local i, nd = 1, #d
while i <= nd do
while i <= nd do
local di = d[i]