summaryrefslogtreecommitdiff
path: root/tex/context/base/lxml-ctx.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-06-11 18:00:15 +0300
committerMarius <mariausol@gmail.com>2011-06-11 18:00:15 +0300
commit510cb140d2e8baed13b8b27daa02f3ad2f5df3e1 (patch)
tree180c914c5c27bcd130cd13098b426b03abd1a508 /tex/context/base/lxml-ctx.lua
parent247a7c0fccc1f980a837daf19e0ef2be6102a18f (diff)
downloadcontext-510cb140d2e8baed13b8b27daa02f3ad2f5df3e1.tar.gz
beta 2011.06.11 16:45
Diffstat (limited to 'tex/context/base/lxml-ctx.lua')
-rw-r--r--tex/context/base/lxml-ctx.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/tex/context/base/lxml-ctx.lua b/tex/context/base/lxml-ctx.lua
index 1f6f6ffd3..3319dc638 100644
--- a/tex/context/base/lxml-ctx.lua
+++ b/tex/context/base/lxml-ctx.lua
@@ -8,6 +8,8 @@ if not modules then modules = { } end modules ['lxml-ctx'] = {
-- is this still used?
+local format, find = string.format, string.find
+
local xml = xml
xml.ctx = { }
@@ -21,7 +23,7 @@ function xml.ctx.enhancers.compound(root,lpath,before,tokens,after) -- todo lpeg
local after = after or "[%a%d][%a%d][%a%d]"
local pattern = "(" .. before .. ")(" .. tokens .. ")(" .. after .. ")"
local action = function(a,b,c)
- return a .. "<compound token=" .. string.format("%q",b) .. "/>" .. c
+ return a .. "<compound token=" .. format("%q",b) .. "/>" .. c
end
xml.enhance(root,lpath,pattern,action) -- still present?
end
@@ -38,7 +40,7 @@ function xml.ctx.tshow(specification)
local attribute = specification.attribute
if context then
local xmlpattern = pattern
- if not string.find(xmlpattern,"^[%a]+://") then
+ if not find(xmlpattern,"^[%a]+://") then
xmlpattern = "xml://" .. pattern
end
local parsed = xml.lpath(xmlpattern)