diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-04-03 22:35:21 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-04-03 22:35:21 +0200 |
commit | 1e5d7f41ddede5e6400a2a7762032823d3545df4 (patch) | |
tree | bf53397fbdd2b85c94db72321e7d0e466d02acd5 /tex/context/base/mkiv/lxml-tex.lua | |
parent | 0175a693fcb853ecce7d49f6564895c2dbfd11f1 (diff) | |
download | context-1e5d7f41ddede5e6400a2a7762032823d3545df4.tar.gz |
2018-04-03 22:30:00
Diffstat (limited to 'tex/context/base/mkiv/lxml-tex.lua')
-rw-r--r-- | tex/context/base/mkiv/lxml-tex.lua | 35 |
1 files changed, 33 insertions, 2 deletions
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 |