81 |
# Find out what Typecasts are being used |
# Find out what Typecasts are being used |
82 |
if xmlElements[element].has_key('Attributes'): |
if xmlElements[element].has_key('Attributes'): |
83 |
for att in xmlElements[element]['Attributes'].keys(): |
for att in xmlElements[element]['Attributes'].keys(): |
84 |
self.typecasts[xmlElements[element]['Attributes'][att]['Typecast']] \ |
i=xmlElements |
85 |
|
if i: |
86 |
|
i=i[element] |
87 |
|
if i: |
88 |
|
i=i['Attributes'] |
89 |
|
if i: |
90 |
|
i=i[att] |
91 |
|
if i: |
92 |
|
i=i['Typecast'] |
93 |
|
if i: |
94 |
|
self.typecasts[xmlElements[element]['Attributes'][att]['Typecast']] \ |
95 |
= 'CDATA' |
= 'CDATA' |
96 |
|
|
97 |
dest.write ('<!-- %s DTD (Version %s) -->\n' % (name, version)) |
dest.write ('<!-- %s DTD (Version %s) -->\n' % (name, version)) |
202 |
# associated w/that key. Otherwise return dflt. |
# associated w/that key. Otherwise return dflt. |
203 |
# |
# |
204 |
def default(self, dict, key, dflt): |
def default(self, dict, key, dflt): |
205 |
if dict.has_key(key): |
if dict and dict.has_key(key): |
206 |
return dict[key] |
return dict[key] |
207 |
else: |
else: |
208 |
return dflt |
return dflt |
263 |
descr = self.default(self.xmlElements[element],'Description','') |
descr = self.default(self.xmlElements[element],'Description','') |
264 |
if len(descr): |
if len(descr): |
265 |
self.dest.write(self.wrap(5, |
self.dest.write(self.wrap(5, |
266 |
'<!-- %s -->' % (description), 0)) |
'<!-- %s -->' % (descr), 0)) |
267 |
|
|
268 |
elemdef = "<!ELEMENT %s" % element |
elemdef = "<!ELEMENT %s" % element |
269 |
indent = len(elemdef) + 2 |
indent = len(elemdef) + 2 |
342 |
'Description','') |
'Description','') |
343 |
if len(descr): |
if len(descr): |
344 |
self.dest.write(self.wrap(7, |
self.dest.write(self.wrap(7, |
345 |
' <!-- %s -->' % (description), 0)) |
' <!-- %s -->' % (descr), 0)) |
346 |
|
|
347 |
datatype = self.default( |
datatype = self.default( |
348 |
self.xmlElements[element]['Attributes'][att], |
self.xmlElements[element]['Attributes'][att], |