summaryrefslogtreecommitdiff
path: root/tex/context/base/lxml-lpt.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-01-16 18:33:00 +0100
committerHans Hagen <pragma@wxs.nl>2012-01-16 18:33:00 +0100
commit2c97049c16bd99dc7226b879c171246e34ec219c (patch)
treeb0608851e05083bd413fa35f8c65e8536dafd013 /tex/context/base/lxml-lpt.lua
parent5b13bdfca0e081ef26d49ba405b7fb62d7724c24 (diff)
downloadcontext-2c97049c16bd99dc7226b879c171246e34ec219c.tar.gz
beta 2012.01.16 18:33
Diffstat (limited to 'tex/context/base/lxml-lpt.lua')
-rw-r--r--tex/context/base/lxml-lpt.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/tex/context/base/lxml-lpt.lua b/tex/context/base/lxml-lpt.lua
index 11922cf18..607101ae9 100644
--- a/tex/context/base/lxml-lpt.lua
+++ b/tex/context/base/lxml-lpt.lua
@@ -1105,9 +1105,9 @@ end
expressions.child = function(e,pattern)
return applylpath(e,pattern) -- todo: cache
end
-expressions.count = function(e,pattern)
+expressions.count = function(e,pattern) -- what if pattern == empty or nil
local collected = applylpath(e,pattern) -- todo: cache
- return (collected and #collected) or 0
+ return pattern and (collected and #collected) or 0
end
-- external
@@ -1116,7 +1116,7 @@ expressions.oneof = function(s,...) -- slow
local t = {...} for i=1,#t do if s == t[i] then return true end end return false
end
expressions.error = function(str)
- xml.errorhandler("unknown function in lpath expression",tostring(str or "?"))
+ xml.errorhandler(format("unknown function in lpath expression: %s",tostring(str or "?")))
return false
end
expressions.undefined = function(s)