Quick answer: an XMLTV guide file can fail before an app ever evaluates channel IDs, time zones, or programme coverage. First test whether the XML is well-formed: tags must be properly nested, attributes quoted, special characters escaped, and the document must have one coherent root. Then separately check whether the document follows the XMLTV structure expected by the receiving application. Preserve the original, validate locally with external entity access disabled, and do not upload private guide data or account details to a public service.
Separate XML syntax from guide-data problems
“The EPG did not load” describes an outcome, not a diagnosis. Several layers can produce the same screen: the file may be truncated, the XML syntax may be broken, the document may be structurally unexpected, programme records may be absent, channel identifiers may not match, timestamps may be interpreted differently, or the app may not have refreshed. A useful first test isolates the earliest layer: can a local XML parser read the document without a syntax error?
XML 1.0 defines well-formedness rules for document structure. An XML document is not well-formed if, for example, start and end tags do not match, elements overlap, an attribute is not quoted correctly, or reserved characters appear where markup syntax would be ambiguous. Well-formedness is not the same as application-level validity. A document can be valid XML yet still lack the elements, attributes, identifiers, or date ranges that an XMLTV consumer needs.
That distinction prevents unhelpful repairs. If the parser reports a mismatched tag, changing a channel ID cannot fix the parse. If parsing succeeds but the guide is blank, rewriting angle brackets is unlikely to help; inspect document content, date range, channel IDs, app mapping, and refresh behavior instead. Record the exact failure stage and line/column message where available.
For normative syntax, consult the W3C XML 1.0 Recommendation. For XMLTV-specific element and attribute conventions, compare the format version you use with the XMLTV project’s DTD. A DTD describes structural expectations; a parser’s acceptance of XML syntax alone does not guarantee that your target app supports every XMLTV extension.
Common causes of XMLTV parse errors
Many parse failures are small text-file problems, often introduced by an export, manual edit, copy-and-paste operation, or incomplete download. One unescaped ampersand in a programme title can make a document fail even when every tag appears balanced. A copied quotation mark can terminate an attribute early. A truncated download can leave an open element at the end of the file. Error messages usually identify a line and column, but that location can be after the original mistake because a parser may only notice the inconsistency when it reaches a later closing tag.
- Mismatched tags: a start tag such as
<programme>closes with a different name, or case differs. XML names are case-sensitive. - Unescaped reserved characters: literal ampersands and angle brackets in text or attributes must be represented as character references where XML syntax requires it. Do not globally replace every ampersand; valid entity references must be preserved.
- Broken attribute quoting: an apostrophe or quote in a value collides with the attribute delimiter, or the closing quote is missing.
- Truncation: the file ends mid-tag, mid-attribute, or before the root element closes. Compare file size and final lines with a fresh authorized export.
- Encoding mismatch: the byte sequence does not match the declared encoding, or a conversion introduced invalid characters. Preserve the original and verify encoding before converting.
- Multiple roots or stray content: accidental text appears before or after the root element, or a second root was appended during file concatenation.
- Unsafe or unavailable external declarations: a document may reference a DTD. A validation tool that tries to fetch remote declarations can fail because of connectivity or policy; do not enable arbitrary external entity access for an untrusted file just to make an error disappear.
The XMLTV project publishes a DTD, but installations and feeds can vary. Treat a validation result as evidence about a particular file against a particular parser and DTD version, not as a universal guarantee for every television application.
Make a private copy and validate locally
Before testing, save an unchanged copy of the guide file in a private local folder. If you use an XML validator, choose a mode that does not fetch arbitrary external entities or DTDs over the network. Disable network resolution when the tool supports it. This reduces exposure to remote file retrieval and prevents a diagnostic from leaking a path or fetching an unexpected resource. Do not paste guide data into public paste sites or online validators unless you have confirmed the data is non-sensitive and the tool’s processing model.
- Confirm the file is actually XML. Open it as text and inspect the beginning. A browser error page, access-denied message, JSON response, or login form saved with an
.xmlextension is not XMLTV data. - Check the declaration and encoding. Compare the declared encoding with the actual file bytes. If uncertain, use a local editor that reports encoding; do not repeatedly resave the only copy.
- Run a well-formedness parser. Use a trusted local tool in non-network mode. Record the exact line and column, then inspect a small surrounding region locally.
- Check the root and nesting. XMLTV exports commonly contain a root element with channel and programme records. Verify that every element closes and nesting is consistent, using the expected producer format as reference.
- Only then check application-level expectations. Review whether records contain the identifiers, start/stop times, and data fields required by the app. This is a separate check from syntax.
A browser-based inspector can be convenient, but privacy and scope matter. The XMLTV / EPG file inspector is relevant for examining guide structure, and the tools directory lists other local browser utilities. Confirm that the selected check runs in your browser and does not transmit file content before using it. Never submit credentials or a private provider URL, and avoid testing a full personal guide file if a small sanitized sample will identify the syntax issue.
Read parser messages without overcorrecting
A message such as “mismatched tag” usually means the parser found a closing tag that did not match the most recently opened element. “EntityRef: expecting” often points to an ampersand that begins no valid entity reference. “Premature end of data” commonly indicates truncation or an unclosed element. “Extra content at the end of the document” can indicate a second root or stray bytes after the root closes. Exact wording differs by parser.
Use the line and column as a starting point, not absolute proof that the visible character at that position caused the problem. Some parsers count bytes, others characters; multi-byte characters can make positions look offset. A malformed entity or quote earlier in the line can cause the parser to misinterpret everything after it. Begin at the reported position and move backward through the current attribute and text node.
Make one edit to a duplicate, run the parser again, and keep the error output. If the reported location moves farther down the file, the first repair may have removed one syntax issue while revealing a second. Do not use a broad search-and-replace to strip characters from every title. That can corrupt valid Unicode, remove legitimate metadata, or alter identifiers that are needed later for guide matching.
When a feed is generated automatically, hand-editing the downloaded output may only hide the issue until the next refresh. Preserve a small sanitized example and report the parser message to the feed maintainer. A useful report gives the software/tool version, line and column, whether the file is complete, and a redacted fragment around the error. Remove programme titles or personal details if they are sensitive.
After syntax passes, inspect XMLTV structure
Once a parser accepts the document as well-formed, move to structural checks. Review whether the expected root is present and whether channel declarations and programme records use the format expected by your importer. Channel IDs are identifiers, not necessarily display names. A guide entry can be syntactically correct while failing to match a playlist channel because the app compares a different identifier field or uses its own mapping rules.
Check a small sample: one channel definition, one programme referencing it, and the corresponding value configured in the player. Avoid editing every record before confirming how the app maps IDs. The existing guide for XMLTV and M3U channel-ID mismatches covers that later-stage issue. It should be used after parsing succeeds, not as a substitute for fixing a malformed document.
Then check date coverage. A file may be valid but contain schedules for a different date range or timezone than the screen you are viewing. XMLTV time values can include offsets; confirm how the producer expresses them and whether the receiving player interprets them as expected. Do not change timezone settings to “fix” a parser error. That is a different layer and can shift otherwise correct programme times.
Finally, distinguish missing guide records from a refresh or cache issue. If the file parses and contains records for the target channel and time, but the application remains empty, test one refresh using the app’s documented control and record the result. Avoid repeated full imports or clearing app storage until you know whether the file, mapping, time range, or cache is responsible.
Safe repair workflow for a malformed file
A careful repair is small, reversible, and evidence-led. Start by retaining the original and recording its size, timestamp, source, and parser error. Work on a copy. Fix the smallest confirmed syntax defect, then rerun the local parser. If the file is provider-generated, request a corrected export instead of silently maintaining a local patch that will be overwritten.
- Copy the original to a new filename and make it read-only if your workflow permits.
- Run a local well-formedness test with external network/entity resolution disabled.
- Inspect only the lines surrounding the error. Verify opening/closing tag names, quote pairing, and reserved character escaping.
- Change one issue and rerun the same test. Keep a note of the exact correction.
- After syntax passes, compare the structure to the expected XMLTV format and the target app’s documentation.
- Import a small test only if the application supports it; otherwise use a redacted copy and avoid exposing private guide data.
- Confirm one expected channel and one programme entry before evaluating the rest of the guide.
- Restore from the untouched original if the change makes the result worse.
Do not disable XML parser security protections, enable external entity expansion, or run a shell command that follows arbitrary network references embedded in the document. A diagnostic should not turn a text-format issue into a network or file-access risk. If you are not sure whether the validator is local, do not upload the file.
What to send to support—and what not to send
Support can usually start with the device model, player name and version, guide source type (local file or configured URL), error text, date/time of the test, and whether a local parser accepts the file. Include a redacted line/column and a short sanitized fragment only if needed. Replace all actual URLs, channel names, account identifiers, programme titles, and tokens with neutral placeholders.
Never send a password, session token, full private XMLTV URL, account export, or complete personal guide file in a public forum. A full guide may reveal viewing interests and can contain unique identifiers or service endpoints. If a private support handoff is necessary, use the site’s WhatsApp button or the official Telegram support group, and still redact credentials and private URLs.
For service and setup context, review the IPTV service information and the appropriate device guide. Support should not need a password to understand an XML parse error. The best first report states: “local parser accepts/rejects the file,” the exact sanitized error, and whether the problem occurs before or after channel mapping.
Checklist and frequently asked questions
Keep the original; identify the actual response; validate locally with network/entity access disabled; fix one confirmed syntax problem at a time; verify XMLTV structure only after parsing succeeds; then investigate IDs, dates, timezone, refresh, and app behavior as separate layers. This order produces a clearer diagnosis and minimizes unnecessary account or device changes.
Does well-formed XML guarantee the EPG will appear?
No. It only means the parser can read the XML syntax. The file may still have the wrong structure, no relevant programme records, mismatched channel IDs, an unsuitable date range, or an app refresh issue.
Is XMLTV the same as any XML file?
No. XML is a markup syntax; XMLTV is a convention for describing television channel and programme listings using XML structures. A generic XML document can be well-formed and still not be usable as XMLTV.
Should I download a DTD automatically when validation fails?
Not automatically. Confirm the expected DTD version and use a trusted validator with external resource access controlled. Do not enable arbitrary entity resolution for an untrusted file just to suppress an error.
What does “entity reference” usually mean?
It can indicate an ampersand in text or an attribute that is not represented in a way XML accepts, or an incomplete entity reference. Inspect the reported location and preserve legitimate references rather than replacing every ampersand.
Why does the parser line number seem wrong?
Parser locations can point where inconsistency became detectable rather than where it began. Byte-versus-character counting and earlier broken quotes or entities can also shift the apparent position.
Can I paste an XMLTV URL into an online validator?
Only after checking privacy, authorization, and whether the tool fetches or stores the URL. A URL may contain credentials or tokens. Prefer a local parser and never publish a private guide endpoint.
Conclusion: validate in layers
When XMLTV does not import, test the XML syntax before troubleshooting channel IDs, programme coverage, timezone, refresh, or app cache. Keep those layers separate, make reversible changes on a copy, and prefer local validation with external entity access disabled. A file can be well-formed without being a useful XMLTV guide, and a well-structured guide can still need app-specific mapping.
Use the XMLTV / EPG inspector for its documented checks, then follow the tools directory and the relevant channel-ID guide if parsing already succeeds. Share only redacted diagnostics with support.
References
- W3C: Extensible Markup Language (XML) 1.0
- XMLTV project DTD source
- Python documentation: ElementTree XML processing
Need help with an import? Send the device/player details and a sanitized parser message through WhatsApp support or the official Telegram group. Never send credentials, private guide URLs, or unredacted files.

