1

I have an XSL stylesheet with entity definition in it:

<!DOCTYPE xsl:stylesheet SYSTEM "entities.dtd">

entities.dtd contains only one definition:

<!ENTITY copy "&#169;">

If I use &copy; in the document having the DOCTYPE declaration, everything works fine. But when I include another XSL document and try use the entity there, XSLT-processor says that 'copy' entity is not defined.

How can I define a global DTD to use it in any included XSL stylesheet?

Sean B. Durkin
  • 12,659
  • 1
  • 36
  • 65
Rodion Baskakov
  • 636
  • 4
  • 14
  • 1
    Re: [How can I define a global DTD to use it in any included XSL stylesheet?] You can't. Every xslt stylesheet is a separate XML document and any XML document that doesn't have a DTD defining used entities is malformed. – Dimitre Novatchev Jul 14 '12 at 19:28

1 Answers1

3

Each module in your stylesheet is a freestanding XML document, and is submitted to the XML parser independently of other modules. It must therefore be well-formed it its own right, which means that it must define in its DTD any entities that it uses.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164