<commit_before>require("lxp.lom")
SILE.inputs.XML = {
  process = function (fn)
    local fh = io.open(fn)
    local t = lxp.lom.parse(fh:read("*all"))
    local root = SILE.documentState.documentClass == nil
    if root then
      if not(t.tag == "sile") then
        SU.error("This isn't a SILE document!")
      end
      SILE.inputs.common.init(fn, t)
    end
    SILE.process(t)
    if root then
      SILE.documentState.documentClass:finish()
    end
  end,
}<commit_msg>Don’t steal outer tags if they’re significant.<commit_after>require("lxp.lom")
SILE.inputs.XML = {
  process = function (fn)
    local fh = io.open(fn)
    local t = lxp.lom.parse(fh:read("*all"))
    local root = SILE.documentState.documentClass == nil
    if root then
      if not(t.tag == "sile") then
        SU.error("This isn't a SILE document!")
      end
      SILE.inputs.common.init(fn, t)
    end
    if SILE.Commands[t.tag] then
      SILE.Commands[t.tag](t.attr,t)
    end
    SILE.process(t)
    if root then
      SILE.documentState.documentClass:finish()
    end
  end,
}
{'fraction_non_alphanumeric': 0.13615023474178403, 'fraction_numerical': 0.0, 'mean_word_length': 2.6506849315068495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4290108', 'n_tokens_mistral': 390, 'n_tokens_neox': 386, 'n_words': 87}