Skip to main content

XML error · InvalidAttr

Attributes have open quote

An attribute value was opened with a quote that is never closed.

Attributes for 'image:image' have open quote.

What it means

The parser started reading a quoted attribute value and reached the end of the tag, the line, or the document without finding the matching quote. Everything after the opening quote is being swallowed as attribute text.

The most common real cause is a value that itself contains the same quote character — an unescaped apostrophe inside a single-quoted value, or a double quote inside a double-quoted one.

What usually causes it

  • A quote character inside the value: title='Tom's feed'.
  • A dropped closing quote, often after an edit or an interpolation.
  • Mismatched quote styles: href="https://example.com'.
  • A newline inside what was meant to be a short value, hiding the missing quote.

How to fix it

  • Escape the quote as ' or ", or switch to the other quote style.
  • Escape attribute values with a serializer rather than interpolating strings.
  • Look at the tag on the reported line for an odd number of quote characters.

The same error elsewhere

Different parsers, same defect. If you arrived with one of these messages, you are in the right place.

  • Xerces (Java)

    Open quote is expected for attribute "title" associated with an element type "image:image".
  • libxml2 (PHP, lxml, Nokogiri)

    AttValue: " or ' expected
  • expat (Python)

    not well-formed (invalid token)

Before and after

Both snippets are checked on every build: the first is confirmed to produce the error above, the second to parse cleanly.

Fails
<image:image title='Tom's photo'/>
Parses
<image:image title="Tom&apos;s photo"/>

Where this bites most

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.