Andrew Eckerberg
Andrew Eckerberg

Reputation: 13

Error: XML document expecting opening tag after final closing tag

I'm getting an xml error, and I'm aware similar questions exist elsewhere, yet there's no answer for my situation. I've run xmllint telling me that a starting tag is expected...at the end of the document. All my tags are closed as far as I'm aware, so I'm not sure why it's expecting what it's expecting...

'''

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href=/Users/Andrew/Desktop/schoolwork/devicexsl.xsl>
<device>
    <phone>
        <make> Apple </make>
        <model> iPhone 12 </model>
        <OS> iOS </OS>
        <osVersion>14.4</osVersion>
        <color> Blue </color>
        <screensize> 6.1 </screensize>
        <price>€914 </price>
    </phone>
    <tablet>
        <make> Apple </make>
        <model> iPad Air </model>
        <OS> iOS </OS>
        <osVersion> 14.1 </osVersion>
        <color> Black </color>
        <screensize> 11 </screensize>
        <price> €700 </price>
    </tablet>
</device>

'''

Upvotes: 0

Views: 846

Answers (1)

Yitzhak Khabinsky
Yitzhak Khabinsky

Reputation: 22157

A single question mark was missing at the end of the 2nd line.

Here is your well-formed XML.

XML

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href=/Users/Andrew/Desktop/schoolwork/devicexsl.xsl?>
<device>
    <phone>
        <make>Apple</make>
        <model>iPhone 12</model>
        <OS>iOS</OS>
        <osVersion>14.4</osVersion>
        <color>Blue</color>
        <screensize>6.1</screensize>
        <price>€914</price>
    </phone>
    <tablet>
        <make>Apple</make>
        <model>iPad Air</model>
        <OS>iOS</OS>
        <osVersion>14.1</osVersion>
        <color>Black</color>
        <screensize>11</screensize>
        <price>€700</price>
    </tablet>
</device>

Upvotes: 1

Related Questions