I have written one XSLT to transform xml to xml.
Input XML:
<test>The Spanish word for "Spain" is "Espa 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>
You need to have the input declare the entities it uses, as done in http://xsltransform.net/gVhD8QR with e.g.
<!DOCTYPE test [
<!ENTITY nbsp " ">
]>
<test>The Spanish word for "Spain" is "Espa a" Dagon his Name, Sea Monster</test>
Note that the Spanish word for "Spain" is "España" however, so the example entity used there does not make sense there anyway.
You can escape the nbsp like this:
UPDATE
try this:
<xsl:text disable-output-escaping="yes">&</xsl:text>nbsp;
So you final code will look like:
<test>The Spanish word for "Spain" is "Espa<xsl:text disable-output-escaping="yes">&</xsl:text>nbsp;a" Dagon his Name, Sea Monster</test>
If all else fails use this which is sure to work:
 
Cheers