Skip to main content

Error: The value of attribute "filter" must not contain the '<' character

In XML, characters with special meaning are written as entities; in URLs, as percent-encoding

Written by Petr Pech

The import fails with a parser error:

The value of attribute "filter" associated with an element type "faktura-vydana" must not contain the '<' character.

This error doesn't come from ABRA Flexi, but from the XML parser itself — the character < must not appear directly in an attribute value, because in XML it would start a new element.


In XML: entities

In both attributes and element text, characters with special meaning are written as entities:

Character

XML notation

<

&lt;

>

&gt;

&

&amp;

"

&quot;

The filter in the import XML then looks like this:

<winstrom version="1.0">
<faktura-vydana filter="id &lt; 100">
<popis>hromadná změna</popis>
</faktura-vydana>
</winstrom>


In URLs: percent-encoding

In URLs, entities are not used at all — instead, percent-encoding is used, i.e. %3C instead of < and %20 instead of a space. These are two different mechanisms and should not be confused:

URL:  /c/{firma}/faktura-vydana/(datSplat%3Enow()).xml
XML: <faktura-vydana filter="datSplat &gt; now()">

💡 You don't need to do the encoding manually — XML libraries add entities automatically, and most languages have a built-in function for URL encoding. Manually building strings is the most common source of these errors.


Related

Did this answer your question?