Changeset 4277:8c044af11650 in livinglogic.python.xist for src/ll/xist/scripts/dtd2xsc.py

Show
Ignore:
Timestamp:
12/15/10 18:06:39 (9 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Ignore undefined entities.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/scripts/dtd2xsc.py

    r4276 r4277  
    152152    for entname in ents: 
    153153        if entname not in ("quot", "apos", "gt", "lt", "amp"): 
    154             ent = parse.tree(dtd.resolve_ge(entname).value, parse.Encoder("utf-8"), parse.SGMLOP(encoding="utf-8"), parse.NS(), parse.Node()) 
    155             ns.content.append(xnd.CharRef(entname, codepoint=ord(unicode(ent[0])[0]))) 
     154            try: 
     155                ent = parse.tree(dtd.resolve_ge(entname).value, parse.Encoder("utf-8"), parse.SGMLOP(encoding="utf-8"), parse.NS(), parse.Node()) 
     156            except xsc.IllegalEntityError: 
     157                pass 
     158            else: 
     159                ns.content.append(xnd.CharRef(entname, codepoint=ord(unicode(ent[0])[0]))) 
    156160 
    157161    return ns