获得Notepad ++ XML解析错误“文档末尾的额外内容".即使没有 [英] Getting the Notepad++ XML parsing error "Extra content at the end of the document" even though there is none

查看:126
本文介绍了获得Notepad ++ XML解析错误“文档末尾的额外内容".即使没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试在Notepad ++中验证我的55 mb XML文件时,出现上述错误消息. 第一个遇到的错误在这里(22258651中的第1441520行): 来自记事本++的屏幕截图

I am getting the abovementioned error message when trying to validate my 55 mb XML file in Notepad++. The first enocountered error is here (line 1441520 out of 22258651): Screenshot from Notepad++

我已打开显示所有字符".没有任何建议表明该行的末尾应该有任何非法字符.正如您在屏幕截图上看到的那样,除了CR + LF之外没有其他隐藏字符.

I have turned on Show all characters. Nothing suggests that there should be any illegal characters at the end of the line. As you can see on the screenshot there are no other hidden characters than CR+LF.

下面是在Notepad ++中导致解析错误的记录副本:

Below is a copy of the record that causes the parsing error in Notepad++:

    <?xml version="1.0" encoding="UTF-8"?>
<Registreringer>
  <Registrering>
    <ID>1697947</ID>
    <LHAnr>316-01</LHAnr>
    <RegId>316-01K1037</RegId>
    <RegType />
    <Signatur>K</Signatur>
    <Regnr>1037</Regnr>
    <srnr />
    <ArkivSkaber />
    <Journalnr />
    <Sted>460872</Sted>
    <sted1>315</sted1>
    <sted2>12</sted2>
    <sted3>0</sted3>
    <UTM />
    <Betegnelse>
Hidden.

Hidden.
</Betegnelse>
    <kat1 />
    <kat2 />
    <kat3 />
    <kat4 />
    <Datering>1804</Datering>
    <DateringNote />
    <Klausul>Almindelige regler</Klausul>
    <Bem />
    <BemEx1 />
    <BemEx2 />
    <IntBem />
    <KortResume>
Hidden

Opmaalt 1804 af Hidden.
</KortResume>
    <SogeOrd />
    <RegDato>25-04-2000 00:00:00</RegDato>
    <RegAf>Hidden</RegAf>
    <GodkDato />
    <Godkendt />
    <Varighed />
    <Fra>1804</Fra>
    <Til>1804</Til>
    <YderAar />
    <Signaturer />
    <IaltBind />
    <IaltPakker />
    <IaltLaeg />
    <Stiftet />
    <Nedlagt />
    <hyldemeter>0,00</hyldemeter>
    <hyldecentimeter />
    <placering />
    <Art>Markkort</Art>
    <Maal>26 x 38</Maal>
    <TeknOpl>
Affoto



</TeknOpl>
    <Fotograf />
    <Materiale />
    <materiale2 />
    <Negativ />
    <FotografNegativ />
    <foto1 />
    <foto2 />
    <Referencenr />
    <Ref>



</Ref>
    <Motiv />
    <Udgaver />
    <Obs />
    <billede />
    <Samlingstype>14</Samlingstype>
    <SkabelonId />
    <Publicering />
    <Materialetype />
    <PkBind>0</PkBind>
    <PkPakker>0</PkPakker>
    <PkLaeg>0</PkLaeg>
    <Henvisning>
      <Id>3592636</Id>
      <LhaNr>316-01</LhaNr>
      <RegId />
      <RegRef>1697947</RegRef>
      <SektionId />
      <Henvisning>Hidden</Henvisning>
      <StedId>460872</StedId>
      <Fra>1804</Fra>
      <Til>1804</Til>
      <DecimalId>1006268</DecimalId>
      <EmneordId>1449984</EmneordId>
      <EmneordLokal>
        <id>1449984</id>
        <LHAnr>316-01</LHAnr>
        <DecimalId>1006268</DecimalId>
        <Decimalklasse>40.164</Decimalklasse>
        <Emneord>Udskiftningskort</Emneord>
        <EmneStikord />
      </EmneordLokal>
      <StedLokal>
        <Id>460872</Id>
        <LhaNr>316-01</LhaNr>
        <StedKode>315-12-00</StedKode>
        <StedTxt>Hidden</StedTxt>
        <Sted1>315</Sted1>
        <Sted2>12</Sted2>
        <Sted3>0</Sted3>
        <GenStedkode />
      </StedLokal>
      <DecimalLokal>
        <ID>1006268</ID>
        <LHAnr>316-01</LHAnr>
        <Decimal>40.164</Decimal>
        <DecimalTxt>Kort</DecimalTxt>
        <CommonDecimal>40.164</CommonDecimal>
        <DecimalLokalStikord>
          <ID>6969206</ID>
          <LHAnr>316-01</LHAnr>
          <Decimal>40.164</Decimal>
          <Stikord>Kort</Stikord>
        </DecimalLokalStikord>
        <DecimalLokalStikord>
          <ID>6969207</ID>
          <LHAnr>316-01</LHAnr>
          <Decimal>40.164</Decimal>
          <Stikord>Matrikelkort</Stikord>
        </DecimalLokalStikord>
      </DecimalLokal>
    </Henvisning>
  </Registrering>
</Registreringer>

使用W3C的验证器时,我没有收到任何错误,因此我怀疑这是长XML文件的Notepad ++特定问题.在Notepad ++中运行EOL/空白删除脚本也会损坏该文件.我可能需要使用基于CLI的替代方案...您建议什么? @ jim-garrison @villapx

When using W3C's validator, I don't get any errors, so I suspect this is a Notepad++ specific issue with long XML files. Running EOL/blank removal scripts in Notepad++ also corrupts the file. I probably need to use a CLI based alternative... What do you recommend? @jim-garrison @villapx

推荐答案

当您的HTML标记存在语法问题时(例如,未正确使用</tag>关闭标记或在标记中留有空格),通常会发生该错误.标签名称.

That error often occurs when there is a syntactic issue with your HTML tags, such as not properly closing a tag with a </tag> or having a space in a tag name.

尝试将XML文件的内容粘贴到其他XML验证器中,例如 w3的,看看是否遇到相同的错误,或者(希望是)描述性更强的错误.

Try pasting the contents of your XML file into a different XML validator, such as w3's, and see if you get the same error, or (hopefully) a more descriptive one.

要获得更好的答案,请提供一个最小,完整和可验证的示例,以便我们重现您的问题.

To get a better answer, please provide a Minimal, Complete and Verifiable example so we can reproduce your problem.

这篇关于获得Notepad ++ XML解析错误“文档末尾的额外内容".即使没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆