Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Adding an entity reference

From: Peter Flynn <peter.nosp@-.--------.-->
To: 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/


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent