The entity "nbsp" was referenced, but not declared

Viewed 15982

I have written one XSLT to transform xml to xml.

Input XML:

<test>The Spanish word for "Spain" is "Espa&nbsp;a" Dagon his Name, Sea Monster</test>

OutputXML:

<test>The Spanish word for "Spain" is "Espa a" Dagon his Name, Sea Monster</test>

XSL FILE: i have added the code for entity nbsp declaration under doctype at and replace with   entity but still are same error The entity "nbsp" was referenced, but not declared.

<xsl:template match="test">
<test>
  <xsl:apply-templates/>
</test>

3 Answers

A SOLUTION ... use CDATA as following:

<test><![CDATA[ your text with &acute; &ecute; &icute; &Acute; &ntilde; ]]></test>

<test><![CDATA[The Spanish word for "Spain" is "Espa&ntilde;a" Dagon his Name, Sea Monster]]></test>

I know is late to answer this, but also I know it could help someone else !

Reference to acutes & tildes: https://uniwebsidad.com/libros/xhtml/capitulo-3/codificacion-de-caracteres

A SOLUTION ... use CDATA as following:

<test><![CDATA[ your text with &acute; &ecute; &icute; &Acute; &ntilde; ]]></test>

<test><![CDATA[The Spanish word for "Spain" is "Espa&ntilde;a" Dagon his Name, Sea Monster]]></test>

I know is late to answer this, but also I know it could help someone else !

Reference to acutes & tildes: https://uniwebsidad.com/libros/xhtml/capitulo-3/codificacion-de-caracteres

Related