Why does "xmlwrite" escape "é" as "&#xE9"?
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 15 de Abr. de 2019
Editada: MathWorks Support Team
el 15 de Abr. de 2019
When writing an XML file containing numerical representation of special characters, the ampersand (&) is modified to "&".
For instance, the French accented character "é" can be represented by the numerical representation "é". However, "xmlwrite" modifies the ampersand to "&".<https://www.w3.org/TR/xml/#syntax>
Respuesta aceptada
MathWorks Support Team
el 16 de Abr. de 2019
Editada: MathWorks Support Team
el 15 de Abr. de 2019
Please note that, as far as having "&" characters in an XML file, this is technically not supported according to the XML Specification, and a standards-compliant XML encoder should always escape "&" characters. Please refer to the following snippet from the XML Specification (<https://www.w3.org/TR/xml/#syntax>):
"The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings " & " and " < " respectively."
If you want to code the representation of some special characters, you can use the Unicode representation for it and use the "native2unicode" function.
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!