diff options
author | Marius <mariausol@gmail.com> | 2012-05-29 20:00:14 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-05-29 20:00:14 +0300 |
commit | 250c6bdd3d89cde9d2401172ea0310536eb58db8 (patch) | |
tree | 300039199138996ceb060b458fe45288ae0b6b17 /tex/context/base/lxml-tab.lua | |
parent | 100f67d68d6026d0d6ff2cfd79f03b3f32c0c0f3 (diff) | |
download | context-250c6bdd3d89cde9d2401172ea0310536eb58db8.tar.gz |
beta 2012.05.29 18:43
Diffstat (limited to 'tex/context/base/lxml-tab.lua')
-rw-r--r-- | tex/context/base/lxml-tab.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tex/context/base/lxml-tab.lua b/tex/context/base/lxml-tab.lua index fddd55a09..b5c860787 100644 --- a/tex/context/base/lxml-tab.lua +++ b/tex/context/base/lxml-tab.lua @@ -1338,3 +1338,31 @@ function xml.makestandalone(root) end return root end + +function xml.kind(e) + local dt = e and e.dt + if dt then + local n = #dt + if n == 1 then + local d = dt[1] + if d.special then + local tg = d.tg + if tg == "@cd@" then + return "cdata" + elseif tg == "@cm" then + return "comment" + elseif tg == "@pi@" then + return "instruction" + elseif tg == "@dt@" then + return "declaration" + end + elseif type(d) == "string" then + return "text" + end + return "element" + elseif n > 0 then + return "mixed" + end + end + return "empty" +end |