diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-06-26 12:08:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-06-26 12:08:00 +0200 |
commit | 4228bf946beb4eabb1f156d889d54245651d4dff (patch) | |
tree | af65b7d81574d85b9e7013f463d8351464dcc01f /tex/context/base/lxml-aux.lua | |
parent | 1b5137f5fffe265b044838d6ee87d27070902180 (diff) | |
download | context-4228bf946beb4eabb1f156d889d54245651d4dff.tar.gz |
beta 2014.06.26 12:08
Diffstat (limited to 'tex/context/base/lxml-aux.lua')
-rw-r--r-- | tex/context/base/lxml-aux.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tex/context/base/lxml-aux.lua b/tex/context/base/lxml-aux.lua index 70364b657..b3f1684e7 100644 --- a/tex/context/base/lxml-aux.lua +++ b/tex/context/base/lxml-aux.lua @@ -421,6 +421,38 @@ end xml.include = include +function xml.inclusion(e,default) + while e do + local f = e.__f__ + if f then + return f + else + e = e.__p__ + end + end + return default +end + +function xml.inclusions(e,sorted) + while e do + local settings = e.settings + if settings then + local inclusions = settings.inclusions + if inclusions then + inclusions = table.unique(inclusions) -- a copy + if sorted then + table.sort(inclusions) -- so we sort the copy + end + return inclusions -- and return the copy + else + e = e.__p__ + end + else + e = e.__p__ + end + end +end + local function stripelement(e,nolines,anywhere) local edt = e.dt if edt then |