Jump to content

"Error reading end tag." error when loading XML file


@Krush

Recommended Posts

Hi there!

When I load my XML file (with xmlLoadFile) I get an error saying that my file is invalid (Line 4: Error reading end tag.). The file was generated with the built-in MTA XML functions. Am I missing something or is this a bug?

File content:

<database>
    <txd></txd>
    <dff>
        <551>merit</551>
    </dff>
    <col></col>
</database>

 

Edited by @Krush
Link to comment
  • Moderators
9 hours ago, @Krush said:

<551>merit</551>

Tag can't start with a number.

Rule nr.4: http://www.adobepress.com/articles/article.asp?p=1179145&amp;seqNum=4

 

(There are all 9 rules on that page)

 

Also a XML validator will tell you where an error might be located:

https://www.xmlvalidation.com/index.php

 

Last note:

Try not to use custom tags based on your data. Pre-sets of tags like col, txd and database are fine.

The methods you should use for custom data are: <tag>value</tag> and attributes="..."

 

Edited by IIYAMA
  • Thanks 2
Link to comment
7 hours ago, IIYAMA said:

Tag can't start with a number.

Rule nr.4: http://www.adobepress.com/articles/article.asp?p=1179145&amp;seqNum=4

 

(There are all 9 rules on that page)

 

Also a XML validator will tell you where an error might be located:

https://www.xmlvalidation.com/index.php

 

Last note:

Try not to use custom tags based on your data. Pre-sets of tags like col, txd and database are fine.

The methods you should use for custom data are: <tag>value</tag> and attributes="..."

 

It works now, thanks!

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...