Codificação

XML Entities Encode/Decode

Codificação e decodificação de entidades XML — as 5 padrão (e comercial, colchetes angulares, apóstrofo, aspas) e referências numéricas de caracteres.

Perguntas frequentes

What are the 5 predefined XML entities?

XML only predefines five named entities: & (ampersand), < and > (angle brackets), ' (apostrophe), and " (quote). Anything beyond these needs a numeric character reference instead.

How is this different from HTML entity encoding?

HTML defines a much larger set of named entities (like   or ©), while strict XML only recognizes the five predefined ones — any other special character in XML must use a numeric reference like © or ©.

When do I need to escape XML entities?

Escape characters like < > & ' " whenever they appear in text content or attribute values in an XML document, so the parser doesn't mistake them for markup and fail to parse the file.