Home Forums General XMetaL Discussion Parameter Entity Support Reply To: Parameter Entity Support

Derek Read

Reply to: Parameter Entity Support

Yes using parameter entities in an internal subset is supported (as well as using them in a DTD of course). However, the External Entities dialog does not create parameter entities, it creates “file entity references” (aka: “external entity” references). If you use this dialog you will end up with something like this in your internal subset:

If you must insert a parameter entity I think you would need to do so in Plain Text view or prior to opening the document (perhaps as part of a template or similar) or using script (which can be used to modify documents before open, or perhaps to create a template on the fly, etc). Alternatively, you could declare the entity in the DTD itself. I think we have always considered this to be a “developer oriented” step in any configuration process and so have chosen not to expose anything for this for “authors” in the product's UI.

Perhaps you could elaborate on what you would use such a feature for so we can consider whether it would make sense for us to expose something that would be generally useful to users of the software.

I am attaching three sample files that show that (once in the document) the product deals with parameter entities as expected.
1. foo.ent contains declarations for three text entities.
2. journalist_dtd_test.xml uses the sample journalist.dtd and references foo.ent as a parameter entity in its own internal subset.
3. journalist_xsd_test.xml uses the sample journalist.xsd and references foo.ent as a parameter entity in its own internal subset.

With either of those XML documents open if you open the Insert > Entity Reference dialog it will list the three text entities declared inside foo.ent and allow you to insert them. The behavior is essentially the same as if you had declared these entities in the DTD itself (which of course for Schema is not possible).

The usage of entities in an internal subset together with a DTD is clearly defined and XMetaL Author follows that model.

Although the W3C has not officially defined how parameter entities are to be used in conjunction with a W3C Schema instance XMetaL supports them in an internal subset, as is similar to usage with a DTD (as demonstrated in journalist_xsd_test.xml). I believe this is similar to how other XML parsers support entities with W3C Schema, if they support them at all. The W3C's “XML Schema Part 0: Primer” has an appendix called [url=http://www.w3.org/TR/xmlschema-0/#usingEntities]Using Entities[/url] which vaguely hints at declaration of entities (in general, not specifically parameter entities) in instance documents.

Further information on entities in genera, including details on the user interface, is described in these XMetaL Author help topics:
 Appendix A: XML Basics > DTDs and Schemas > Entities
 Authoring structured content > Working with entities (and subtopics)