I'm writing an XSL file that transforms XML to markdown text. I want to transform HTML entities to themselves, e.g. "®" in a piece of text in the XML will yield "®" in the output file. I do not want to translate "®" to its hexadecimal equivalent, which is liable to upset processes downstream.
It seems to me that the following declaration should do what I need, when placed immediately after the <?xml...?> tag:
<!DOCTYPE stylesheet [
<!ENTITY reg "&reg;" >
<!ENTITY trade "&trade;" >
]>
When I process an XML file, though, the XSL processor (Saxonica HE) issues a message like this one at each use of an entity:
Error on line 6 column 12 of test.xml:
SXXP0003: Error reported by XML parser: The entity "reg" was referenced, but not declared.
What have I done wrong?