diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-01-14 18:25:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-01-14 18:25:00 +0100 |
commit | 45d11a2f318b118a2592b9db7eb530a4cf613a00 (patch) | |
tree | 060a66d60c1e5e7c3326e5776476ee90e2cb1e43 /tex/context/base/lxml-tab.lua | |
parent | 3dbcef73aec79246dfc4238eb7af28d3fa54e1f3 (diff) | |
download | context-45d11a2f318b118a2592b9db7eb530a4cf613a00.tar.gz |
beta 2010.01.14 18:25
Diffstat (limited to 'tex/context/base/lxml-tab.lua')
-rw-r--r-- | tex/context/base/lxml-tab.lua | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tex/context/base/lxml-tab.lua b/tex/context/base/lxml-tab.lua index f4ab351e8..300b47126 100644 --- a/tex/context/base/lxml-tab.lua +++ b/tex/context/base/lxml-tab.lua @@ -541,12 +541,14 @@ local function xmlconvert(data, settings) else errorstr = "invalid xml file - parsed text" end - else + elseif type(data) == "string" then if lpegmatch(grammar_unparsed_text,data) then errorstr = "" else errorstr = "invalid xml file - unparsed text" end + else + errorstr = "invalid xml file - no text at all" end if errorstr and errorstr ~= "" then result = { dt = { { ns = "", tg = "error", dt = { errorstr }, at={}, er = true } } } @@ -583,6 +585,19 @@ end xml.convert = xmlconvert +function xml.inheritedconvert(data,xmldata) + local settings = xmldata.settings + settings.parent_root = xmldata -- to be tested + -- settings.no_root = true + local xc = xmlconvert(data,settings) + -- xc.settings = nil + -- xc.entities = nil + -- xc.special = nil + -- xc.ri = nil + -- print(xc.tg) + return xc +end + --[[ldx-- <p>Packaging data in an xml like table is done with the following function. Maybe it will go away (when not used).</p> |