[Cialug] How many people are using Python ?

Zachary Kotlarek zach at kotlarek.com
Tue Dec 30 12:42:57 CST 2008


On Dec 30, 2008, at 11:43 AM, Colin Burnett wrote:

> 2) I'm writing a simple template engine that uses xml.dom.minidom and
> I discovered that it would eat entity references (e.g., "—") and
> put nothing in the DOM but it would take numerical entities (e.g.,
> "—") just fine.  I still don't have an answer on that one nor
> how to put in literal text (try putting in "—" as a text node
> and you get "—" on the output).

That's because XML doesn't define a character entity for mdash. While  
HTML defines 252 named character entities in XML you only get five  
predefined entities:
	quot
	amp
	apos
	lt
	gt

If you want to use any other character entity it must be explicitly  
declared in the DTD; generally I find it easier just to use the  
numeric character reference.

	Zach

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2746 bytes
Desc: not available
Url : http://cialug.org/pipermail/cialug/attachments/20081230/8e710217/smime.bin


More information about the Cialug mailing list