![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Adding an entity reference [Thread Next] Re: Adding an entity referenceTo: NULL Date: 9/7/2007 12:37:00 AM PB wrote: > Hi, > > I was wondering how one would go about adding their own entity > reference? We have certain characters that use the Dingbats font that > we would like authors to be able to use with a quick shortcut. For > example, there is a black circle with white numbers in the middle. So > something like: &black3; would be great. Does anyone know how to do > this? If I understand you right, you want to add an Entity Declaration to your DTD first, so that you can use an Entity Reference in your document. If you're not using a DTD, you can add one without having to declare element types: <!DOCTYPE name-of-your-root-element [ <!ENTITY black3 "stuff"> ]> where "stuff" is whatever characters or codes are required to make your output display or print driver render the right glyph, including whatever is needed to switch font. If you're already using a DTD, you can either add the Entity Declaration in the internal subset as above, or edit the DTD file and put it in there. If your processor validates with a DTD, then &black3; will be converted to its value at parse time, *before* the stream hits whatever engine and language you use for transformation (eg XSLT). If your processor does not perform validation, or you're using a W3C Schema, then all bets are off, because entities aren't supported in those cases. You would then need to do some deeper surgery and declare an Empty element type, eg <black3/>, together with whatever modifications are needed to content models in mixed content to enable it to be valid in the places you need it; and then define a rule in your processor to convert this to whatever is needed to output it. Without knowing what language and processor and editor you're using, there's not much more we can help you with. ///Peter -- XML FAQ: http://xml.silmaril.ie/ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
