XML Error: Undeclared Entity Error

XML Error: Undeclared Entity Error thumbnail
The XML markup language helps transport and store data.

Markup languages like XML help structure and format data on a Web page. A markup language provides a way to point out the coding to a browser, separating it from the text meant to appear on the page. XML is one of the less complex markup languages available, but it does have stern syntax rules. When you break one, you get an error message such as undeclared entity.

  1. Extensible Markup Language

    • Extensible Markup Language, or XML, is a container that transports data to a Web page. By using XML, you separate the data from the formatting information on the page. This means you can debug the formatting without dealing with the data. The split cuts down on the number of lines in your code per page. As an added advantage, XML syntax is easy to read. It looks less like computer code than languages such as HTML or JavaScript do.

    XML Syntax

    • XML has some strict syntax rules. Well-formed or valid code are terms programmers use to indicate the source meets all the requirements of the language. Code that is not well-formed may still parse without an error, but if you get one, this indicates a problem with the data. Parsing is the way a computer browser compiles the code and interprets the instructions. An "Undeclared Entity" code is a flag that your code is not valid or well-formed.

    Undeclared Entity

    • Undeclared entity error can mean a number of things. Put simply, there is something in the code that the browser could not parse. It may be a tag in the wrong spot or a character outside of a tag. There is no easy way to finding the problem in the code. Look for the simplest answer first. Make sure you have both open and closing tags for all your elements. Examine the lines for stray characters. In XML, every character must be inside of an element.

    XML Languages

    • The syntax gets more complex when you use the formatting languages for XML. These are the documents that provide formatting information for the browser. It can be a XSL, DTD or XSLT page. Once you check the easier problems, look at the formatting for misused characters. As with XML, the formatting languages have strict syntax rules. Once you examine everything, if you are unable to find the error, run the code through a validator. This may help you debug the page. A free validator is available online at WC3, the organization responsible for the creation of XML.

Related Searches


  • Photo Credit Jason Reed/Photodisc/Getty Images

Related Ads