I tried but its not working, actually i want to add it in xslt not in xml !
and
Browser shows the error as undefined entity. i want to transform it using the xslt.
If your XML document contains entities like ©
, and the definition of these entities is not available from the source document, then you are out of luck, because this makes your XML document invalid.
The only named entities that can be used without declaration in a DTD (either inline or referenced) are <
, >
, &
, '
and "
. Any other entity must either be a numerical entity reference, like ©
, or must be defined in the DTD section.
The XSLT (whether used in browser or offline) is correct in rejecting your XML input document. If you want to prevent this, you will need to fix your invalid XML with another tool, one that processes the document not as XML (because it isn't) but as text. You can simply add the DTD definition with this preprocess, i.e. add lines like these in the DTD:
<!ENTITY copy "©">
or search for the named entities and replace them for their respective Unicode characters or the numeric entities (from an XML standpoint, there is no difference between the two, as long as the encoding is correct).
©
with©
, or defining the entities in the doctype? – Luke<!ENTITY copy "©">
. – Luke