From 1e5d7f41ddede5e6400a2a7762032823d3545df4 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 3 Apr 2018 22:35:21 +0200 Subject: 2018-04-03 22:30:00 --- tex/context/base/mkiv/lxml-tex.lua | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'tex/context/base/mkiv/lxml-tex.lua') diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua index 43b8e16b1..b8280ba9c 100644 --- a/tex/context/base/mkiv/lxml-tex.lua +++ b/tex/context/base/mkiv/lxml-tex.lua @@ -469,7 +469,7 @@ lxml.addindex = addindex implement { name = "xmladdindex", - arguments = { "string" }, + arguments = "string", actions = addindex, } @@ -821,7 +821,7 @@ local k_parser = class * spaces * key * spaces * rest --value implement { name = "xmlinstalldirective", - arguments = { "string", "string" }, + arguments = "2 strings", actions = function(name,csname) if csname then local keyvalueparser = k_parser / context[csname] @@ -1990,6 +1990,37 @@ do contextsprint(notcatcodes,att) end + local ctx_doif = commands.doif + local ctx_doifnot = commands.doifnot + local ctx_doifelse = commands.doifelse + + implement { + name = "xmldoifatt", + arguments = "3 strings", + actions = function(id,l,v) + local e = getid(id) + ctx_doif(e and e.at[k] == v or false) + end + } + + implement { + name = "xmldoifnotatt", + arguments = "3 strings", + actions = function(id,l,v) + local e = getid(id) + ctx_doifnot(e and e.at[k] == v or false) + end + } + + implement { + name = "xmldoifelseatt", + arguments = "3 strings", + actions = function(id,l,v) + local e = getid(id) + ctx_doifelse(e and e.at[k] == v or false) + end + } + end do -- cgit v1.2.3