Mã hóa

XML Entities Encode/Decode

Mã hóa và giải mã thực thể XML — 5 thực thể chuẩn (dấu và, dấu ngoặc nhọn, dấu nháy đơn, dấu ngoặc kép) và tham chiếu ký tự số.

Câu hỏi thường gặp

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.