How to use hasContent_ method in autotest

Best Python code snippet using autotest_python

compoundsuper.py

Source:compoundsuper.py Github

copy

Full Screen

...177 def export(self, outfile, level, namespace_='', name_='DoxygenType', namespacedef_=''):178 showIndent(outfile, level)179 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))180 self.exportAttributes(outfile, level, namespace_, name_='DoxygenType')181 if self.hasContent_():182 outfile.write('>\n')183 self.exportChildren(outfile, level + 1, namespace_, name_)184 showIndent(outfile, level)185 outfile.write('</%s%s>\n' % (namespace_, name_))186 else:187 outfile.write(' />\n')188 def exportAttributes(self, outfile, level, namespace_='', name_='DoxygenType'):189 outfile.write(' version=%s' % (quote_attrib(self.version), ))190 def exportChildren(self, outfile, level, namespace_='', name_='DoxygenType'):191 if self.compounddef:192 self.compounddef.export(outfile, level, namespace_, name_='compounddef')193 def hasContent_(self):194 if (195 self.compounddef is not None196 ):197 return True198 else:199 return False200 def exportLiteral(self, outfile, level, name_='DoxygenType'):201 level += 1202 self.exportLiteralAttributes(outfile, level, name_)203 if self.hasContent_():204 self.exportLiteralChildren(outfile, level, name_)205 def exportLiteralAttributes(self, outfile, level, name_):206 if self.version is not None:207 showIndent(outfile, level)208 outfile.write('version = "%s",\n' % (self.version,))209 def exportLiteralChildren(self, outfile, level, name_):210 if self.compounddef:211 showIndent(outfile, level)212 outfile.write('compounddef=model_.compounddefType(\n')213 self.compounddef.exportLiteral(outfile, level, name_='compounddef')214 showIndent(outfile, level)215 outfile.write('),\n')216 def build(self, node_):217 attrs = node_.attributes218 self.buildAttributes(attrs)219 for child_ in node_.childNodes:220 nodeName_ = child_.nodeName.split(':')[-1]221 self.buildChildren(child_, nodeName_)222 def buildAttributes(self, attrs):223 if attrs.get('version'):224 self.version = attrs.get('version').value225 def buildChildren(self, child_, nodeName_):226 if child_.nodeType == Node.ELEMENT_NODE and \227 nodeName_ == 'compounddef':228 obj_ = compounddefType.factory()229 obj_.build(child_)230 self.set_compounddef(obj_)231# end class DoxygenType232class compounddefType(GeneratedsSuper):233 subclass = None234 superclass = None235 def __init__(self, kind=None, prot=None, id=None, compoundname=None, title=None, basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, innerclass=None, innernamespace=None, innerpage=None, innergroup=None, templateparamlist=None, sectiondef=None, briefdescription=None, detaileddescription=None, inheritancegraph=None, collaborationgraph=None, programlisting=None, location=None, listofallmembers=None):236 self.kind = kind237 self.prot = prot238 self.id = id239 self.compoundname = compoundname240 self.title = title241 if basecompoundref is None:242 self.basecompoundref = []243 else:244 self.basecompoundref = basecompoundref245 if derivedcompoundref is None:246 self.derivedcompoundref = []247 else:248 self.derivedcompoundref = derivedcompoundref249 if includes is None:250 self.includes = []251 else:252 self.includes = includes253 if includedby is None:254 self.includedby = []255 else:256 self.includedby = includedby257 self.incdepgraph = incdepgraph258 self.invincdepgraph = invincdepgraph259 if innerdir is None:260 self.innerdir = []261 else:262 self.innerdir = innerdir263 if innerfile is None:264 self.innerfile = []265 else:266 self.innerfile = innerfile267 if innerclass is None:268 self.innerclass = []269 else:270 self.innerclass = innerclass271 if innernamespace is None:272 self.innernamespace = []273 else:274 self.innernamespace = innernamespace275 if innerpage is None:276 self.innerpage = []277 else:278 self.innerpage = innerpage279 if innergroup is None:280 self.innergroup = []281 else:282 self.innergroup = innergroup283 self.templateparamlist = templateparamlist284 if sectiondef is None:285 self.sectiondef = []286 else:287 self.sectiondef = sectiondef288 self.briefdescription = briefdescription289 self.detaileddescription = detaileddescription290 self.inheritancegraph = inheritancegraph291 self.collaborationgraph = collaborationgraph292 self.programlisting = programlisting293 self.location = location294 self.listofallmembers = listofallmembers295 def factory(*args_, **kwargs_):296 if compounddefType.subclass:297 return compounddefType.subclass(*args_, **kwargs_)298 else:299 return compounddefType(*args_, **kwargs_)300 factory = staticmethod(factory)301 def get_compoundname(self): return self.compoundname302 def set_compoundname(self, compoundname): self.compoundname = compoundname303 def get_title(self): return self.title304 def set_title(self, title): self.title = title305 def get_basecompoundref(self): return self.basecompoundref306 def set_basecompoundref(self, basecompoundref): self.basecompoundref = basecompoundref307 def add_basecompoundref(self, value): self.basecompoundref.append(value)308 def insert_basecompoundref(self, index, value): self.basecompoundref[index] = value309 def get_derivedcompoundref(self): return self.derivedcompoundref310 def set_derivedcompoundref(self, derivedcompoundref): self.derivedcompoundref = derivedcompoundref311 def add_derivedcompoundref(self, value): self.derivedcompoundref.append(value)312 def insert_derivedcompoundref(self, index, value): self.derivedcompoundref[index] = value313 def get_includes(self): return self.includes314 def set_includes(self, includes): self.includes = includes315 def add_includes(self, value): self.includes.append(value)316 def insert_includes(self, index, value): self.includes[index] = value317 def get_includedby(self): return self.includedby318 def set_includedby(self, includedby): self.includedby = includedby319 def add_includedby(self, value): self.includedby.append(value)320 def insert_includedby(self, index, value): self.includedby[index] = value321 def get_incdepgraph(self): return self.incdepgraph322 def set_incdepgraph(self, incdepgraph): self.incdepgraph = incdepgraph323 def get_invincdepgraph(self): return self.invincdepgraph324 def set_invincdepgraph(self, invincdepgraph): self.invincdepgraph = invincdepgraph325 def get_innerdir(self): return self.innerdir326 def set_innerdir(self, innerdir): self.innerdir = innerdir327 def add_innerdir(self, value): self.innerdir.append(value)328 def insert_innerdir(self, index, value): self.innerdir[index] = value329 def get_innerfile(self): return self.innerfile330 def set_innerfile(self, innerfile): self.innerfile = innerfile331 def add_innerfile(self, value): self.innerfile.append(value)332 def insert_innerfile(self, index, value): self.innerfile[index] = value333 def get_innerclass(self): return self.innerclass334 def set_innerclass(self, innerclass): self.innerclass = innerclass335 def add_innerclass(self, value): self.innerclass.append(value)336 def insert_innerclass(self, index, value): self.innerclass[index] = value337 def get_innernamespace(self): return self.innernamespace338 def set_innernamespace(self, innernamespace): self.innernamespace = innernamespace339 def add_innernamespace(self, value): self.innernamespace.append(value)340 def insert_innernamespace(self, index, value): self.innernamespace[index] = value341 def get_innerpage(self): return self.innerpage342 def set_innerpage(self, innerpage): self.innerpage = innerpage343 def add_innerpage(self, value): self.innerpage.append(value)344 def insert_innerpage(self, index, value): self.innerpage[index] = value345 def get_innergroup(self): return self.innergroup346 def set_innergroup(self, innergroup): self.innergroup = innergroup347 def add_innergroup(self, value): self.innergroup.append(value)348 def insert_innergroup(self, index, value): self.innergroup[index] = value349 def get_templateparamlist(self): return self.templateparamlist350 def set_templateparamlist(self, templateparamlist): self.templateparamlist = templateparamlist351 def get_sectiondef(self): return self.sectiondef352 def set_sectiondef(self, sectiondef): self.sectiondef = sectiondef353 def add_sectiondef(self, value): self.sectiondef.append(value)354 def insert_sectiondef(self, index, value): self.sectiondef[index] = value355 def get_briefdescription(self): return self.briefdescription356 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription357 def get_detaileddescription(self): return self.detaileddescription358 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription359 def get_inheritancegraph(self): return self.inheritancegraph360 def set_inheritancegraph(self, inheritancegraph): self.inheritancegraph = inheritancegraph361 def get_collaborationgraph(self): return self.collaborationgraph362 def set_collaborationgraph(self, collaborationgraph): self.collaborationgraph = collaborationgraph363 def get_programlisting(self): return self.programlisting364 def set_programlisting(self, programlisting): self.programlisting = programlisting365 def get_location(self): return self.location366 def set_location(self, location): self.location = location367 def get_listofallmembers(self): return self.listofallmembers368 def set_listofallmembers(self, listofallmembers): self.listofallmembers = listofallmembers369 def get_kind(self): return self.kind370 def set_kind(self, kind): self.kind = kind371 def get_prot(self): return self.prot372 def set_prot(self, prot): self.prot = prot373 def get_id(self): return self.id374 def set_id(self, id): self.id = id375 def export(self, outfile, level, namespace_='', name_='compounddefType', namespacedef_=''):376 showIndent(outfile, level)377 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))378 self.exportAttributes(outfile, level, namespace_, name_='compounddefType')379 if self.hasContent_():380 outfile.write('>\n')381 self.exportChildren(outfile, level + 1, namespace_, name_)382 showIndent(outfile, level)383 outfile.write('</%s%s>\n' % (namespace_, name_))384 else:385 outfile.write(' />\n')386 def exportAttributes(self, outfile, level, namespace_='', name_='compounddefType'):387 if self.kind is not None:388 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))389 if self.prot is not None:390 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))391 if self.id is not None:392 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))393 def exportChildren(self, outfile, level, namespace_='', name_='compounddefType'):394 if self.compoundname is not None:395 showIndent(outfile, level)396 outfile.write('<%scompoundname>%s</%scompoundname>\n' % (namespace_, self.format_string(quote_xml(self.compoundname).encode(ExternalEncoding), input_name='compoundname'), namespace_))397 if self.title is not None:398 showIndent(outfile, level)399 outfile.write('<%stitle>%s</%stitle>\n' % (namespace_, self.format_string(quote_xml(self.title).encode(ExternalEncoding), input_name='title'), namespace_))400 for basecompoundref_ in self.basecompoundref:401 basecompoundref_.export(outfile, level, namespace_, name_='basecompoundref')402 for derivedcompoundref_ in self.derivedcompoundref:403 derivedcompoundref_.export(outfile, level, namespace_, name_='derivedcompoundref')404 for includes_ in self.includes:405 includes_.export(outfile, level, namespace_, name_='includes')406 for includedby_ in self.includedby:407 includedby_.export(outfile, level, namespace_, name_='includedby')408 if self.incdepgraph:409 self.incdepgraph.export(outfile, level, namespace_, name_='incdepgraph')410 if self.invincdepgraph:411 self.invincdepgraph.export(outfile, level, namespace_, name_='invincdepgraph')412 for innerdir_ in self.innerdir:413 innerdir_.export(outfile, level, namespace_, name_='innerdir')414 for innerfile_ in self.innerfile:415 innerfile_.export(outfile, level, namespace_, name_='innerfile')416 for innerclass_ in self.innerclass:417 innerclass_.export(outfile, level, namespace_, name_='innerclass')418 for innernamespace_ in self.innernamespace:419 innernamespace_.export(outfile, level, namespace_, name_='innernamespace')420 for innerpage_ in self.innerpage:421 innerpage_.export(outfile, level, namespace_, name_='innerpage')422 for innergroup_ in self.innergroup:423 innergroup_.export(outfile, level, namespace_, name_='innergroup')424 if self.templateparamlist:425 self.templateparamlist.export(outfile, level, namespace_, name_='templateparamlist')426 for sectiondef_ in self.sectiondef:427 sectiondef_.export(outfile, level, namespace_, name_='sectiondef')428 if self.briefdescription:429 self.briefdescription.export(outfile, level, namespace_, name_='briefdescription')430 if self.detaileddescription:431 self.detaileddescription.export(outfile, level, namespace_, name_='detaileddescription')432 if self.inheritancegraph:433 self.inheritancegraph.export(outfile, level, namespace_, name_='inheritancegraph')434 if self.collaborationgraph:435 self.collaborationgraph.export(outfile, level, namespace_, name_='collaborationgraph')436 if self.programlisting:437 self.programlisting.export(outfile, level, namespace_, name_='programlisting')438 if self.location:439 self.location.export(outfile, level, namespace_, name_='location')440 if self.listofallmembers:441 self.listofallmembers.export(outfile, level, namespace_, name_='listofallmembers')442 def hasContent_(self):443 if (444 self.compoundname is not None or445 self.title is not None or446 self.basecompoundref is not None or447 self.derivedcompoundref is not None or448 self.includes is not None or449 self.includedby is not None or450 self.incdepgraph is not None or451 self.invincdepgraph is not None or452 self.innerdir is not None or453 self.innerfile is not None or454 self.innerclass is not None or455 self.innernamespace is not None or456 self.innerpage is not None or457 self.innergroup is not None or458 self.templateparamlist is not None or459 self.sectiondef is not None or460 self.briefdescription is not None or461 self.detaileddescription is not None or462 self.inheritancegraph is not None or463 self.collaborationgraph is not None or464 self.programlisting is not None or465 self.location is not None or466 self.listofallmembers is not None467 ):468 return True469 else:470 return False471 def exportLiteral(self, outfile, level, name_='compounddefType'):472 level += 1473 self.exportLiteralAttributes(outfile, level, name_)474 if self.hasContent_():475 self.exportLiteralChildren(outfile, level, name_)476 def exportLiteralAttributes(self, outfile, level, name_):477 if self.kind is not None:478 showIndent(outfile, level)479 outfile.write('kind = "%s",\n' % (self.kind,))480 if self.prot is not None:481 showIndent(outfile, level)482 outfile.write('prot = "%s",\n' % (self.prot,))483 if self.id is not None:484 showIndent(outfile, level)485 outfile.write('id = %s,\n' % (self.id,))486 def exportLiteralChildren(self, outfile, level, name_):487 showIndent(outfile, level)488 outfile.write('compoundname=%s,\n' % quote_python(self.compoundname).encode(ExternalEncoding))489 if self.title:490 showIndent(outfile, level)491 outfile.write('title=model_.xsd_string(\n')492 self.title.exportLiteral(outfile, level, name_='title')493 showIndent(outfile, level)494 outfile.write('),\n')495 showIndent(outfile, level)496 outfile.write('basecompoundref=[\n')497 level += 1498 for basecompoundref in self.basecompoundref:499 showIndent(outfile, level)500 outfile.write('model_.basecompoundref(\n')501 basecompoundref.exportLiteral(outfile, level, name_='basecompoundref')502 showIndent(outfile, level)503 outfile.write('),\n')504 level -= 1505 showIndent(outfile, level)506 outfile.write('],\n')507 showIndent(outfile, level)508 outfile.write('derivedcompoundref=[\n')509 level += 1510 for derivedcompoundref in self.derivedcompoundref:511 showIndent(outfile, level)512 outfile.write('model_.derivedcompoundref(\n')513 derivedcompoundref.exportLiteral(outfile, level, name_='derivedcompoundref')514 showIndent(outfile, level)515 outfile.write('),\n')516 level -= 1517 showIndent(outfile, level)518 outfile.write('],\n')519 showIndent(outfile, level)520 outfile.write('includes=[\n')521 level += 1522 for includes in self.includes:523 showIndent(outfile, level)524 outfile.write('model_.includes(\n')525 includes.exportLiteral(outfile, level, name_='includes')526 showIndent(outfile, level)527 outfile.write('),\n')528 level -= 1529 showIndent(outfile, level)530 outfile.write('],\n')531 showIndent(outfile, level)532 outfile.write('includedby=[\n')533 level += 1534 for includedby in self.includedby:535 showIndent(outfile, level)536 outfile.write('model_.includedby(\n')537 includedby.exportLiteral(outfile, level, name_='includedby')538 showIndent(outfile, level)539 outfile.write('),\n')540 level -= 1541 showIndent(outfile, level)542 outfile.write('],\n')543 if self.incdepgraph:544 showIndent(outfile, level)545 outfile.write('incdepgraph=model_.graphType(\n')546 self.incdepgraph.exportLiteral(outfile, level, name_='incdepgraph')547 showIndent(outfile, level)548 outfile.write('),\n')549 if self.invincdepgraph:550 showIndent(outfile, level)551 outfile.write('invincdepgraph=model_.graphType(\n')552 self.invincdepgraph.exportLiteral(outfile, level, name_='invincdepgraph')553 showIndent(outfile, level)554 outfile.write('),\n')555 showIndent(outfile, level)556 outfile.write('innerdir=[\n')557 level += 1558 for innerdir in self.innerdir:559 showIndent(outfile, level)560 outfile.write('model_.innerdir(\n')561 innerdir.exportLiteral(outfile, level, name_='innerdir')562 showIndent(outfile, level)563 outfile.write('),\n')564 level -= 1565 showIndent(outfile, level)566 outfile.write('],\n')567 showIndent(outfile, level)568 outfile.write('innerfile=[\n')569 level += 1570 for innerfile in self.innerfile:571 showIndent(outfile, level)572 outfile.write('model_.innerfile(\n')573 innerfile.exportLiteral(outfile, level, name_='innerfile')574 showIndent(outfile, level)575 outfile.write('),\n')576 level -= 1577 showIndent(outfile, level)578 outfile.write('],\n')579 showIndent(outfile, level)580 outfile.write('innerclass=[\n')581 level += 1582 for innerclass in self.innerclass:583 showIndent(outfile, level)584 outfile.write('model_.innerclass(\n')585 innerclass.exportLiteral(outfile, level, name_='innerclass')586 showIndent(outfile, level)587 outfile.write('),\n')588 level -= 1589 showIndent(outfile, level)590 outfile.write('],\n')591 showIndent(outfile, level)592 outfile.write('innernamespace=[\n')593 level += 1594 for innernamespace in self.innernamespace:595 showIndent(outfile, level)596 outfile.write('model_.innernamespace(\n')597 innernamespace.exportLiteral(outfile, level, name_='innernamespace')598 showIndent(outfile, level)599 outfile.write('),\n')600 level -= 1601 showIndent(outfile, level)602 outfile.write('],\n')603 showIndent(outfile, level)604 outfile.write('innerpage=[\n')605 level += 1606 for innerpage in self.innerpage:607 showIndent(outfile, level)608 outfile.write('model_.innerpage(\n')609 innerpage.exportLiteral(outfile, level, name_='innerpage')610 showIndent(outfile, level)611 outfile.write('),\n')612 level -= 1613 showIndent(outfile, level)614 outfile.write('],\n')615 showIndent(outfile, level)616 outfile.write('innergroup=[\n')617 level += 1618 for innergroup in self.innergroup:619 showIndent(outfile, level)620 outfile.write('model_.innergroup(\n')621 innergroup.exportLiteral(outfile, level, name_='innergroup')622 showIndent(outfile, level)623 outfile.write('),\n')624 level -= 1625 showIndent(outfile, level)626 outfile.write('],\n')627 if self.templateparamlist:628 showIndent(outfile, level)629 outfile.write('templateparamlist=model_.templateparamlistType(\n')630 self.templateparamlist.exportLiteral(outfile, level, name_='templateparamlist')631 showIndent(outfile, level)632 outfile.write('),\n')633 showIndent(outfile, level)634 outfile.write('sectiondef=[\n')635 level += 1636 for sectiondef in self.sectiondef:637 showIndent(outfile, level)638 outfile.write('model_.sectiondef(\n')639 sectiondef.exportLiteral(outfile, level, name_='sectiondef')640 showIndent(outfile, level)641 outfile.write('),\n')642 level -= 1643 showIndent(outfile, level)644 outfile.write('],\n')645 if self.briefdescription:646 showIndent(outfile, level)647 outfile.write('briefdescription=model_.descriptionType(\n')648 self.briefdescription.exportLiteral(outfile, level, name_='briefdescription')649 showIndent(outfile, level)650 outfile.write('),\n')651 if self.detaileddescription:652 showIndent(outfile, level)653 outfile.write('detaileddescription=model_.descriptionType(\n')654 self.detaileddescription.exportLiteral(outfile, level, name_='detaileddescription')655 showIndent(outfile, level)656 outfile.write('),\n')657 if self.inheritancegraph:658 showIndent(outfile, level)659 outfile.write('inheritancegraph=model_.graphType(\n')660 self.inheritancegraph.exportLiteral(outfile, level, name_='inheritancegraph')661 showIndent(outfile, level)662 outfile.write('),\n')663 if self.collaborationgraph:664 showIndent(outfile, level)665 outfile.write('collaborationgraph=model_.graphType(\n')666 self.collaborationgraph.exportLiteral(outfile, level, name_='collaborationgraph')667 showIndent(outfile, level)668 outfile.write('),\n')669 if self.programlisting:670 showIndent(outfile, level)671 outfile.write('programlisting=model_.listingType(\n')672 self.programlisting.exportLiteral(outfile, level, name_='programlisting')673 showIndent(outfile, level)674 outfile.write('),\n')675 if self.location:676 showIndent(outfile, level)677 outfile.write('location=model_.locationType(\n')678 self.location.exportLiteral(outfile, level, name_='location')679 showIndent(outfile, level)680 outfile.write('),\n')681 if self.listofallmembers:682 showIndent(outfile, level)683 outfile.write('listofallmembers=model_.listofallmembersType(\n')684 self.listofallmembers.exportLiteral(outfile, level, name_='listofallmembers')685 showIndent(outfile, level)686 outfile.write('),\n')687 def build(self, node_):688 attrs = node_.attributes689 self.buildAttributes(attrs)690 for child_ in node_.childNodes:691 nodeName_ = child_.nodeName.split(':')[-1]692 self.buildChildren(child_, nodeName_)693 def buildAttributes(self, attrs):694 if attrs.get('kind'):695 self.kind = attrs.get('kind').value696 if attrs.get('prot'):697 self.prot = attrs.get('prot').value698 if attrs.get('id'):699 self.id = attrs.get('id').value700 def buildChildren(self, child_, nodeName_):701 if child_.nodeType == Node.ELEMENT_NODE and \702 nodeName_ == 'compoundname':703 compoundname_ = ''704 for text__content_ in child_.childNodes:705 compoundname_ += text__content_.nodeValue706 self.compoundname = compoundname_707 elif child_.nodeType == Node.ELEMENT_NODE and \708 nodeName_ == 'title':709 obj_ = docTitleType.factory()710 obj_.build(child_)711 self.set_title(obj_)712 elif child_.nodeType == Node.ELEMENT_NODE and \713 nodeName_ == 'basecompoundref':714 obj_ = compoundRefType.factory()715 obj_.build(child_)716 self.basecompoundref.append(obj_)717 elif child_.nodeType == Node.ELEMENT_NODE and \718 nodeName_ == 'derivedcompoundref':719 obj_ = compoundRefType.factory()720 obj_.build(child_)721 self.derivedcompoundref.append(obj_)722 elif child_.nodeType == Node.ELEMENT_NODE and \723 nodeName_ == 'includes':724 obj_ = incType.factory()725 obj_.build(child_)726 self.includes.append(obj_)727 elif child_.nodeType == Node.ELEMENT_NODE and \728 nodeName_ == 'includedby':729 obj_ = incType.factory()730 obj_.build(child_)731 self.includedby.append(obj_)732 elif child_.nodeType == Node.ELEMENT_NODE and \733 nodeName_ == 'incdepgraph':734 obj_ = graphType.factory()735 obj_.build(child_)736 self.set_incdepgraph(obj_)737 elif child_.nodeType == Node.ELEMENT_NODE and \738 nodeName_ == 'invincdepgraph':739 obj_ = graphType.factory()740 obj_.build(child_)741 self.set_invincdepgraph(obj_)742 elif child_.nodeType == Node.ELEMENT_NODE and \743 nodeName_ == 'innerdir':744 obj_ = refType.factory()745 obj_.build(child_)746 self.innerdir.append(obj_)747 elif child_.nodeType == Node.ELEMENT_NODE and \748 nodeName_ == 'innerfile':749 obj_ = refType.factory()750 obj_.build(child_)751 self.innerfile.append(obj_)752 elif child_.nodeType == Node.ELEMENT_NODE and \753 nodeName_ == 'innerclass':754 obj_ = refType.factory()755 obj_.build(child_)756 self.innerclass.append(obj_)757 elif child_.nodeType == Node.ELEMENT_NODE and \758 nodeName_ == 'innernamespace':759 obj_ = refType.factory()760 obj_.build(child_)761 self.innernamespace.append(obj_)762 elif child_.nodeType == Node.ELEMENT_NODE and \763 nodeName_ == 'innerpage':764 obj_ = refType.factory()765 obj_.build(child_)766 self.innerpage.append(obj_)767 elif child_.nodeType == Node.ELEMENT_NODE and \768 nodeName_ == 'innergroup':769 obj_ = refType.factory()770 obj_.build(child_)771 self.innergroup.append(obj_)772 elif child_.nodeType == Node.ELEMENT_NODE and \773 nodeName_ == 'templateparamlist':774 obj_ = templateparamlistType.factory()775 obj_.build(child_)776 self.set_templateparamlist(obj_)777 elif child_.nodeType == Node.ELEMENT_NODE and \778 nodeName_ == 'sectiondef':779 obj_ = sectiondefType.factory()780 obj_.build(child_)781 self.sectiondef.append(obj_)782 elif child_.nodeType == Node.ELEMENT_NODE and \783 nodeName_ == 'briefdescription':784 obj_ = descriptionType.factory()785 obj_.build(child_)786 self.set_briefdescription(obj_)787 elif child_.nodeType == Node.ELEMENT_NODE and \788 nodeName_ == 'detaileddescription':789 obj_ = descriptionType.factory()790 obj_.build(child_)791 self.set_detaileddescription(obj_)792 elif child_.nodeType == Node.ELEMENT_NODE and \793 nodeName_ == 'inheritancegraph':794 obj_ = graphType.factory()795 obj_.build(child_)796 self.set_inheritancegraph(obj_)797 elif child_.nodeType == Node.ELEMENT_NODE and \798 nodeName_ == 'collaborationgraph':799 obj_ = graphType.factory()800 obj_.build(child_)801 self.set_collaborationgraph(obj_)802 elif child_.nodeType == Node.ELEMENT_NODE and \803 nodeName_ == 'programlisting':804 obj_ = listingType.factory()805 obj_.build(child_)806 self.set_programlisting(obj_)807 elif child_.nodeType == Node.ELEMENT_NODE and \808 nodeName_ == 'location':809 obj_ = locationType.factory()810 obj_.build(child_)811 self.set_location(obj_)812 elif child_.nodeType == Node.ELEMENT_NODE and \813 nodeName_ == 'listofallmembers':814 obj_ = listofallmembersType.factory()815 obj_.build(child_)816 self.set_listofallmembers(obj_)817# end class compounddefType818class listofallmembersType(GeneratedsSuper):819 subclass = None820 superclass = None821 def __init__(self, member=None):822 if member is None:823 self.member = []824 else:825 self.member = member826 def factory(*args_, **kwargs_):827 if listofallmembersType.subclass:828 return listofallmembersType.subclass(*args_, **kwargs_)829 else:830 return listofallmembersType(*args_, **kwargs_)831 factory = staticmethod(factory)832 def get_member(self): return self.member833 def set_member(self, member): self.member = member834 def add_member(self, value): self.member.append(value)835 def insert_member(self, index, value): self.member[index] = value836 def export(self, outfile, level, namespace_='', name_='listofallmembersType', namespacedef_=''):837 showIndent(outfile, level)838 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))839 self.exportAttributes(outfile, level, namespace_, name_='listofallmembersType')840 if self.hasContent_():841 outfile.write('>\n')842 self.exportChildren(outfile, level + 1, namespace_, name_)843 showIndent(outfile, level)844 outfile.write('</%s%s>\n' % (namespace_, name_))845 else:846 outfile.write(' />\n')847 def exportAttributes(self, outfile, level, namespace_='', name_='listofallmembersType'):848 pass849 def exportChildren(self, outfile, level, namespace_='', name_='listofallmembersType'):850 for member_ in self.member:851 member_.export(outfile, level, namespace_, name_='member')852 def hasContent_(self):853 if (854 self.member is not None855 ):856 return True857 else:858 return False859 def exportLiteral(self, outfile, level, name_='listofallmembersType'):860 level += 1861 self.exportLiteralAttributes(outfile, level, name_)862 if self.hasContent_():863 self.exportLiteralChildren(outfile, level, name_)864 def exportLiteralAttributes(self, outfile, level, name_):865 pass866 def exportLiteralChildren(self, outfile, level, name_):867 showIndent(outfile, level)868 outfile.write('member=[\n')869 level += 1870 for member in self.member:871 showIndent(outfile, level)872 outfile.write('model_.member(\n')873 member.exportLiteral(outfile, level, name_='member')874 showIndent(outfile, level)875 outfile.write('),\n')876 level -= 1877 showIndent(outfile, level)878 outfile.write('],\n')879 def build(self, node_):880 attrs = node_.attributes881 self.buildAttributes(attrs)882 for child_ in node_.childNodes:883 nodeName_ = child_.nodeName.split(':')[-1]884 self.buildChildren(child_, nodeName_)885 def buildAttributes(self, attrs):886 pass887 def buildChildren(self, child_, nodeName_):888 if child_.nodeType == Node.ELEMENT_NODE and \889 nodeName_ == 'member':890 obj_ = memberRefType.factory()891 obj_.build(child_)892 self.member.append(obj_)893# end class listofallmembersType894class memberRefType(GeneratedsSuper):895 subclass = None896 superclass = None897 def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope=None, name=None):898 self.virt = virt899 self.prot = prot900 self.refid = refid901 self.ambiguityscope = ambiguityscope902 self.scope = scope903 self.name = name904 def factory(*args_, **kwargs_):905 if memberRefType.subclass:906 return memberRefType.subclass(*args_, **kwargs_)907 else:908 return memberRefType(*args_, **kwargs_)909 factory = staticmethod(factory)910 def get_scope(self): return self.scope911 def set_scope(self, scope): self.scope = scope912 def get_name(self): return self.name913 def set_name(self, name): self.name = name914 def get_virt(self): return self.virt915 def set_virt(self, virt): self.virt = virt916 def get_prot(self): return self.prot917 def set_prot(self, prot): self.prot = prot918 def get_refid(self): return self.refid919 def set_refid(self, refid): self.refid = refid920 def get_ambiguityscope(self): return self.ambiguityscope921 def set_ambiguityscope(self, ambiguityscope): self.ambiguityscope = ambiguityscope922 def export(self, outfile, level, namespace_='', name_='memberRefType', namespacedef_=''):923 showIndent(outfile, level)924 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))925 self.exportAttributes(outfile, level, namespace_, name_='memberRefType')926 if self.hasContent_():927 outfile.write('>\n')928 self.exportChildren(outfile, level + 1, namespace_, name_)929 showIndent(outfile, level)930 outfile.write('</%s%s>\n' % (namespace_, name_))931 else:932 outfile.write(' />\n')933 def exportAttributes(self, outfile, level, namespace_='', name_='memberRefType'):934 if self.virt is not None:935 outfile.write(' virt=%s' % (quote_attrib(self.virt), ))936 if self.prot is not None:937 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))938 if self.refid is not None:939 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))940 if self.ambiguityscope is not None:941 outfile.write(' ambiguityscope=%s' % (self.format_string(quote_attrib(self.ambiguityscope).encode(ExternalEncoding), input_name='ambiguityscope'), ))942 def exportChildren(self, outfile, level, namespace_='', name_='memberRefType'):943 if self.scope is not None:944 showIndent(outfile, level)945 outfile.write('<%sscope>%s</%sscope>\n' % (namespace_, self.format_string(quote_xml(self.scope).encode(ExternalEncoding), input_name='scope'), namespace_))946 if self.name is not None:947 showIndent(outfile, level)948 outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))949 def hasContent_(self):950 if (951 self.scope is not None or952 self.name is not None953 ):954 return True955 else:956 return False957 def exportLiteral(self, outfile, level, name_='memberRefType'):958 level += 1959 self.exportLiteralAttributes(outfile, level, name_)960 if self.hasContent_():961 self.exportLiteralChildren(outfile, level, name_)962 def exportLiteralAttributes(self, outfile, level, name_):963 if self.virt is not None:964 showIndent(outfile, level)965 outfile.write('virt = "%s",\n' % (self.virt,))966 if self.prot is not None:967 showIndent(outfile, level)968 outfile.write('prot = "%s",\n' % (self.prot,))969 if self.refid is not None:970 showIndent(outfile, level)971 outfile.write('refid = %s,\n' % (self.refid,))972 if self.ambiguityscope is not None:973 showIndent(outfile, level)974 outfile.write('ambiguityscope = %s,\n' % (self.ambiguityscope,))975 def exportLiteralChildren(self, outfile, level, name_):976 showIndent(outfile, level)977 outfile.write('scope=%s,\n' % quote_python(self.scope).encode(ExternalEncoding))978 showIndent(outfile, level)979 outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))980 def build(self, node_):981 attrs = node_.attributes982 self.buildAttributes(attrs)983 for child_ in node_.childNodes:984 nodeName_ = child_.nodeName.split(':')[-1]985 self.buildChildren(child_, nodeName_)986 def buildAttributes(self, attrs):987 if attrs.get('virt'):988 self.virt = attrs.get('virt').value989 if attrs.get('prot'):990 self.prot = attrs.get('prot').value991 if attrs.get('refid'):992 self.refid = attrs.get('refid').value993 if attrs.get('ambiguityscope'):994 self.ambiguityscope = attrs.get('ambiguityscope').value995 def buildChildren(self, child_, nodeName_):996 if child_.nodeType == Node.ELEMENT_NODE and \997 nodeName_ == 'scope':998 scope_ = ''999 for text__content_ in child_.childNodes:1000 scope_ += text__content_.nodeValue1001 self.scope = scope_1002 elif child_.nodeType == Node.ELEMENT_NODE and \1003 nodeName_ == 'name':1004 name_ = ''1005 for text__content_ in child_.childNodes:1006 name_ += text__content_.nodeValue1007 self.name = name_1008# end class memberRefType1009class scope(GeneratedsSuper):1010 subclass = None1011 superclass = None1012 def __init__(self, valueOf_=''):1013 self.valueOf_ = valueOf_1014 def factory(*args_, **kwargs_):1015 if scope.subclass:1016 return scope.subclass(*args_, **kwargs_)1017 else:1018 return scope(*args_, **kwargs_)1019 factory = staticmethod(factory)1020 def getValueOf_(self): return self.valueOf_1021 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1022 def export(self, outfile, level, namespace_='', name_='scope', namespacedef_=''):1023 showIndent(outfile, level)1024 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1025 self.exportAttributes(outfile, level, namespace_, name_='scope')1026 if self.hasContent_():1027 outfile.write('>\n')1028 self.exportChildren(outfile, level + 1, namespace_, name_)1029 showIndent(outfile, level)1030 outfile.write('</%s%s>\n' % (namespace_, name_))1031 else:1032 outfile.write(' />\n')1033 def exportAttributes(self, outfile, level, namespace_='', name_='scope'):1034 pass1035 def exportChildren(self, outfile, level, namespace_='', name_='scope'):1036 if self.valueOf_.find('![CDATA')>-1:1037 value=quote_xml('%s' % self.valueOf_)1038 value=value.replace('![CDATA','<![CDATA')1039 value=value.replace(']]',']]>')1040 outfile.write(value)1041 else:1042 outfile.write(quote_xml('%s' % self.valueOf_))1043 def hasContent_(self):1044 if (1045 self.valueOf_ is not None1046 ):1047 return True1048 else:1049 return False1050 def exportLiteral(self, outfile, level, name_='scope'):1051 level += 11052 self.exportLiteralAttributes(outfile, level, name_)1053 if self.hasContent_():1054 self.exportLiteralChildren(outfile, level, name_)1055 def exportLiteralAttributes(self, outfile, level, name_):1056 pass1057 def exportLiteralChildren(self, outfile, level, name_):1058 showIndent(outfile, level)1059 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1060 def build(self, node_):1061 attrs = node_.attributes1062 self.buildAttributes(attrs)1063 self.valueOf_ = ''1064 for child_ in node_.childNodes:1065 nodeName_ = child_.nodeName.split(':')[-1]1066 self.buildChildren(child_, nodeName_)1067 def buildAttributes(self, attrs):1068 pass1069 def buildChildren(self, child_, nodeName_):1070 if child_.nodeType == Node.TEXT_NODE:1071 self.valueOf_ += child_.nodeValue1072 elif child_.nodeType == Node.CDATA_SECTION_NODE:1073 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1074# end class scope1075class name(GeneratedsSuper):1076 subclass = None1077 superclass = None1078 def __init__(self, valueOf_=''):1079 self.valueOf_ = valueOf_1080 def factory(*args_, **kwargs_):1081 if name.subclass:1082 return name.subclass(*args_, **kwargs_)1083 else:1084 return name(*args_, **kwargs_)1085 factory = staticmethod(factory)1086 def getValueOf_(self): return self.valueOf_1087 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1088 def export(self, outfile, level, namespace_='', name_='name', namespacedef_=''):1089 showIndent(outfile, level)1090 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1091 self.exportAttributes(outfile, level, namespace_, name_='name')1092 if self.hasContent_():1093 outfile.write('>\n')1094 self.exportChildren(outfile, level + 1, namespace_, name_)1095 showIndent(outfile, level)1096 outfile.write('</%s%s>\n' % (namespace_, name_))1097 else:1098 outfile.write(' />\n')1099 def exportAttributes(self, outfile, level, namespace_='', name_='name'):1100 pass1101 def exportChildren(self, outfile, level, namespace_='', name_='name'):1102 if self.valueOf_.find('![CDATA')>-1:1103 value=quote_xml('%s' % self.valueOf_)1104 value=value.replace('![CDATA','<![CDATA')1105 value=value.replace(']]',']]>')1106 outfile.write(value)1107 else:1108 outfile.write(quote_xml('%s' % self.valueOf_))1109 def hasContent_(self):1110 if (1111 self.valueOf_ is not None1112 ):1113 return True1114 else:1115 return False1116 def exportLiteral(self, outfile, level, name_='name'):1117 level += 11118 self.exportLiteralAttributes(outfile, level, name_)1119 if self.hasContent_():1120 self.exportLiteralChildren(outfile, level, name_)1121 def exportLiteralAttributes(self, outfile, level, name_):1122 pass1123 def exportLiteralChildren(self, outfile, level, name_):1124 showIndent(outfile, level)1125 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1126 def build(self, node_):1127 attrs = node_.attributes1128 self.buildAttributes(attrs)1129 self.valueOf_ = ''1130 for child_ in node_.childNodes:1131 nodeName_ = child_.nodeName.split(':')[-1]1132 self.buildChildren(child_, nodeName_)1133 def buildAttributes(self, attrs):1134 pass1135 def buildChildren(self, child_, nodeName_):1136 if child_.nodeType == Node.TEXT_NODE:1137 self.valueOf_ += child_.nodeValue1138 elif child_.nodeType == Node.CDATA_SECTION_NODE:1139 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1140# end class name1141class compoundRefType(GeneratedsSuper):1142 subclass = None1143 superclass = None1144 def __init__(self, virt=None, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):1145 self.virt = virt1146 self.prot = prot1147 self.refid = refid1148 if mixedclass_ is None:1149 self.mixedclass_ = MixedContainer1150 else:1151 self.mixedclass_ = mixedclass_1152 if content_ is None:1153 self.content_ = []1154 else:1155 self.content_ = content_1156 def factory(*args_, **kwargs_):1157 if compoundRefType.subclass:1158 return compoundRefType.subclass(*args_, **kwargs_)1159 else:1160 return compoundRefType(*args_, **kwargs_)1161 factory = staticmethod(factory)1162 def get_virt(self): return self.virt1163 def set_virt(self, virt): self.virt = virt1164 def get_prot(self): return self.prot1165 def set_prot(self, prot): self.prot = prot1166 def get_refid(self): return self.refid1167 def set_refid(self, refid): self.refid = refid1168 def getValueOf_(self): return self.valueOf_1169 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1170 def export(self, outfile, level, namespace_='', name_='compoundRefType', namespacedef_=''):1171 showIndent(outfile, level)1172 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1173 self.exportAttributes(outfile, level, namespace_, name_='compoundRefType')1174 outfile.write('>')1175 self.exportChildren(outfile, level + 1, namespace_, name_)1176 outfile.write('</%s%s>\n' % (namespace_, name_))1177 def exportAttributes(self, outfile, level, namespace_='', name_='compoundRefType'):1178 if self.virt is not None:1179 outfile.write(' virt=%s' % (quote_attrib(self.virt), ))1180 if self.prot is not None:1181 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))1182 if self.refid is not None:1183 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1184 def exportChildren(self, outfile, level, namespace_='', name_='compoundRefType'):1185 if self.valueOf_.find('![CDATA')>-1:1186 value=quote_xml('%s' % self.valueOf_)1187 value=value.replace('![CDATA','<![CDATA')1188 value=value.replace(']]',']]>')1189 outfile.write(value)1190 else:1191 outfile.write(quote_xml('%s' % self.valueOf_))1192 def hasContent_(self):1193 if (1194 self.valueOf_ is not None1195 ):1196 return True1197 else:1198 return False1199 def exportLiteral(self, outfile, level, name_='compoundRefType'):1200 level += 11201 self.exportLiteralAttributes(outfile, level, name_)1202 if self.hasContent_():1203 self.exportLiteralChildren(outfile, level, name_)1204 def exportLiteralAttributes(self, outfile, level, name_):1205 if self.virt is not None:1206 showIndent(outfile, level)1207 outfile.write('virt = "%s",\n' % (self.virt,))1208 if self.prot is not None:1209 showIndent(outfile, level)1210 outfile.write('prot = "%s",\n' % (self.prot,))1211 if self.refid is not None:1212 showIndent(outfile, level)1213 outfile.write('refid = %s,\n' % (self.refid,))1214 def exportLiteralChildren(self, outfile, level, name_):1215 showIndent(outfile, level)1216 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1217 def build(self, node_):1218 attrs = node_.attributes1219 self.buildAttributes(attrs)1220 self.valueOf_ = ''1221 for child_ in node_.childNodes:1222 nodeName_ = child_.nodeName.split(':')[-1]1223 self.buildChildren(child_, nodeName_)1224 def buildAttributes(self, attrs):1225 if attrs.get('virt'):1226 self.virt = attrs.get('virt').value1227 if attrs.get('prot'):1228 self.prot = attrs.get('prot').value1229 if attrs.get('refid'):1230 self.refid = attrs.get('refid').value1231 def buildChildren(self, child_, nodeName_):1232 if child_.nodeType == Node.TEXT_NODE:1233 obj_ = self.mixedclass_(MixedContainer.CategoryText,1234 MixedContainer.TypeNone, '', child_.nodeValue)1235 self.content_.append(obj_)1236 if child_.nodeType == Node.TEXT_NODE:1237 self.valueOf_ += child_.nodeValue1238 elif child_.nodeType == Node.CDATA_SECTION_NODE:1239 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1240# end class compoundRefType1241class reimplementType(GeneratedsSuper):1242 subclass = None1243 superclass = None1244 def __init__(self, refid=None, valueOf_='', mixedclass_=None, content_=None):1245 self.refid = refid1246 if mixedclass_ is None:1247 self.mixedclass_ = MixedContainer1248 else:1249 self.mixedclass_ = mixedclass_1250 if content_ is None:1251 self.content_ = []1252 else:1253 self.content_ = content_1254 def factory(*args_, **kwargs_):1255 if reimplementType.subclass:1256 return reimplementType.subclass(*args_, **kwargs_)1257 else:1258 return reimplementType(*args_, **kwargs_)1259 factory = staticmethod(factory)1260 def get_refid(self): return self.refid1261 def set_refid(self, refid): self.refid = refid1262 def getValueOf_(self): return self.valueOf_1263 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1264 def export(self, outfile, level, namespace_='', name_='reimplementType', namespacedef_=''):1265 showIndent(outfile, level)1266 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1267 self.exportAttributes(outfile, level, namespace_, name_='reimplementType')1268 outfile.write('>')1269 self.exportChildren(outfile, level + 1, namespace_, name_)1270 outfile.write('</%s%s>\n' % (namespace_, name_))1271 def exportAttributes(self, outfile, level, namespace_='', name_='reimplementType'):1272 if self.refid is not None:1273 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1274 def exportChildren(self, outfile, level, namespace_='', name_='reimplementType'):1275 if self.valueOf_.find('![CDATA')>-1:1276 value=quote_xml('%s' % self.valueOf_)1277 value=value.replace('![CDATA','<![CDATA')1278 value=value.replace(']]',']]>')1279 outfile.write(value)1280 else:1281 outfile.write(quote_xml('%s' % self.valueOf_))1282 def hasContent_(self):1283 if (1284 self.valueOf_ is not None1285 ):1286 return True1287 else:1288 return False1289 def exportLiteral(self, outfile, level, name_='reimplementType'):1290 level += 11291 self.exportLiteralAttributes(outfile, level, name_)1292 if self.hasContent_():1293 self.exportLiteralChildren(outfile, level, name_)1294 def exportLiteralAttributes(self, outfile, level, name_):1295 if self.refid is not None:1296 showIndent(outfile, level)1297 outfile.write('refid = %s,\n' % (self.refid,))1298 def exportLiteralChildren(self, outfile, level, name_):1299 showIndent(outfile, level)1300 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1301 def build(self, node_):1302 attrs = node_.attributes1303 self.buildAttributes(attrs)1304 self.valueOf_ = ''1305 for child_ in node_.childNodes:1306 nodeName_ = child_.nodeName.split(':')[-1]1307 self.buildChildren(child_, nodeName_)1308 def buildAttributes(self, attrs):1309 if attrs.get('refid'):1310 self.refid = attrs.get('refid').value1311 def buildChildren(self, child_, nodeName_):1312 if child_.nodeType == Node.TEXT_NODE:1313 obj_ = self.mixedclass_(MixedContainer.CategoryText,1314 MixedContainer.TypeNone, '', child_.nodeValue)1315 self.content_.append(obj_)1316 if child_.nodeType == Node.TEXT_NODE:1317 self.valueOf_ += child_.nodeValue1318 elif child_.nodeType == Node.CDATA_SECTION_NODE:1319 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1320# end class reimplementType1321class incType(GeneratedsSuper):1322 subclass = None1323 superclass = None1324 def __init__(self, local=None, refid=None, valueOf_='', mixedclass_=None, content_=None):1325 self.local = local1326 self.refid = refid1327 if mixedclass_ is None:1328 self.mixedclass_ = MixedContainer1329 else:1330 self.mixedclass_ = mixedclass_1331 if content_ is None:1332 self.content_ = []1333 else:1334 self.content_ = content_1335 def factory(*args_, **kwargs_):1336 if incType.subclass:1337 return incType.subclass(*args_, **kwargs_)1338 else:1339 return incType(*args_, **kwargs_)1340 factory = staticmethod(factory)1341 def get_local(self): return self.local1342 def set_local(self, local): self.local = local1343 def get_refid(self): return self.refid1344 def set_refid(self, refid): self.refid = refid1345 def getValueOf_(self): return self.valueOf_1346 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1347 def export(self, outfile, level, namespace_='', name_='incType', namespacedef_=''):1348 showIndent(outfile, level)1349 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1350 self.exportAttributes(outfile, level, namespace_, name_='incType')1351 outfile.write('>')1352 self.exportChildren(outfile, level + 1, namespace_, name_)1353 outfile.write('</%s%s>\n' % (namespace_, name_))1354 def exportAttributes(self, outfile, level, namespace_='', name_='incType'):1355 if self.local is not None:1356 outfile.write(' local=%s' % (quote_attrib(self.local), ))1357 if self.refid is not None:1358 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1359 def exportChildren(self, outfile, level, namespace_='', name_='incType'):1360 if self.valueOf_.find('![CDATA')>-1:1361 value=quote_xml('%s' % self.valueOf_)1362 value=value.replace('![CDATA','<![CDATA')1363 value=value.replace(']]',']]>')1364 outfile.write(value)1365 else:1366 outfile.write(quote_xml('%s' % self.valueOf_))1367 def hasContent_(self):1368 if (1369 self.valueOf_ is not None1370 ):1371 return True1372 else:1373 return False1374 def exportLiteral(self, outfile, level, name_='incType'):1375 level += 11376 self.exportLiteralAttributes(outfile, level, name_)1377 if self.hasContent_():1378 self.exportLiteralChildren(outfile, level, name_)1379 def exportLiteralAttributes(self, outfile, level, name_):1380 if self.local is not None:1381 showIndent(outfile, level)1382 outfile.write('local = "%s",\n' % (self.local,))1383 if self.refid is not None:1384 showIndent(outfile, level)1385 outfile.write('refid = %s,\n' % (self.refid,))1386 def exportLiteralChildren(self, outfile, level, name_):1387 showIndent(outfile, level)1388 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1389 def build(self, node_):1390 attrs = node_.attributes1391 self.buildAttributes(attrs)1392 self.valueOf_ = ''1393 for child_ in node_.childNodes:1394 nodeName_ = child_.nodeName.split(':')[-1]1395 self.buildChildren(child_, nodeName_)1396 def buildAttributes(self, attrs):1397 if attrs.get('local'):1398 self.local = attrs.get('local').value1399 if attrs.get('refid'):1400 self.refid = attrs.get('refid').value1401 def buildChildren(self, child_, nodeName_):1402 if child_.nodeType == Node.TEXT_NODE:1403 obj_ = self.mixedclass_(MixedContainer.CategoryText,1404 MixedContainer.TypeNone, '', child_.nodeValue)1405 self.content_.append(obj_)1406 if child_.nodeType == Node.TEXT_NODE:1407 self.valueOf_ += child_.nodeValue1408 elif child_.nodeType == Node.CDATA_SECTION_NODE:1409 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1410# end class incType1411class refType(GeneratedsSuper):1412 subclass = None1413 superclass = None1414 def __init__(self, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):1415 self.prot = prot1416 self.refid = refid1417 if mixedclass_ is None:1418 self.mixedclass_ = MixedContainer1419 else:1420 self.mixedclass_ = mixedclass_1421 if content_ is None:1422 self.content_ = []1423 else:1424 self.content_ = content_1425 def factory(*args_, **kwargs_):1426 if refType.subclass:1427 return refType.subclass(*args_, **kwargs_)1428 else:1429 return refType(*args_, **kwargs_)1430 factory = staticmethod(factory)1431 def get_prot(self): return self.prot1432 def set_prot(self, prot): self.prot = prot1433 def get_refid(self): return self.refid1434 def set_refid(self, refid): self.refid = refid1435 def getValueOf_(self): return self.valueOf_1436 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1437 def export(self, outfile, level, namespace_='', name_='refType', namespacedef_=''):1438 showIndent(outfile, level)1439 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1440 self.exportAttributes(outfile, level, namespace_, name_='refType')1441 outfile.write('>')1442 self.exportChildren(outfile, level + 1, namespace_, name_)1443 outfile.write('</%s%s>\n' % (namespace_, name_))1444 def exportAttributes(self, outfile, level, namespace_='', name_='refType'):1445 if self.prot is not None:1446 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))1447 if self.refid is not None:1448 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1449 def exportChildren(self, outfile, level, namespace_='', name_='refType'):1450 if self.valueOf_.find('![CDATA')>-1:1451 value=quote_xml('%s' % self.valueOf_)1452 value=value.replace('![CDATA','<![CDATA')1453 value=value.replace(']]',']]>')1454 outfile.write(value)1455 else:1456 outfile.write(quote_xml('%s' % self.valueOf_))1457 def hasContent_(self):1458 if (1459 self.valueOf_ is not None1460 ):1461 return True1462 else:1463 return False1464 def exportLiteral(self, outfile, level, name_='refType'):1465 level += 11466 self.exportLiteralAttributes(outfile, level, name_)1467 if self.hasContent_():1468 self.exportLiteralChildren(outfile, level, name_)1469 def exportLiteralAttributes(self, outfile, level, name_):1470 if self.prot is not None:1471 showIndent(outfile, level)1472 outfile.write('prot = "%s",\n' % (self.prot,))1473 if self.refid is not None:1474 showIndent(outfile, level)1475 outfile.write('refid = %s,\n' % (self.refid,))1476 def exportLiteralChildren(self, outfile, level, name_):1477 showIndent(outfile, level)1478 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1479 def build(self, node_):1480 attrs = node_.attributes1481 self.buildAttributes(attrs)1482 self.valueOf_ = ''1483 for child_ in node_.childNodes:1484 nodeName_ = child_.nodeName.split(':')[-1]1485 self.buildChildren(child_, nodeName_)1486 def buildAttributes(self, attrs):1487 if attrs.get('prot'):1488 self.prot = attrs.get('prot').value1489 if attrs.get('refid'):1490 self.refid = attrs.get('refid').value1491 def buildChildren(self, child_, nodeName_):1492 if child_.nodeType == Node.TEXT_NODE:1493 obj_ = self.mixedclass_(MixedContainer.CategoryText,1494 MixedContainer.TypeNone, '', child_.nodeValue)1495 self.content_.append(obj_)1496 if child_.nodeType == Node.TEXT_NODE:1497 self.valueOf_ += child_.nodeValue1498 elif child_.nodeType == Node.CDATA_SECTION_NODE:1499 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1500# end class refType1501class refTextType(GeneratedsSuper):1502 subclass = None1503 superclass = None1504 def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):1505 self.refid = refid1506 self.kindref = kindref1507 self.external = external1508 if mixedclass_ is None:1509 self.mixedclass_ = MixedContainer1510 else:1511 self.mixedclass_ = mixedclass_1512 if content_ is None:1513 self.content_ = []1514 else:1515 self.content_ = content_1516 def factory(*args_, **kwargs_):1517 if refTextType.subclass:1518 return refTextType.subclass(*args_, **kwargs_)1519 else:1520 return refTextType(*args_, **kwargs_)1521 factory = staticmethod(factory)1522 def get_refid(self): return self.refid1523 def set_refid(self, refid): self.refid = refid1524 def get_kindref(self): return self.kindref1525 def set_kindref(self, kindref): self.kindref = kindref1526 def get_external(self): return self.external1527 def set_external(self, external): self.external = external1528 def getValueOf_(self): return self.valueOf_1529 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_1530 def export(self, outfile, level, namespace_='', name_='refTextType', namespacedef_=''):1531 showIndent(outfile, level)1532 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1533 self.exportAttributes(outfile, level, namespace_, name_='refTextType')1534 outfile.write('>')1535 self.exportChildren(outfile, level + 1, namespace_, name_)1536 outfile.write('</%s%s>\n' % (namespace_, name_))1537 def exportAttributes(self, outfile, level, namespace_='', name_='refTextType'):1538 if self.refid is not None:1539 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))1540 if self.kindref is not None:1541 outfile.write(' kindref=%s' % (quote_attrib(self.kindref), ))1542 if self.external is not None:1543 outfile.write(' external=%s' % (self.format_string(quote_attrib(self.external).encode(ExternalEncoding), input_name='external'), ))1544 def exportChildren(self, outfile, level, namespace_='', name_='refTextType'):1545 if self.valueOf_.find('![CDATA')>-1:1546 value=quote_xml('%s' % self.valueOf_)1547 value=value.replace('![CDATA','<![CDATA')1548 value=value.replace(']]',']]>')1549 outfile.write(value)1550 else:1551 outfile.write(quote_xml('%s' % self.valueOf_))1552 def hasContent_(self):1553 if (1554 self.valueOf_ is not None1555 ):1556 return True1557 else:1558 return False1559 def exportLiteral(self, outfile, level, name_='refTextType'):1560 level += 11561 self.exportLiteralAttributes(outfile, level, name_)1562 if self.hasContent_():1563 self.exportLiteralChildren(outfile, level, name_)1564 def exportLiteralAttributes(self, outfile, level, name_):1565 if self.refid is not None:1566 showIndent(outfile, level)1567 outfile.write('refid = %s,\n' % (self.refid,))1568 if self.kindref is not None:1569 showIndent(outfile, level)1570 outfile.write('kindref = "%s",\n' % (self.kindref,))1571 if self.external is not None:1572 showIndent(outfile, level)1573 outfile.write('external = %s,\n' % (self.external,))1574 def exportLiteralChildren(self, outfile, level, name_):1575 showIndent(outfile, level)1576 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))1577 def build(self, node_):1578 attrs = node_.attributes1579 self.buildAttributes(attrs)1580 self.valueOf_ = ''1581 for child_ in node_.childNodes:1582 nodeName_ = child_.nodeName.split(':')[-1]1583 self.buildChildren(child_, nodeName_)1584 def buildAttributes(self, attrs):1585 if attrs.get('refid'):1586 self.refid = attrs.get('refid').value1587 if attrs.get('kindref'):1588 self.kindref = attrs.get('kindref').value1589 if attrs.get('external'):1590 self.external = attrs.get('external').value1591 def buildChildren(self, child_, nodeName_):1592 if child_.nodeType == Node.TEXT_NODE:1593 obj_ = self.mixedclass_(MixedContainer.CategoryText,1594 MixedContainer.TypeNone, '', child_.nodeValue)1595 self.content_.append(obj_)1596 if child_.nodeType == Node.TEXT_NODE:1597 self.valueOf_ += child_.nodeValue1598 elif child_.nodeType == Node.CDATA_SECTION_NODE:1599 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'1600# end class refTextType1601class sectiondefType(GeneratedsSuper):1602 subclass = None1603 superclass = None1604 def __init__(self, kind=None, header=None, description=None, memberdef=None):1605 self.kind = kind1606 self.header = header1607 self.description = description1608 if memberdef is None:1609 self.memberdef = []1610 else:1611 self.memberdef = memberdef1612 def factory(*args_, **kwargs_):1613 if sectiondefType.subclass:1614 return sectiondefType.subclass(*args_, **kwargs_)1615 else:1616 return sectiondefType(*args_, **kwargs_)1617 factory = staticmethod(factory)1618 def get_header(self): return self.header1619 def set_header(self, header): self.header = header1620 def get_description(self): return self.description1621 def set_description(self, description): self.description = description1622 def get_memberdef(self): return self.memberdef1623 def set_memberdef(self, memberdef): self.memberdef = memberdef1624 def add_memberdef(self, value): self.memberdef.append(value)1625 def insert_memberdef(self, index, value): self.memberdef[index] = value1626 def get_kind(self): return self.kind1627 def set_kind(self, kind): self.kind = kind1628 def export(self, outfile, level, namespace_='', name_='sectiondefType', namespacedef_=''):1629 showIndent(outfile, level)1630 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1631 self.exportAttributes(outfile, level, namespace_, name_='sectiondefType')1632 if self.hasContent_():1633 outfile.write('>\n')1634 self.exportChildren(outfile, level + 1, namespace_, name_)1635 showIndent(outfile, level)1636 outfile.write('</%s%s>\n' % (namespace_, name_))1637 else:1638 outfile.write(' />\n')1639 def exportAttributes(self, outfile, level, namespace_='', name_='sectiondefType'):1640 if self.kind is not None:1641 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))1642 def exportChildren(self, outfile, level, namespace_='', name_='sectiondefType'):1643 if self.header is not None:1644 showIndent(outfile, level)1645 outfile.write('<%sheader>%s</%sheader>\n' % (namespace_, self.format_string(quote_xml(self.header).encode(ExternalEncoding), input_name='header'), namespace_))1646 if self.description:1647 self.description.export(outfile, level, namespace_, name_='description')1648 for memberdef_ in self.memberdef:1649 memberdef_.export(outfile, level, namespace_, name_='memberdef')1650 def hasContent_(self):1651 if (1652 self.header is not None or1653 self.description is not None or1654 self.memberdef is not None1655 ):1656 return True1657 else:1658 return False1659 def exportLiteral(self, outfile, level, name_='sectiondefType'):1660 level += 11661 self.exportLiteralAttributes(outfile, level, name_)1662 if self.hasContent_():1663 self.exportLiteralChildren(outfile, level, name_)1664 def exportLiteralAttributes(self, outfile, level, name_):1665 if self.kind is not None:1666 showIndent(outfile, level)1667 outfile.write('kind = "%s",\n' % (self.kind,))1668 def exportLiteralChildren(self, outfile, level, name_):1669 showIndent(outfile, level)1670 outfile.write('header=%s,\n' % quote_python(self.header).encode(ExternalEncoding))1671 if self.description:1672 showIndent(outfile, level)1673 outfile.write('description=model_.descriptionType(\n')1674 self.description.exportLiteral(outfile, level, name_='description')1675 showIndent(outfile, level)1676 outfile.write('),\n')1677 showIndent(outfile, level)1678 outfile.write('memberdef=[\n')1679 level += 11680 for memberdef in self.memberdef:1681 showIndent(outfile, level)1682 outfile.write('model_.memberdef(\n')1683 memberdef.exportLiteral(outfile, level, name_='memberdef')1684 showIndent(outfile, level)1685 outfile.write('),\n')1686 level -= 11687 showIndent(outfile, level)1688 outfile.write('],\n')1689 def build(self, node_):1690 attrs = node_.attributes1691 self.buildAttributes(attrs)1692 for child_ in node_.childNodes:1693 nodeName_ = child_.nodeName.split(':')[-1]1694 self.buildChildren(child_, nodeName_)1695 def buildAttributes(self, attrs):1696 if attrs.get('kind'):1697 self.kind = attrs.get('kind').value1698 def buildChildren(self, child_, nodeName_):1699 if child_.nodeType == Node.ELEMENT_NODE and \1700 nodeName_ == 'header':1701 header_ = ''1702 for text__content_ in child_.childNodes:1703 header_ += text__content_.nodeValue1704 self.header = header_1705 elif child_.nodeType == Node.ELEMENT_NODE and \1706 nodeName_ == 'description':1707 obj_ = descriptionType.factory()1708 obj_.build(child_)1709 self.set_description(obj_)1710 elif child_.nodeType == Node.ELEMENT_NODE and \1711 nodeName_ == 'memberdef':1712 obj_ = memberdefType.factory()1713 obj_.build(child_)1714 self.memberdef.append(obj_)1715# end class sectiondefType1716class memberdefType(GeneratedsSuper):1717 subclass = None1718 superclass = None1719 def __init__(self, initonly=None, kind=None, volatile=None, const=None, raisexx=None, virt=None, readable=None, prot=None, explicit=None, new=None, final=None, writable=None, add=None, static=None, remove=None, sealed=None, mutable=None, gettable=None, inline=None, settable=None, id=None, templateparamlist=None, type_=None, definition=None, argsstring=None, name=None, read=None, write=None, bitfield=None, reimplements=None, reimplementedby=None, param=None, enumvalue=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None):1720 self.initonly = initonly1721 self.kind = kind1722 self.volatile = volatile1723 self.const = const1724 self.raisexx = raisexx1725 self.virt = virt1726 self.readable = readable1727 self.prot = prot1728 self.explicit = explicit1729 self.new = new1730 self.final = final1731 self.writable = writable1732 self.add = add1733 self.static = static1734 self.remove = remove1735 self.sealed = sealed1736 self.mutable = mutable1737 self.gettable = gettable1738 self.inline = inline1739 self.settable = settable1740 self.id = id1741 self.templateparamlist = templateparamlist1742 self.type_ = type_1743 self.definition = definition1744 self.argsstring = argsstring1745 self.name = name1746 self.read = read1747 self.write = write1748 self.bitfield = bitfield1749 if reimplements is None:1750 self.reimplements = []1751 else:1752 self.reimplements = reimplements1753 if reimplementedby is None:1754 self.reimplementedby = []1755 else:1756 self.reimplementedby = reimplementedby1757 if param is None:1758 self.param = []1759 else:1760 self.param = param1761 if enumvalue is None:1762 self.enumvalue = []1763 else:1764 self.enumvalue = enumvalue1765 self.initializer = initializer1766 self.exceptions = exceptions1767 self.briefdescription = briefdescription1768 self.detaileddescription = detaileddescription1769 self.inbodydescription = inbodydescription1770 self.location = location1771 if references is None:1772 self.references = []1773 else:1774 self.references = references1775 if referencedby is None:1776 self.referencedby = []1777 else:1778 self.referencedby = referencedby1779 def factory(*args_, **kwargs_):1780 if memberdefType.subclass:1781 return memberdefType.subclass(*args_, **kwargs_)1782 else:1783 return memberdefType(*args_, **kwargs_)1784 factory = staticmethod(factory)1785 def get_templateparamlist(self): return self.templateparamlist1786 def set_templateparamlist(self, templateparamlist): self.templateparamlist = templateparamlist1787 def get_type(self): return self.type_1788 def set_type(self, type_): self.type_ = type_1789 def get_definition(self): return self.definition1790 def set_definition(self, definition): self.definition = definition1791 def get_argsstring(self): return self.argsstring1792 def set_argsstring(self, argsstring): self.argsstring = argsstring1793 def get_name(self): return self.name1794 def set_name(self, name): self.name = name1795 def get_read(self): return self.read1796 def set_read(self, read): self.read = read1797 def get_write(self): return self.write1798 def set_write(self, write): self.write = write1799 def get_bitfield(self): return self.bitfield1800 def set_bitfield(self, bitfield): self.bitfield = bitfield1801 def get_reimplements(self): return self.reimplements1802 def set_reimplements(self, reimplements): self.reimplements = reimplements1803 def add_reimplements(self, value): self.reimplements.append(value)1804 def insert_reimplements(self, index, value): self.reimplements[index] = value1805 def get_reimplementedby(self): return self.reimplementedby1806 def set_reimplementedby(self, reimplementedby): self.reimplementedby = reimplementedby1807 def add_reimplementedby(self, value): self.reimplementedby.append(value)1808 def insert_reimplementedby(self, index, value): self.reimplementedby[index] = value1809 def get_param(self): return self.param1810 def set_param(self, param): self.param = param1811 def add_param(self, value): self.param.append(value)1812 def insert_param(self, index, value): self.param[index] = value1813 def get_enumvalue(self): return self.enumvalue1814 def set_enumvalue(self, enumvalue): self.enumvalue = enumvalue1815 def add_enumvalue(self, value): self.enumvalue.append(value)1816 def insert_enumvalue(self, index, value): self.enumvalue[index] = value1817 def get_initializer(self): return self.initializer1818 def set_initializer(self, initializer): self.initializer = initializer1819 def get_exceptions(self): return self.exceptions1820 def set_exceptions(self, exceptions): self.exceptions = exceptions1821 def get_briefdescription(self): return self.briefdescription1822 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription1823 def get_detaileddescription(self): return self.detaileddescription1824 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription1825 def get_inbodydescription(self): return self.inbodydescription1826 def set_inbodydescription(self, inbodydescription): self.inbodydescription = inbodydescription1827 def get_location(self): return self.location1828 def set_location(self, location): self.location = location1829 def get_references(self): return self.references1830 def set_references(self, references): self.references = references1831 def add_references(self, value): self.references.append(value)1832 def insert_references(self, index, value): self.references[index] = value1833 def get_referencedby(self): return self.referencedby1834 def set_referencedby(self, referencedby): self.referencedby = referencedby1835 def add_referencedby(self, value): self.referencedby.append(value)1836 def insert_referencedby(self, index, value): self.referencedby[index] = value1837 def get_initonly(self): return self.initonly1838 def set_initonly(self, initonly): self.initonly = initonly1839 def get_kind(self): return self.kind1840 def set_kind(self, kind): self.kind = kind1841 def get_volatile(self): return self.volatile1842 def set_volatile(self, volatile): self.volatile = volatile1843 def get_const(self): return self.const1844 def set_const(self, const): self.const = const1845 def get_raise(self): return self.raisexx1846 def set_raise(self, raisexx): self.raisexx = raisexx1847 def get_virt(self): return self.virt1848 def set_virt(self, virt): self.virt = virt1849 def get_readable(self): return self.readable1850 def set_readable(self, readable): self.readable = readable1851 def get_prot(self): return self.prot1852 def set_prot(self, prot): self.prot = prot1853 def get_explicit(self): return self.explicit1854 def set_explicit(self, explicit): self.explicit = explicit1855 def get_new(self): return self.new1856 def set_new(self, new): self.new = new1857 def get_final(self): return self.final1858 def set_final(self, final): self.final = final1859 def get_writable(self): return self.writable1860 def set_writable(self, writable): self.writable = writable1861 def get_add(self): return self.add1862 def set_add(self, add): self.add = add1863 def get_static(self): return self.static1864 def set_static(self, static): self.static = static1865 def get_remove(self): return self.remove1866 def set_remove(self, remove): self.remove = remove1867 def get_sealed(self): return self.sealed1868 def set_sealed(self, sealed): self.sealed = sealed1869 def get_mutable(self): return self.mutable1870 def set_mutable(self, mutable): self.mutable = mutable1871 def get_gettable(self): return self.gettable1872 def set_gettable(self, gettable): self.gettable = gettable1873 def get_inline(self): return self.inline1874 def set_inline(self, inline): self.inline = inline1875 def get_settable(self): return self.settable1876 def set_settable(self, settable): self.settable = settable1877 def get_id(self): return self.id1878 def set_id(self, id): self.id = id1879 def export(self, outfile, level, namespace_='', name_='memberdefType', namespacedef_=''):1880 showIndent(outfile, level)1881 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))1882 self.exportAttributes(outfile, level, namespace_, name_='memberdefType')1883 if self.hasContent_():1884 outfile.write('>\n')1885 self.exportChildren(outfile, level + 1, namespace_, name_)1886 showIndent(outfile, level)1887 outfile.write('</%s%s>\n' % (namespace_, name_))1888 else:1889 outfile.write(' />\n')1890 def exportAttributes(self, outfile, level, namespace_='', name_='memberdefType'):1891 if self.initonly is not None:1892 outfile.write(' initonly=%s' % (quote_attrib(self.initonly), ))1893 if self.kind is not None:1894 outfile.write(' kind=%s' % (quote_attrib(self.kind), ))1895 if self.volatile is not None:1896 outfile.write(' volatile=%s' % (quote_attrib(self.volatile), ))1897 if self.const is not None:1898 outfile.write(' const=%s' % (quote_attrib(self.const), ))1899 if self.raisexx is not None:1900 outfile.write(' raise=%s' % (quote_attrib(self.raisexx), ))1901 if self.virt is not None:1902 outfile.write(' virt=%s' % (quote_attrib(self.virt), ))1903 if self.readable is not None:1904 outfile.write(' readable=%s' % (quote_attrib(self.readable), ))1905 if self.prot is not None:1906 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))1907 if self.explicit is not None:1908 outfile.write(' explicit=%s' % (quote_attrib(self.explicit), ))1909 if self.new is not None:1910 outfile.write(' new=%s' % (quote_attrib(self.new), ))1911 if self.final is not None:1912 outfile.write(' final=%s' % (quote_attrib(self.final), ))1913 if self.writable is not None:1914 outfile.write(' writable=%s' % (quote_attrib(self.writable), ))1915 if self.add is not None:1916 outfile.write(' add=%s' % (quote_attrib(self.add), ))1917 if self.static is not None:1918 outfile.write(' static=%s' % (quote_attrib(self.static), ))1919 if self.remove is not None:1920 outfile.write(' remove=%s' % (quote_attrib(self.remove), ))1921 if self.sealed is not None:1922 outfile.write(' sealed=%s' % (quote_attrib(self.sealed), ))1923 if self.mutable is not None:1924 outfile.write(' mutable=%s' % (quote_attrib(self.mutable), ))1925 if self.gettable is not None:1926 outfile.write(' gettable=%s' % (quote_attrib(self.gettable), ))1927 if self.inline is not None:1928 outfile.write(' inline=%s' % (quote_attrib(self.inline), ))1929 if self.settable is not None:1930 outfile.write(' settable=%s' % (quote_attrib(self.settable), ))1931 if self.id is not None:1932 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))1933 def exportChildren(self, outfile, level, namespace_='', name_='memberdefType'):1934 if self.templateparamlist:1935 self.templateparamlist.export(outfile, level, namespace_, name_='templateparamlist')1936 if self.type_:1937 self.type_.export(outfile, level, namespace_, name_='type')1938 if self.definition is not None:1939 showIndent(outfile, level)1940 outfile.write('<%sdefinition>%s</%sdefinition>\n' % (namespace_, self.format_string(quote_xml(self.definition).encode(ExternalEncoding), input_name='definition'), namespace_))1941 if self.argsstring is not None:1942 showIndent(outfile, level)1943 outfile.write('<%sargsstring>%s</%sargsstring>\n' % (namespace_, self.format_string(quote_xml(self.argsstring).encode(ExternalEncoding), input_name='argsstring'), namespace_))1944 if self.name is not None:1945 showIndent(outfile, level)1946 outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))1947 if self.read is not None:1948 showIndent(outfile, level)1949 outfile.write('<%sread>%s</%sread>\n' % (namespace_, self.format_string(quote_xml(self.read).encode(ExternalEncoding), input_name='read'), namespace_))1950 if self.write is not None:1951 showIndent(outfile, level)1952 outfile.write('<%swrite>%s</%swrite>\n' % (namespace_, self.format_string(quote_xml(self.write).encode(ExternalEncoding), input_name='write'), namespace_))1953 if self.bitfield is not None:1954 showIndent(outfile, level)1955 outfile.write('<%sbitfield>%s</%sbitfield>\n' % (namespace_, self.format_string(quote_xml(self.bitfield).encode(ExternalEncoding), input_name='bitfield'), namespace_))1956 for reimplements_ in self.reimplements:1957 reimplements_.export(outfile, level, namespace_, name_='reimplements')1958 for reimplementedby_ in self.reimplementedby:1959 reimplementedby_.export(outfile, level, namespace_, name_='reimplementedby')1960 for param_ in self.param:1961 param_.export(outfile, level, namespace_, name_='param')1962 for enumvalue_ in self.enumvalue:1963 enumvalue_.export(outfile, level, namespace_, name_='enumvalue')1964 if self.initializer:1965 self.initializer.export(outfile, level, namespace_, name_='initializer')1966 if self.exceptions:1967 self.exceptions.export(outfile, level, namespace_, name_='exceptions')1968 if self.briefdescription:1969 self.briefdescription.export(outfile, level, namespace_, name_='briefdescription')1970 if self.detaileddescription:1971 self.detaileddescription.export(outfile, level, namespace_, name_='detaileddescription')1972 if self.inbodydescription:1973 self.inbodydescription.export(outfile, level, namespace_, name_='inbodydescription')1974 if self.location:1975 self.location.export(outfile, level, namespace_, name_='location', )1976 for references_ in self.references:1977 references_.export(outfile, level, namespace_, name_='references')1978 for referencedby_ in self.referencedby:1979 referencedby_.export(outfile, level, namespace_, name_='referencedby')1980 def hasContent_(self):1981 if (1982 self.templateparamlist is not None or1983 self.type_ is not None or1984 self.definition is not None or1985 self.argsstring is not None or1986 self.name is not None or1987 self.read is not None or1988 self.write is not None or1989 self.bitfield is not None or1990 self.reimplements is not None or1991 self.reimplementedby is not None or1992 self.param is not None or1993 self.enumvalue is not None or1994 self.initializer is not None or1995 self.exceptions is not None or1996 self.briefdescription is not None or1997 self.detaileddescription is not None or1998 self.inbodydescription is not None or1999 self.location is not None or2000 self.references is not None or2001 self.referencedby is not None2002 ):2003 return True2004 else:2005 return False2006 def exportLiteral(self, outfile, level, name_='memberdefType'):2007 level += 12008 self.exportLiteralAttributes(outfile, level, name_)2009 if self.hasContent_():2010 self.exportLiteralChildren(outfile, level, name_)2011 def exportLiteralAttributes(self, outfile, level, name_):2012 if self.initonly is not None:2013 showIndent(outfile, level)2014 outfile.write('initonly = "%s",\n' % (self.initonly,))2015 if self.kind is not None:2016 showIndent(outfile, level)2017 outfile.write('kind = "%s",\n' % (self.kind,))2018 if self.volatile is not None:2019 showIndent(outfile, level)2020 outfile.write('volatile = "%s",\n' % (self.volatile,))2021 if self.const is not None:2022 showIndent(outfile, level)2023 outfile.write('const = "%s",\n' % (self.const,))2024 if self.raisexx is not None:2025 showIndent(outfile, level)2026 outfile.write('raisexx = "%s",\n' % (self.raisexx,))2027 if self.virt is not None:2028 showIndent(outfile, level)2029 outfile.write('virt = "%s",\n' % (self.virt,))2030 if self.readable is not None:2031 showIndent(outfile, level)2032 outfile.write('readable = "%s",\n' % (self.readable,))2033 if self.prot is not None:2034 showIndent(outfile, level)2035 outfile.write('prot = "%s",\n' % (self.prot,))2036 if self.explicit is not None:2037 showIndent(outfile, level)2038 outfile.write('explicit = "%s",\n' % (self.explicit,))2039 if self.new is not None:2040 showIndent(outfile, level)2041 outfile.write('new = "%s",\n' % (self.new,))2042 if self.final is not None:2043 showIndent(outfile, level)2044 outfile.write('final = "%s",\n' % (self.final,))2045 if self.writable is not None:2046 showIndent(outfile, level)2047 outfile.write('writable = "%s",\n' % (self.writable,))2048 if self.add is not None:2049 showIndent(outfile, level)2050 outfile.write('add = "%s",\n' % (self.add,))2051 if self.static is not None:2052 showIndent(outfile, level)2053 outfile.write('static = "%s",\n' % (self.static,))2054 if self.remove is not None:2055 showIndent(outfile, level)2056 outfile.write('remove = "%s",\n' % (self.remove,))2057 if self.sealed is not None:2058 showIndent(outfile, level)2059 outfile.write('sealed = "%s",\n' % (self.sealed,))2060 if self.mutable is not None:2061 showIndent(outfile, level)2062 outfile.write('mutable = "%s",\n' % (self.mutable,))2063 if self.gettable is not None:2064 showIndent(outfile, level)2065 outfile.write('gettable = "%s",\n' % (self.gettable,))2066 if self.inline is not None:2067 showIndent(outfile, level)2068 outfile.write('inline = "%s",\n' % (self.inline,))2069 if self.settable is not None:2070 showIndent(outfile, level)2071 outfile.write('settable = "%s",\n' % (self.settable,))2072 if self.id is not None:2073 showIndent(outfile, level)2074 outfile.write('id = %s,\n' % (self.id,))2075 def exportLiteralChildren(self, outfile, level, name_):2076 if self.templateparamlist:2077 showIndent(outfile, level)2078 outfile.write('templateparamlist=model_.templateparamlistType(\n')2079 self.templateparamlist.exportLiteral(outfile, level, name_='templateparamlist')2080 showIndent(outfile, level)2081 outfile.write('),\n')2082 if self.type_:2083 showIndent(outfile, level)2084 outfile.write('type_=model_.linkedTextType(\n')2085 self.type_.exportLiteral(outfile, level, name_='type')2086 showIndent(outfile, level)2087 outfile.write('),\n')2088 showIndent(outfile, level)2089 outfile.write('definition=%s,\n' % quote_python(self.definition).encode(ExternalEncoding))2090 showIndent(outfile, level)2091 outfile.write('argsstring=%s,\n' % quote_python(self.argsstring).encode(ExternalEncoding))2092 showIndent(outfile, level)2093 outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))2094 showIndent(outfile, level)2095 outfile.write('read=%s,\n' % quote_python(self.read).encode(ExternalEncoding))2096 showIndent(outfile, level)2097 outfile.write('write=%s,\n' % quote_python(self.write).encode(ExternalEncoding))2098 showIndent(outfile, level)2099 outfile.write('bitfield=%s,\n' % quote_python(self.bitfield).encode(ExternalEncoding))2100 showIndent(outfile, level)2101 outfile.write('reimplements=[\n')2102 level += 12103 for reimplements in self.reimplements:2104 showIndent(outfile, level)2105 outfile.write('model_.reimplements(\n')2106 reimplements.exportLiteral(outfile, level, name_='reimplements')2107 showIndent(outfile, level)2108 outfile.write('),\n')2109 level -= 12110 showIndent(outfile, level)2111 outfile.write('],\n')2112 showIndent(outfile, level)2113 outfile.write('reimplementedby=[\n')2114 level += 12115 for reimplementedby in self.reimplementedby:2116 showIndent(outfile, level)2117 outfile.write('model_.reimplementedby(\n')2118 reimplementedby.exportLiteral(outfile, level, name_='reimplementedby')2119 showIndent(outfile, level)2120 outfile.write('),\n')2121 level -= 12122 showIndent(outfile, level)2123 outfile.write('],\n')2124 showIndent(outfile, level)2125 outfile.write('param=[\n')2126 level += 12127 for param in self.param:2128 showIndent(outfile, level)2129 outfile.write('model_.param(\n')2130 param.exportLiteral(outfile, level, name_='param')2131 showIndent(outfile, level)2132 outfile.write('),\n')2133 level -= 12134 showIndent(outfile, level)2135 outfile.write('],\n')2136 showIndent(outfile, level)2137 outfile.write('enumvalue=[\n')2138 level += 12139 for enumvalue in self.enumvalue:2140 showIndent(outfile, level)2141 outfile.write('model_.enumvalue(\n')2142 enumvalue.exportLiteral(outfile, level, name_='enumvalue')2143 showIndent(outfile, level)2144 outfile.write('),\n')2145 level -= 12146 showIndent(outfile, level)2147 outfile.write('],\n')2148 if self.initializer:2149 showIndent(outfile, level)2150 outfile.write('initializer=model_.linkedTextType(\n')2151 self.initializer.exportLiteral(outfile, level, name_='initializer')2152 showIndent(outfile, level)2153 outfile.write('),\n')2154 if self.exceptions:2155 showIndent(outfile, level)2156 outfile.write('exceptions=model_.linkedTextType(\n')2157 self.exceptions.exportLiteral(outfile, level, name_='exceptions')2158 showIndent(outfile, level)2159 outfile.write('),\n')2160 if self.briefdescription:2161 showIndent(outfile, level)2162 outfile.write('briefdescription=model_.descriptionType(\n')2163 self.briefdescription.exportLiteral(outfile, level, name_='briefdescription')2164 showIndent(outfile, level)2165 outfile.write('),\n')2166 if self.detaileddescription:2167 showIndent(outfile, level)2168 outfile.write('detaileddescription=model_.descriptionType(\n')2169 self.detaileddescription.exportLiteral(outfile, level, name_='detaileddescription')2170 showIndent(outfile, level)2171 outfile.write('),\n')2172 if self.inbodydescription:2173 showIndent(outfile, level)2174 outfile.write('inbodydescription=model_.descriptionType(\n')2175 self.inbodydescription.exportLiteral(outfile, level, name_='inbodydescription')2176 showIndent(outfile, level)2177 outfile.write('),\n')2178 if self.location:2179 showIndent(outfile, level)2180 outfile.write('location=model_.locationType(\n')2181 self.location.exportLiteral(outfile, level, name_='location')2182 showIndent(outfile, level)2183 outfile.write('),\n')2184 showIndent(outfile, level)2185 outfile.write('references=[\n')2186 level += 12187 for references in self.references:2188 showIndent(outfile, level)2189 outfile.write('model_.references(\n')2190 references.exportLiteral(outfile, level, name_='references')2191 showIndent(outfile, level)2192 outfile.write('),\n')2193 level -= 12194 showIndent(outfile, level)2195 outfile.write('],\n')2196 showIndent(outfile, level)2197 outfile.write('referencedby=[\n')2198 level += 12199 for referencedby in self.referencedby:2200 showIndent(outfile, level)2201 outfile.write('model_.referencedby(\n')2202 referencedby.exportLiteral(outfile, level, name_='referencedby')2203 showIndent(outfile, level)2204 outfile.write('),\n')2205 level -= 12206 showIndent(outfile, level)2207 outfile.write('],\n')2208 def build(self, node_):2209 attrs = node_.attributes2210 self.buildAttributes(attrs)2211 for child_ in node_.childNodes:2212 nodeName_ = child_.nodeName.split(':')[-1]2213 self.buildChildren(child_, nodeName_)2214 def buildAttributes(self, attrs):2215 if attrs.get('initonly'):2216 self.initonly = attrs.get('initonly').value2217 if attrs.get('kind'):2218 self.kind = attrs.get('kind').value2219 if attrs.get('volatile'):2220 self.volatile = attrs.get('volatile').value2221 if attrs.get('const'):2222 self.const = attrs.get('const').value2223 if attrs.get('raise'):2224 self.raisexx = attrs.get('raise').value2225 if attrs.get('virt'):2226 self.virt = attrs.get('virt').value2227 if attrs.get('readable'):2228 self.readable = attrs.get('readable').value2229 if attrs.get('prot'):2230 self.prot = attrs.get('prot').value2231 if attrs.get('explicit'):2232 self.explicit = attrs.get('explicit').value2233 if attrs.get('new'):2234 self.new = attrs.get('new').value2235 if attrs.get('final'):2236 self.final = attrs.get('final').value2237 if attrs.get('writable'):2238 self.writable = attrs.get('writable').value2239 if attrs.get('add'):2240 self.add = attrs.get('add').value2241 if attrs.get('static'):2242 self.static = attrs.get('static').value2243 if attrs.get('remove'):2244 self.remove = attrs.get('remove').value2245 if attrs.get('sealed'):2246 self.sealed = attrs.get('sealed').value2247 if attrs.get('mutable'):2248 self.mutable = attrs.get('mutable').value2249 if attrs.get('gettable'):2250 self.gettable = attrs.get('gettable').value2251 if attrs.get('inline'):2252 self.inline = attrs.get('inline').value2253 if attrs.get('settable'):2254 self.settable = attrs.get('settable').value2255 if attrs.get('id'):2256 self.id = attrs.get('id').value2257 def buildChildren(self, child_, nodeName_):2258 if child_.nodeType == Node.ELEMENT_NODE and \2259 nodeName_ == 'templateparamlist':2260 obj_ = templateparamlistType.factory()2261 obj_.build(child_)2262 self.set_templateparamlist(obj_)2263 elif child_.nodeType == Node.ELEMENT_NODE and \2264 nodeName_ == 'type':2265 obj_ = linkedTextType.factory()2266 obj_.build(child_)2267 self.set_type(obj_)2268 elif child_.nodeType == Node.ELEMENT_NODE and \2269 nodeName_ == 'definition':2270 definition_ = ''2271 for text__content_ in child_.childNodes:2272 definition_ += text__content_.nodeValue2273 self.definition = definition_2274 elif child_.nodeType == Node.ELEMENT_NODE and \2275 nodeName_ == 'argsstring':2276 argsstring_ = ''2277 for text__content_ in child_.childNodes:2278 argsstring_ += text__content_.nodeValue2279 self.argsstring = argsstring_2280 elif child_.nodeType == Node.ELEMENT_NODE and \2281 nodeName_ == 'name':2282 name_ = ''2283 for text__content_ in child_.childNodes:2284 name_ += text__content_.nodeValue2285 self.name = name_2286 elif child_.nodeType == Node.ELEMENT_NODE and \2287 nodeName_ == 'read':2288 read_ = ''2289 for text__content_ in child_.childNodes:2290 read_ += text__content_.nodeValue2291 self.read = read_2292 elif child_.nodeType == Node.ELEMENT_NODE and \2293 nodeName_ == 'write':2294 write_ = ''2295 for text__content_ in child_.childNodes:2296 write_ += text__content_.nodeValue2297 self.write = write_2298 elif child_.nodeType == Node.ELEMENT_NODE and \2299 nodeName_ == 'bitfield':2300 bitfield_ = ''2301 for text__content_ in child_.childNodes:2302 bitfield_ += text__content_.nodeValue2303 self.bitfield = bitfield_2304 elif child_.nodeType == Node.ELEMENT_NODE and \2305 nodeName_ == 'reimplements':2306 obj_ = reimplementType.factory()2307 obj_.build(child_)2308 self.reimplements.append(obj_)2309 elif child_.nodeType == Node.ELEMENT_NODE and \2310 nodeName_ == 'reimplementedby':2311 obj_ = reimplementType.factory()2312 obj_.build(child_)2313 self.reimplementedby.append(obj_)2314 elif child_.nodeType == Node.ELEMENT_NODE and \2315 nodeName_ == 'param':2316 obj_ = paramType.factory()2317 obj_.build(child_)2318 self.param.append(obj_)2319 elif child_.nodeType == Node.ELEMENT_NODE and \2320 nodeName_ == 'enumvalue':2321 obj_ = enumvalueType.factory()2322 obj_.build(child_)2323 self.enumvalue.append(obj_)2324 elif child_.nodeType == Node.ELEMENT_NODE and \2325 nodeName_ == 'initializer':2326 obj_ = linkedTextType.factory()2327 obj_.build(child_)2328 self.set_initializer(obj_)2329 elif child_.nodeType == Node.ELEMENT_NODE and \2330 nodeName_ == 'exceptions':2331 obj_ = linkedTextType.factory()2332 obj_.build(child_)2333 self.set_exceptions(obj_)2334 elif child_.nodeType == Node.ELEMENT_NODE and \2335 nodeName_ == 'briefdescription':2336 obj_ = descriptionType.factory()2337 obj_.build(child_)2338 self.set_briefdescription(obj_)2339 elif child_.nodeType == Node.ELEMENT_NODE and \2340 nodeName_ == 'detaileddescription':2341 obj_ = descriptionType.factory()2342 obj_.build(child_)2343 self.set_detaileddescription(obj_)2344 elif child_.nodeType == Node.ELEMENT_NODE and \2345 nodeName_ == 'inbodydescription':2346 obj_ = descriptionType.factory()2347 obj_.build(child_)2348 self.set_inbodydescription(obj_)2349 elif child_.nodeType == Node.ELEMENT_NODE and \2350 nodeName_ == 'location':2351 obj_ = locationType.factory()2352 obj_.build(child_)2353 self.set_location(obj_)2354 elif child_.nodeType == Node.ELEMENT_NODE and \2355 nodeName_ == 'references':2356 obj_ = referenceType.factory()2357 obj_.build(child_)2358 self.references.append(obj_)2359 elif child_.nodeType == Node.ELEMENT_NODE and \2360 nodeName_ == 'referencedby':2361 obj_ = referenceType.factory()2362 obj_.build(child_)2363 self.referencedby.append(obj_)2364# end class memberdefType2365class definition(GeneratedsSuper):2366 subclass = None2367 superclass = None2368 def __init__(self, valueOf_=''):2369 self.valueOf_ = valueOf_2370 def factory(*args_, **kwargs_):2371 if definition.subclass:2372 return definition.subclass(*args_, **kwargs_)2373 else:2374 return definition(*args_, **kwargs_)2375 factory = staticmethod(factory)2376 def getValueOf_(self): return self.valueOf_2377 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2378 def export(self, outfile, level, namespace_='', name_='definition', namespacedef_=''):2379 showIndent(outfile, level)2380 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2381 self.exportAttributes(outfile, level, namespace_, name_='definition')2382 if self.hasContent_():2383 outfile.write('>\n')2384 self.exportChildren(outfile, level + 1, namespace_, name_)2385 showIndent(outfile, level)2386 outfile.write('</%s%s>\n' % (namespace_, name_))2387 else:2388 outfile.write(' />\n')2389 def exportAttributes(self, outfile, level, namespace_='', name_='definition'):2390 pass2391 def exportChildren(self, outfile, level, namespace_='', name_='definition'):2392 if self.valueOf_.find('![CDATA')>-1:2393 value=quote_xml('%s' % self.valueOf_)2394 value=value.replace('![CDATA','<![CDATA')2395 value=value.replace(']]',']]>')2396 outfile.write(value)2397 else:2398 outfile.write(quote_xml('%s' % self.valueOf_))2399 def hasContent_(self):2400 if (2401 self.valueOf_ is not None2402 ):2403 return True2404 else:2405 return False2406 def exportLiteral(self, outfile, level, name_='definition'):2407 level += 12408 self.exportLiteralAttributes(outfile, level, name_)2409 if self.hasContent_():2410 self.exportLiteralChildren(outfile, level, name_)2411 def exportLiteralAttributes(self, outfile, level, name_):2412 pass2413 def exportLiteralChildren(self, outfile, level, name_):2414 showIndent(outfile, level)2415 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2416 def build(self, node_):2417 attrs = node_.attributes2418 self.buildAttributes(attrs)2419 self.valueOf_ = ''2420 for child_ in node_.childNodes:2421 nodeName_ = child_.nodeName.split(':')[-1]2422 self.buildChildren(child_, nodeName_)2423 def buildAttributes(self, attrs):2424 pass2425 def buildChildren(self, child_, nodeName_):2426 if child_.nodeType == Node.TEXT_NODE:2427 self.valueOf_ += child_.nodeValue2428 elif child_.nodeType == Node.CDATA_SECTION_NODE:2429 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2430# end class definition2431class argsstring(GeneratedsSuper):2432 subclass = None2433 superclass = None2434 def __init__(self, valueOf_=''):2435 self.valueOf_ = valueOf_2436 def factory(*args_, **kwargs_):2437 if argsstring.subclass:2438 return argsstring.subclass(*args_, **kwargs_)2439 else:2440 return argsstring(*args_, **kwargs_)2441 factory = staticmethod(factory)2442 def getValueOf_(self): return self.valueOf_2443 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2444 def export(self, outfile, level, namespace_='', name_='argsstring', namespacedef_=''):2445 showIndent(outfile, level)2446 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2447 self.exportAttributes(outfile, level, namespace_, name_='argsstring')2448 if self.hasContent_():2449 outfile.write('>\n')2450 self.exportChildren(outfile, level + 1, namespace_, name_)2451 showIndent(outfile, level)2452 outfile.write('</%s%s>\n' % (namespace_, name_))2453 else:2454 outfile.write(' />\n')2455 def exportAttributes(self, outfile, level, namespace_='', name_='argsstring'):2456 pass2457 def exportChildren(self, outfile, level, namespace_='', name_='argsstring'):2458 if self.valueOf_.find('![CDATA')>-1:2459 value=quote_xml('%s' % self.valueOf_)2460 value=value.replace('![CDATA','<![CDATA')2461 value=value.replace(']]',']]>')2462 outfile.write(value)2463 else:2464 outfile.write(quote_xml('%s' % self.valueOf_))2465 def hasContent_(self):2466 if (2467 self.valueOf_ is not None2468 ):2469 return True2470 else:2471 return False2472 def exportLiteral(self, outfile, level, name_='argsstring'):2473 level += 12474 self.exportLiteralAttributes(outfile, level, name_)2475 if self.hasContent_():2476 self.exportLiteralChildren(outfile, level, name_)2477 def exportLiteralAttributes(self, outfile, level, name_):2478 pass2479 def exportLiteralChildren(self, outfile, level, name_):2480 showIndent(outfile, level)2481 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2482 def build(self, node_):2483 attrs = node_.attributes2484 self.buildAttributes(attrs)2485 self.valueOf_ = ''2486 for child_ in node_.childNodes:2487 nodeName_ = child_.nodeName.split(':')[-1]2488 self.buildChildren(child_, nodeName_)2489 def buildAttributes(self, attrs):2490 pass2491 def buildChildren(self, child_, nodeName_):2492 if child_.nodeType == Node.TEXT_NODE:2493 self.valueOf_ += child_.nodeValue2494 elif child_.nodeType == Node.CDATA_SECTION_NODE:2495 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2496# end class argsstring2497class read(GeneratedsSuper):2498 subclass = None2499 superclass = None2500 def __init__(self, valueOf_=''):2501 self.valueOf_ = valueOf_2502 def factory(*args_, **kwargs_):2503 if read.subclass:2504 return read.subclass(*args_, **kwargs_)2505 else:2506 return read(*args_, **kwargs_)2507 factory = staticmethod(factory)2508 def getValueOf_(self): return self.valueOf_2509 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2510 def export(self, outfile, level, namespace_='', name_='read', namespacedef_=''):2511 showIndent(outfile, level)2512 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2513 self.exportAttributes(outfile, level, namespace_, name_='read')2514 if self.hasContent_():2515 outfile.write('>\n')2516 self.exportChildren(outfile, level + 1, namespace_, name_)2517 showIndent(outfile, level)2518 outfile.write('</%s%s>\n' % (namespace_, name_))2519 else:2520 outfile.write(' />\n')2521 def exportAttributes(self, outfile, level, namespace_='', name_='read'):2522 pass2523 def exportChildren(self, outfile, level, namespace_='', name_='read'):2524 if self.valueOf_.find('![CDATA')>-1:2525 value=quote_xml('%s' % self.valueOf_)2526 value=value.replace('![CDATA','<![CDATA')2527 value=value.replace(']]',']]>')2528 outfile.write(value)2529 else:2530 outfile.write(quote_xml('%s' % self.valueOf_))2531 def hasContent_(self):2532 if (2533 self.valueOf_ is not None2534 ):2535 return True2536 else:2537 return False2538 def exportLiteral(self, outfile, level, name_='read'):2539 level += 12540 self.exportLiteralAttributes(outfile, level, name_)2541 if self.hasContent_():2542 self.exportLiteralChildren(outfile, level, name_)2543 def exportLiteralAttributes(self, outfile, level, name_):2544 pass2545 def exportLiteralChildren(self, outfile, level, name_):2546 showIndent(outfile, level)2547 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2548 def build(self, node_):2549 attrs = node_.attributes2550 self.buildAttributes(attrs)2551 self.valueOf_ = ''2552 for child_ in node_.childNodes:2553 nodeName_ = child_.nodeName.split(':')[-1]2554 self.buildChildren(child_, nodeName_)2555 def buildAttributes(self, attrs):2556 pass2557 def buildChildren(self, child_, nodeName_):2558 if child_.nodeType == Node.TEXT_NODE:2559 self.valueOf_ += child_.nodeValue2560 elif child_.nodeType == Node.CDATA_SECTION_NODE:2561 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2562# end class read2563class write(GeneratedsSuper):2564 subclass = None2565 superclass = None2566 def __init__(self, valueOf_=''):2567 self.valueOf_ = valueOf_2568 def factory(*args_, **kwargs_):2569 if write.subclass:2570 return write.subclass(*args_, **kwargs_)2571 else:2572 return write(*args_, **kwargs_)2573 factory = staticmethod(factory)2574 def getValueOf_(self): return self.valueOf_2575 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2576 def export(self, outfile, level, namespace_='', name_='write', namespacedef_=''):2577 showIndent(outfile, level)2578 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2579 self.exportAttributes(outfile, level, namespace_, name_='write')2580 if self.hasContent_():2581 outfile.write('>\n')2582 self.exportChildren(outfile, level + 1, namespace_, name_)2583 showIndent(outfile, level)2584 outfile.write('</%s%s>\n' % (namespace_, name_))2585 else:2586 outfile.write(' />\n')2587 def exportAttributes(self, outfile, level, namespace_='', name_='write'):2588 pass2589 def exportChildren(self, outfile, level, namespace_='', name_='write'):2590 if self.valueOf_.find('![CDATA')>-1:2591 value=quote_xml('%s' % self.valueOf_)2592 value=value.replace('![CDATA','<![CDATA')2593 value=value.replace(']]',']]>')2594 outfile.write(value)2595 else:2596 outfile.write(quote_xml('%s' % self.valueOf_))2597 def hasContent_(self):2598 if (2599 self.valueOf_ is not None2600 ):2601 return True2602 else:2603 return False2604 def exportLiteral(self, outfile, level, name_='write'):2605 level += 12606 self.exportLiteralAttributes(outfile, level, name_)2607 if self.hasContent_():2608 self.exportLiteralChildren(outfile, level, name_)2609 def exportLiteralAttributes(self, outfile, level, name_):2610 pass2611 def exportLiteralChildren(self, outfile, level, name_):2612 showIndent(outfile, level)2613 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2614 def build(self, node_):2615 attrs = node_.attributes2616 self.buildAttributes(attrs)2617 self.valueOf_ = ''2618 for child_ in node_.childNodes:2619 nodeName_ = child_.nodeName.split(':')[-1]2620 self.buildChildren(child_, nodeName_)2621 def buildAttributes(self, attrs):2622 pass2623 def buildChildren(self, child_, nodeName_):2624 if child_.nodeType == Node.TEXT_NODE:2625 self.valueOf_ += child_.nodeValue2626 elif child_.nodeType == Node.CDATA_SECTION_NODE:2627 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2628# end class write2629class bitfield(GeneratedsSuper):2630 subclass = None2631 superclass = None2632 def __init__(self, valueOf_=''):2633 self.valueOf_ = valueOf_2634 def factory(*args_, **kwargs_):2635 if bitfield.subclass:2636 return bitfield.subclass(*args_, **kwargs_)2637 else:2638 return bitfield(*args_, **kwargs_)2639 factory = staticmethod(factory)2640 def getValueOf_(self): return self.valueOf_2641 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_2642 def export(self, outfile, level, namespace_='', name_='bitfield', namespacedef_=''):2643 showIndent(outfile, level)2644 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2645 self.exportAttributes(outfile, level, namespace_, name_='bitfield')2646 if self.hasContent_():2647 outfile.write('>\n')2648 self.exportChildren(outfile, level + 1, namespace_, name_)2649 showIndent(outfile, level)2650 outfile.write('</%s%s>\n' % (namespace_, name_))2651 else:2652 outfile.write(' />\n')2653 def exportAttributes(self, outfile, level, namespace_='', name_='bitfield'):2654 pass2655 def exportChildren(self, outfile, level, namespace_='', name_='bitfield'):2656 if self.valueOf_.find('![CDATA')>-1:2657 value=quote_xml('%s' % self.valueOf_)2658 value=value.replace('![CDATA','<![CDATA')2659 value=value.replace(']]',']]>')2660 outfile.write(value)2661 else:2662 outfile.write(quote_xml('%s' % self.valueOf_))2663 def hasContent_(self):2664 if (2665 self.valueOf_ is not None2666 ):2667 return True2668 else:2669 return False2670 def exportLiteral(self, outfile, level, name_='bitfield'):2671 level += 12672 self.exportLiteralAttributes(outfile, level, name_)2673 if self.hasContent_():2674 self.exportLiteralChildren(outfile, level, name_)2675 def exportLiteralAttributes(self, outfile, level, name_):2676 pass2677 def exportLiteralChildren(self, outfile, level, name_):2678 showIndent(outfile, level)2679 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))2680 def build(self, node_):2681 attrs = node_.attributes2682 self.buildAttributes(attrs)2683 self.valueOf_ = ''2684 for child_ in node_.childNodes:2685 nodeName_ = child_.nodeName.split(':')[-1]2686 self.buildChildren(child_, nodeName_)2687 def buildAttributes(self, attrs):2688 pass2689 def buildChildren(self, child_, nodeName_):2690 if child_.nodeType == Node.TEXT_NODE:2691 self.valueOf_ += child_.nodeValue2692 elif child_.nodeType == Node.CDATA_SECTION_NODE:2693 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'2694# end class bitfield2695class descriptionType(GeneratedsSuper):2696 subclass = None2697 superclass = None2698 def __init__(self, title=None, para=None, sect1=None, internal=None, mixedclass_=None, content_=None):2699 if mixedclass_ is None:2700 self.mixedclass_ = MixedContainer2701 else:2702 self.mixedclass_ = mixedclass_2703 if content_ is None:2704 self.content_ = []2705 else:2706 self.content_ = content_2707 def factory(*args_, **kwargs_):2708 if descriptionType.subclass:2709 return descriptionType.subclass(*args_, **kwargs_)2710 else:2711 return descriptionType(*args_, **kwargs_)2712 factory = staticmethod(factory)2713 def get_title(self): return self.title2714 def set_title(self, title): self.title = title2715 def get_para(self): return self.para2716 def set_para(self, para): self.para = para2717 def add_para(self, value): self.para.append(value)2718 def insert_para(self, index, value): self.para[index] = value2719 def get_sect1(self): return self.sect12720 def set_sect1(self, sect1): self.sect1 = sect12721 def add_sect1(self, value): self.sect1.append(value)2722 def insert_sect1(self, index, value): self.sect1[index] = value2723 def get_internal(self): return self.internal2724 def set_internal(self, internal): self.internal = internal2725 def export(self, outfile, level, namespace_='', name_='descriptionType', namespacedef_=''):2726 showIndent(outfile, level)2727 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2728 self.exportAttributes(outfile, level, namespace_, name_='descriptionType')2729 outfile.write('>')2730 self.exportChildren(outfile, level + 1, namespace_, name_)2731 outfile.write('</%s%s>\n' % (namespace_, name_))2732 def exportAttributes(self, outfile, level, namespace_='', name_='descriptionType'):2733 pass2734 def exportChildren(self, outfile, level, namespace_='', name_='descriptionType'):2735 for item_ in self.content_:2736 item_.export(outfile, level, item_.name, namespace_)2737 def hasContent_(self):2738 if (2739 self.title is not None or2740 self.para is not None or2741 self.sect1 is not None or2742 self.internal is not None2743 ):2744 return True2745 else:2746 return False2747 def exportLiteral(self, outfile, level, name_='descriptionType'):2748 level += 12749 self.exportLiteralAttributes(outfile, level, name_)2750 if self.hasContent_():2751 self.exportLiteralChildren(outfile, level, name_)2752 def exportLiteralAttributes(self, outfile, level, name_):2753 pass2754 def exportLiteralChildren(self, outfile, level, name_):2755 showIndent(outfile, level)2756 outfile.write('content_ = [\n')2757 for item_ in self.content_:2758 item_.exportLiteral(outfile, level, name_)2759 showIndent(outfile, level)2760 outfile.write('],\n')2761 showIndent(outfile, level)2762 outfile.write('content_ = [\n')2763 for item_ in self.content_:2764 item_.exportLiteral(outfile, level, name_)2765 showIndent(outfile, level)2766 outfile.write('],\n')2767 showIndent(outfile, level)2768 outfile.write('content_ = [\n')2769 for item_ in self.content_:2770 item_.exportLiteral(outfile, level, name_)2771 showIndent(outfile, level)2772 outfile.write('],\n')2773 showIndent(outfile, level)2774 outfile.write('content_ = [\n')2775 for item_ in self.content_:2776 item_.exportLiteral(outfile, level, name_)2777 showIndent(outfile, level)2778 outfile.write('],\n')2779 def build(self, node_):2780 attrs = node_.attributes2781 self.buildAttributes(attrs)2782 for child_ in node_.childNodes:2783 nodeName_ = child_.nodeName.split(':')[-1]2784 self.buildChildren(child_, nodeName_)2785 def buildAttributes(self, attrs):2786 pass2787 def buildChildren(self, child_, nodeName_):2788 if child_.nodeType == Node.ELEMENT_NODE and \2789 nodeName_ == 'title':2790 childobj_ = docTitleType.factory()2791 childobj_.build(child_)2792 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2793 MixedContainer.TypeNone, 'title', childobj_)2794 self.content_.append(obj_)2795 elif child_.nodeType == Node.ELEMENT_NODE and \2796 nodeName_ == 'para':2797 childobj_ = docParaType.factory()2798 childobj_.build(child_)2799 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2800 MixedContainer.TypeNone, 'para', childobj_)2801 self.content_.append(obj_)2802 elif child_.nodeType == Node.ELEMENT_NODE and \2803 nodeName_ == 'sect1':2804 childobj_ = docSect1Type.factory()2805 childobj_.build(child_)2806 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2807 MixedContainer.TypeNone, 'sect1', childobj_)2808 self.content_.append(obj_)2809 elif child_.nodeType == Node.ELEMENT_NODE and \2810 nodeName_ == 'internal':2811 childobj_ = docInternalType.factory()2812 childobj_.build(child_)2813 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2814 MixedContainer.TypeNone, 'internal', childobj_)2815 self.content_.append(obj_)2816 elif child_.nodeType == Node.TEXT_NODE:2817 obj_ = self.mixedclass_(MixedContainer.CategoryText,2818 MixedContainer.TypeNone, '', child_.nodeValue)2819 self.content_.append(obj_)2820# end class descriptionType2821class enumvalueType(GeneratedsSuper):2822 subclass = None2823 superclass = None2824 def __init__(self, prot=None, id=None, name=None, initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None):2825 self.prot = prot2826 self.id = id2827 if mixedclass_ is None:2828 self.mixedclass_ = MixedContainer2829 else:2830 self.mixedclass_ = mixedclass_2831 if content_ is None:2832 self.content_ = []2833 else:2834 self.content_ = content_2835 def factory(*args_, **kwargs_):2836 if enumvalueType.subclass:2837 return enumvalueType.subclass(*args_, **kwargs_)2838 else:2839 return enumvalueType(*args_, **kwargs_)2840 factory = staticmethod(factory)2841 def get_name(self): return self.name2842 def set_name(self, name): self.name = name2843 def get_initializer(self): return self.initializer2844 def set_initializer(self, initializer): self.initializer = initializer2845 def get_briefdescription(self): return self.briefdescription2846 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription2847 def get_detaileddescription(self): return self.detaileddescription2848 def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription2849 def get_prot(self): return self.prot2850 def set_prot(self, prot): self.prot = prot2851 def get_id(self): return self.id2852 def set_id(self, id): self.id = id2853 def export(self, outfile, level, namespace_='', name_='enumvalueType', namespacedef_=''):2854 showIndent(outfile, level)2855 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2856 self.exportAttributes(outfile, level, namespace_, name_='enumvalueType')2857 outfile.write('>')2858 self.exportChildren(outfile, level + 1, namespace_, name_)2859 outfile.write('</%s%s>\n' % (namespace_, name_))2860 def exportAttributes(self, outfile, level, namespace_='', name_='enumvalueType'):2861 if self.prot is not None:2862 outfile.write(' prot=%s' % (quote_attrib(self.prot), ))2863 if self.id is not None:2864 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))2865 def exportChildren(self, outfile, level, namespace_='', name_='enumvalueType'):2866 for item_ in self.content_:2867 item_.export(outfile, level, item_.name, namespace_)2868 def hasContent_(self):2869 if (2870 self.name is not None or2871 self.initializer is not None or2872 self.briefdescription is not None or2873 self.detaileddescription is not None2874 ):2875 return True2876 else:2877 return False2878 def exportLiteral(self, outfile, level, name_='enumvalueType'):2879 level += 12880 self.exportLiteralAttributes(outfile, level, name_)2881 if self.hasContent_():2882 self.exportLiteralChildren(outfile, level, name_)2883 def exportLiteralAttributes(self, outfile, level, name_):2884 if self.prot is not None:2885 showIndent(outfile, level)2886 outfile.write('prot = "%s",\n' % (self.prot,))2887 if self.id is not None:2888 showIndent(outfile, level)2889 outfile.write('id = %s,\n' % (self.id,))2890 def exportLiteralChildren(self, outfile, level, name_):2891 showIndent(outfile, level)2892 outfile.write('content_ = [\n')2893 for item_ in self.content_:2894 item_.exportLiteral(outfile, level, name_)2895 showIndent(outfile, level)2896 outfile.write('],\n')2897 showIndent(outfile, level)2898 outfile.write('content_ = [\n')2899 for item_ in self.content_:2900 item_.exportLiteral(outfile, level, name_)2901 showIndent(outfile, level)2902 outfile.write('],\n')2903 showIndent(outfile, level)2904 outfile.write('content_ = [\n')2905 for item_ in self.content_:2906 item_.exportLiteral(outfile, level, name_)2907 showIndent(outfile, level)2908 outfile.write('],\n')2909 showIndent(outfile, level)2910 outfile.write('content_ = [\n')2911 for item_ in self.content_:2912 item_.exportLiteral(outfile, level, name_)2913 showIndent(outfile, level)2914 outfile.write('],\n')2915 def build(self, node_):2916 attrs = node_.attributes2917 self.buildAttributes(attrs)2918 for child_ in node_.childNodes:2919 nodeName_ = child_.nodeName.split(':')[-1]2920 self.buildChildren(child_, nodeName_)2921 def buildAttributes(self, attrs):2922 if attrs.get('prot'):2923 self.prot = attrs.get('prot').value2924 if attrs.get('id'):2925 self.id = attrs.get('id').value2926 def buildChildren(self, child_, nodeName_):2927 if child_.nodeType == Node.ELEMENT_NODE and \2928 nodeName_ == 'name':2929 value_ = []2930 for text_ in child_.childNodes:2931 value_.append(text_.nodeValue)2932 valuestr_ = ''.join(value_)2933 obj_ = self.mixedclass_(MixedContainer.CategorySimple,2934 MixedContainer.TypeString, 'name', valuestr_)2935 self.content_.append(obj_)2936 elif child_.nodeType == Node.ELEMENT_NODE and \2937 nodeName_ == 'initializer':2938 childobj_ = linkedTextType.factory()2939 childobj_.build(child_)2940 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2941 MixedContainer.TypeNone, 'initializer', childobj_)2942 self.content_.append(obj_)2943 elif child_.nodeType == Node.ELEMENT_NODE and \2944 nodeName_ == 'briefdescription':2945 childobj_ = descriptionType.factory()2946 childobj_.build(child_)2947 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2948 MixedContainer.TypeNone, 'briefdescription', childobj_)2949 self.content_.append(obj_)2950 elif child_.nodeType == Node.ELEMENT_NODE and \2951 nodeName_ == 'detaileddescription':2952 childobj_ = descriptionType.factory()2953 childobj_.build(child_)2954 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,2955 MixedContainer.TypeNone, 'detaileddescription', childobj_)2956 self.content_.append(obj_)2957 elif child_.nodeType == Node.TEXT_NODE:2958 obj_ = self.mixedclass_(MixedContainer.CategoryText,2959 MixedContainer.TypeNone, '', child_.nodeValue)2960 self.content_.append(obj_)2961# end class enumvalueType2962class templateparamlistType(GeneratedsSuper):2963 subclass = None2964 superclass = None2965 def __init__(self, param=None):2966 if param is None:2967 self.param = []2968 else:2969 self.param = param2970 def factory(*args_, **kwargs_):2971 if templateparamlistType.subclass:2972 return templateparamlistType.subclass(*args_, **kwargs_)2973 else:2974 return templateparamlistType(*args_, **kwargs_)2975 factory = staticmethod(factory)2976 def get_param(self): return self.param2977 def set_param(self, param): self.param = param2978 def add_param(self, value): self.param.append(value)2979 def insert_param(self, index, value): self.param[index] = value2980 def export(self, outfile, level, namespace_='', name_='templateparamlistType', namespacedef_=''):2981 showIndent(outfile, level)2982 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))2983 self.exportAttributes(outfile, level, namespace_, name_='templateparamlistType')2984 if self.hasContent_():2985 outfile.write('>\n')2986 self.exportChildren(outfile, level + 1, namespace_, name_)2987 showIndent(outfile, level)2988 outfile.write('</%s%s>\n' % (namespace_, name_))2989 else:2990 outfile.write(' />\n')2991 def exportAttributes(self, outfile, level, namespace_='', name_='templateparamlistType'):2992 pass2993 def exportChildren(self, outfile, level, namespace_='', name_='templateparamlistType'):2994 for param_ in self.param:2995 param_.export(outfile, level, namespace_, name_='param')2996 def hasContent_(self):2997 if (2998 self.param is not None2999 ):3000 return True3001 else:3002 return False3003 def exportLiteral(self, outfile, level, name_='templateparamlistType'):3004 level += 13005 self.exportLiteralAttributes(outfile, level, name_)3006 if self.hasContent_():3007 self.exportLiteralChildren(outfile, level, name_)3008 def exportLiteralAttributes(self, outfile, level, name_):3009 pass3010 def exportLiteralChildren(self, outfile, level, name_):3011 showIndent(outfile, level)3012 outfile.write('param=[\n')3013 level += 13014 for param in self.param:3015 showIndent(outfile, level)3016 outfile.write('model_.param(\n')3017 param.exportLiteral(outfile, level, name_='param')3018 showIndent(outfile, level)3019 outfile.write('),\n')3020 level -= 13021 showIndent(outfile, level)3022 outfile.write('],\n')3023 def build(self, node_):3024 attrs = node_.attributes3025 self.buildAttributes(attrs)3026 for child_ in node_.childNodes:3027 nodeName_ = child_.nodeName.split(':')[-1]3028 self.buildChildren(child_, nodeName_)3029 def buildAttributes(self, attrs):3030 pass3031 def buildChildren(self, child_, nodeName_):3032 if child_.nodeType == Node.ELEMENT_NODE and \3033 nodeName_ == 'param':3034 obj_ = paramType.factory()3035 obj_.build(child_)3036 self.param.append(obj_)3037# end class templateparamlistType3038class paramType(GeneratedsSuper):3039 subclass = None3040 superclass = None3041 def __init__(self, type_=None, declname=None, defname=None, array=None, defval=None, briefdescription=None):3042 self.type_ = type_3043 self.declname = declname3044 self.defname = defname3045 self.array = array3046 self.defval = defval3047 self.briefdescription = briefdescription3048 def factory(*args_, **kwargs_):3049 if paramType.subclass:3050 return paramType.subclass(*args_, **kwargs_)3051 else:3052 return paramType(*args_, **kwargs_)3053 factory = staticmethod(factory)3054 def get_type(self): return self.type_3055 def set_type(self, type_): self.type_ = type_3056 def get_declname(self): return self.declname3057 def set_declname(self, declname): self.declname = declname3058 def get_defname(self): return self.defname3059 def set_defname(self, defname): self.defname = defname3060 def get_array(self): return self.array3061 def set_array(self, array): self.array = array3062 def get_defval(self): return self.defval3063 def set_defval(self, defval): self.defval = defval3064 def get_briefdescription(self): return self.briefdescription3065 def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription3066 def export(self, outfile, level, namespace_='', name_='paramType', namespacedef_=''):3067 showIndent(outfile, level)3068 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3069 self.exportAttributes(outfile, level, namespace_, name_='paramType')3070 if self.hasContent_():3071 outfile.write('>\n')3072 self.exportChildren(outfile, level + 1, namespace_, name_)3073 showIndent(outfile, level)3074 outfile.write('</%s%s>\n' % (namespace_, name_))3075 else:3076 outfile.write(' />\n')3077 def exportAttributes(self, outfile, level, namespace_='', name_='paramType'):3078 pass3079 def exportChildren(self, outfile, level, namespace_='', name_='paramType'):3080 if self.type_:3081 self.type_.export(outfile, level, namespace_, name_='type')3082 if self.declname is not None:3083 showIndent(outfile, level)3084 outfile.write('<%sdeclname>%s</%sdeclname>\n' % (namespace_, self.format_string(quote_xml(self.declname).encode(ExternalEncoding), input_name='declname'), namespace_))3085 if self.defname is not None:3086 showIndent(outfile, level)3087 outfile.write('<%sdefname>%s</%sdefname>\n' % (namespace_, self.format_string(quote_xml(self.defname).encode(ExternalEncoding), input_name='defname'), namespace_))3088 if self.array is not None:3089 showIndent(outfile, level)3090 outfile.write('<%sarray>%s</%sarray>\n' % (namespace_, self.format_string(quote_xml(self.array).encode(ExternalEncoding), input_name='array'), namespace_))3091 if self.defval:3092 self.defval.export(outfile, level, namespace_, name_='defval')3093 if self.briefdescription:3094 self.briefdescription.export(outfile, level, namespace_, name_='briefdescription')3095 def hasContent_(self):3096 if (3097 self.type_ is not None or3098 self.declname is not None or3099 self.defname is not None or3100 self.array is not None or3101 self.defval is not None or3102 self.briefdescription is not None3103 ):3104 return True3105 else:3106 return False3107 def exportLiteral(self, outfile, level, name_='paramType'):3108 level += 13109 self.exportLiteralAttributes(outfile, level, name_)3110 if self.hasContent_():3111 self.exportLiteralChildren(outfile, level, name_)3112 def exportLiteralAttributes(self, outfile, level, name_):3113 pass3114 def exportLiteralChildren(self, outfile, level, name_):3115 if self.type_:3116 showIndent(outfile, level)3117 outfile.write('type_=model_.linkedTextType(\n')3118 self.type_.exportLiteral(outfile, level, name_='type')3119 showIndent(outfile, level)3120 outfile.write('),\n')3121 showIndent(outfile, level)3122 outfile.write('declname=%s,\n' % quote_python(self.declname).encode(ExternalEncoding))3123 showIndent(outfile, level)3124 outfile.write('defname=%s,\n' % quote_python(self.defname).encode(ExternalEncoding))3125 showIndent(outfile, level)3126 outfile.write('array=%s,\n' % quote_python(self.array).encode(ExternalEncoding))3127 if self.defval:3128 showIndent(outfile, level)3129 outfile.write('defval=model_.linkedTextType(\n')3130 self.defval.exportLiteral(outfile, level, name_='defval')3131 showIndent(outfile, level)3132 outfile.write('),\n')3133 if self.briefdescription:3134 showIndent(outfile, level)3135 outfile.write('briefdescription=model_.descriptionType(\n')3136 self.briefdescription.exportLiteral(outfile, level, name_='briefdescription')3137 showIndent(outfile, level)3138 outfile.write('),\n')3139 def build(self, node_):3140 attrs = node_.attributes3141 self.buildAttributes(attrs)3142 for child_ in node_.childNodes:3143 nodeName_ = child_.nodeName.split(':')[-1]3144 self.buildChildren(child_, nodeName_)3145 def buildAttributes(self, attrs):3146 pass3147 def buildChildren(self, child_, nodeName_):3148 if child_.nodeType == Node.ELEMENT_NODE and \3149 nodeName_ == 'type':3150 obj_ = linkedTextType.factory()3151 obj_.build(child_)3152 self.set_type(obj_)3153 elif child_.nodeType == Node.ELEMENT_NODE and \3154 nodeName_ == 'declname':3155 declname_ = ''3156 for text__content_ in child_.childNodes:3157 declname_ += text__content_.nodeValue3158 self.declname = declname_3159 elif child_.nodeType == Node.ELEMENT_NODE and \3160 nodeName_ == 'defname':3161 defname_ = ''3162 for text__content_ in child_.childNodes:3163 defname_ += text__content_.nodeValue3164 self.defname = defname_3165 elif child_.nodeType == Node.ELEMENT_NODE and \3166 nodeName_ == 'array':3167 array_ = ''3168 for text__content_ in child_.childNodes:3169 array_ += text__content_.nodeValue3170 self.array = array_3171 elif child_.nodeType == Node.ELEMENT_NODE and \3172 nodeName_ == 'defval':3173 obj_ = linkedTextType.factory()3174 obj_.build(child_)3175 self.set_defval(obj_)3176 elif child_.nodeType == Node.ELEMENT_NODE and \3177 nodeName_ == 'briefdescription':3178 obj_ = descriptionType.factory()3179 obj_.build(child_)3180 self.set_briefdescription(obj_)3181# end class paramType3182class declname(GeneratedsSuper):3183 subclass = None3184 superclass = None3185 def __init__(self, valueOf_=''):3186 self.valueOf_ = valueOf_3187 def factory(*args_, **kwargs_):3188 if declname.subclass:3189 return declname.subclass(*args_, **kwargs_)3190 else:3191 return declname(*args_, **kwargs_)3192 factory = staticmethod(factory)3193 def getValueOf_(self): return self.valueOf_3194 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3195 def export(self, outfile, level, namespace_='', name_='declname', namespacedef_=''):3196 showIndent(outfile, level)3197 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3198 self.exportAttributes(outfile, level, namespace_, name_='declname')3199 if self.hasContent_():3200 outfile.write('>\n')3201 self.exportChildren(outfile, level + 1, namespace_, name_)3202 showIndent(outfile, level)3203 outfile.write('</%s%s>\n' % (namespace_, name_))3204 else:3205 outfile.write(' />\n')3206 def exportAttributes(self, outfile, level, namespace_='', name_='declname'):3207 pass3208 def exportChildren(self, outfile, level, namespace_='', name_='declname'):3209 if self.valueOf_.find('![CDATA')>-1:3210 value=quote_xml('%s' % self.valueOf_)3211 value=value.replace('![CDATA','<![CDATA')3212 value=value.replace(']]',']]>')3213 outfile.write(value)3214 else:3215 outfile.write(quote_xml('%s' % self.valueOf_))3216 def hasContent_(self):3217 if (3218 self.valueOf_ is not None3219 ):3220 return True3221 else:3222 return False3223 def exportLiteral(self, outfile, level, name_='declname'):3224 level += 13225 self.exportLiteralAttributes(outfile, level, name_)3226 if self.hasContent_():3227 self.exportLiteralChildren(outfile, level, name_)3228 def exportLiteralAttributes(self, outfile, level, name_):3229 pass3230 def exportLiteralChildren(self, outfile, level, name_):3231 showIndent(outfile, level)3232 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3233 def build(self, node_):3234 attrs = node_.attributes3235 self.buildAttributes(attrs)3236 self.valueOf_ = ''3237 for child_ in node_.childNodes:3238 nodeName_ = child_.nodeName.split(':')[-1]3239 self.buildChildren(child_, nodeName_)3240 def buildAttributes(self, attrs):3241 pass3242 def buildChildren(self, child_, nodeName_):3243 if child_.nodeType == Node.TEXT_NODE:3244 self.valueOf_ += child_.nodeValue3245 elif child_.nodeType == Node.CDATA_SECTION_NODE:3246 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3247# end class declname3248class defname(GeneratedsSuper):3249 subclass = None3250 superclass = None3251 def __init__(self, valueOf_=''):3252 self.valueOf_ = valueOf_3253 def factory(*args_, **kwargs_):3254 if defname.subclass:3255 return defname.subclass(*args_, **kwargs_)3256 else:3257 return defname(*args_, **kwargs_)3258 factory = staticmethod(factory)3259 def getValueOf_(self): return self.valueOf_3260 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3261 def export(self, outfile, level, namespace_='', name_='defname', namespacedef_=''):3262 showIndent(outfile, level)3263 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3264 self.exportAttributes(outfile, level, namespace_, name_='defname')3265 if self.hasContent_():3266 outfile.write('>\n')3267 self.exportChildren(outfile, level + 1, namespace_, name_)3268 showIndent(outfile, level)3269 outfile.write('</%s%s>\n' % (namespace_, name_))3270 else:3271 outfile.write(' />\n')3272 def exportAttributes(self, outfile, level, namespace_='', name_='defname'):3273 pass3274 def exportChildren(self, outfile, level, namespace_='', name_='defname'):3275 if self.valueOf_.find('![CDATA')>-1:3276 value=quote_xml('%s' % self.valueOf_)3277 value=value.replace('![CDATA','<![CDATA')3278 value=value.replace(']]',']]>')3279 outfile.write(value)3280 else:3281 outfile.write(quote_xml('%s' % self.valueOf_))3282 def hasContent_(self):3283 if (3284 self.valueOf_ is not None3285 ):3286 return True3287 else:3288 return False3289 def exportLiteral(self, outfile, level, name_='defname'):3290 level += 13291 self.exportLiteralAttributes(outfile, level, name_)3292 if self.hasContent_():3293 self.exportLiteralChildren(outfile, level, name_)3294 def exportLiteralAttributes(self, outfile, level, name_):3295 pass3296 def exportLiteralChildren(self, outfile, level, name_):3297 showIndent(outfile, level)3298 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3299 def build(self, node_):3300 attrs = node_.attributes3301 self.buildAttributes(attrs)3302 self.valueOf_ = ''3303 for child_ in node_.childNodes:3304 nodeName_ = child_.nodeName.split(':')[-1]3305 self.buildChildren(child_, nodeName_)3306 def buildAttributes(self, attrs):3307 pass3308 def buildChildren(self, child_, nodeName_):3309 if child_.nodeType == Node.TEXT_NODE:3310 self.valueOf_ += child_.nodeValue3311 elif child_.nodeType == Node.CDATA_SECTION_NODE:3312 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3313# end class defname3314class array(GeneratedsSuper):3315 subclass = None3316 superclass = None3317 def __init__(self, valueOf_=''):3318 self.valueOf_ = valueOf_3319 def factory(*args_, **kwargs_):3320 if array.subclass:3321 return array.subclass(*args_, **kwargs_)3322 else:3323 return array(*args_, **kwargs_)3324 factory = staticmethod(factory)3325 def getValueOf_(self): return self.valueOf_3326 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3327 def export(self, outfile, level, namespace_='', name_='array', namespacedef_=''):3328 showIndent(outfile, level)3329 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3330 self.exportAttributes(outfile, level, namespace_, name_='array')3331 if self.hasContent_():3332 outfile.write('>\n')3333 self.exportChildren(outfile, level + 1, namespace_, name_)3334 showIndent(outfile, level)3335 outfile.write('</%s%s>\n' % (namespace_, name_))3336 else:3337 outfile.write(' />\n')3338 def exportAttributes(self, outfile, level, namespace_='', name_='array'):3339 pass3340 def exportChildren(self, outfile, level, namespace_='', name_='array'):3341 if self.valueOf_.find('![CDATA')>-1:3342 value=quote_xml('%s' % self.valueOf_)3343 value=value.replace('![CDATA','<![CDATA')3344 value=value.replace(']]',']]>')3345 outfile.write(value)3346 else:3347 outfile.write(quote_xml('%s' % self.valueOf_))3348 def hasContent_(self):3349 if (3350 self.valueOf_ is not None3351 ):3352 return True3353 else:3354 return False3355 def exportLiteral(self, outfile, level, name_='array'):3356 level += 13357 self.exportLiteralAttributes(outfile, level, name_)3358 if self.hasContent_():3359 self.exportLiteralChildren(outfile, level, name_)3360 def exportLiteralAttributes(self, outfile, level, name_):3361 pass3362 def exportLiteralChildren(self, outfile, level, name_):3363 showIndent(outfile, level)3364 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3365 def build(self, node_):3366 attrs = node_.attributes3367 self.buildAttributes(attrs)3368 self.valueOf_ = ''3369 for child_ in node_.childNodes:3370 nodeName_ = child_.nodeName.split(':')[-1]3371 self.buildChildren(child_, nodeName_)3372 def buildAttributes(self, attrs):3373 pass3374 def buildChildren(self, child_, nodeName_):3375 if child_.nodeType == Node.TEXT_NODE:3376 self.valueOf_ += child_.nodeValue3377 elif child_.nodeType == Node.CDATA_SECTION_NODE:3378 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3379# end class array3380class linkedTextType(GeneratedsSuper):3381 subclass = None3382 superclass = None3383 def __init__(self, ref=None, mixedclass_=None, content_=None):3384 if mixedclass_ is None:3385 self.mixedclass_ = MixedContainer3386 else:3387 self.mixedclass_ = mixedclass_3388 if content_ is None:3389 self.content_ = []3390 else:3391 self.content_ = content_3392 def factory(*args_, **kwargs_):3393 if linkedTextType.subclass:3394 return linkedTextType.subclass(*args_, **kwargs_)3395 else:3396 return linkedTextType(*args_, **kwargs_)3397 factory = staticmethod(factory)3398 def get_ref(self): return self.ref3399 def set_ref(self, ref): self.ref = ref3400 def add_ref(self, value): self.ref.append(value)3401 def insert_ref(self, index, value): self.ref[index] = value3402 def export(self, outfile, level, namespace_='', name_='linkedTextType', namespacedef_=''):3403 showIndent(outfile, level)3404 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3405 self.exportAttributes(outfile, level, namespace_, name_='linkedTextType')3406 outfile.write('>')3407 self.exportChildren(outfile, level + 1, namespace_, name_)3408 outfile.write('</%s%s>\n' % (namespace_, name_))3409 def exportAttributes(self, outfile, level, namespace_='', name_='linkedTextType'):3410 pass3411 def exportChildren(self, outfile, level, namespace_='', name_='linkedTextType'):3412 for item_ in self.content_:3413 item_.export(outfile, level, item_.name, namespace_)3414 def hasContent_(self):3415 if (3416 self.ref is not None3417 ):3418 return True3419 else:3420 return False3421 def exportLiteral(self, outfile, level, name_='linkedTextType'):3422 level += 13423 self.exportLiteralAttributes(outfile, level, name_)3424 if self.hasContent_():3425 self.exportLiteralChildren(outfile, level, name_)3426 def exportLiteralAttributes(self, outfile, level, name_):3427 pass3428 def exportLiteralChildren(self, outfile, level, name_):3429 showIndent(outfile, level)3430 outfile.write('content_ = [\n')3431 for item_ in self.content_:3432 item_.exportLiteral(outfile, level, name_)3433 showIndent(outfile, level)3434 outfile.write('],\n')3435 def build(self, node_):3436 attrs = node_.attributes3437 self.buildAttributes(attrs)3438 for child_ in node_.childNodes:3439 nodeName_ = child_.nodeName.split(':')[-1]3440 self.buildChildren(child_, nodeName_)3441 def buildAttributes(self, attrs):3442 pass3443 def buildChildren(self, child_, nodeName_):3444 if child_.nodeType == Node.ELEMENT_NODE and \3445 nodeName_ == 'ref':3446 childobj_ = docRefTextType.factory()3447 childobj_.build(child_)3448 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,3449 MixedContainer.TypeNone, 'ref', childobj_)3450 self.content_.append(obj_)3451 elif child_.nodeType == Node.TEXT_NODE:3452 obj_ = self.mixedclass_(MixedContainer.CategoryText,3453 MixedContainer.TypeNone, '', child_.nodeValue)3454 self.content_.append(obj_)3455# end class linkedTextType3456class graphType(GeneratedsSuper):3457 subclass = None3458 superclass = None3459 def __init__(self, node=None):3460 if node is None:3461 self.node = []3462 else:3463 self.node = node3464 def factory(*args_, **kwargs_):3465 if graphType.subclass:3466 return graphType.subclass(*args_, **kwargs_)3467 else:3468 return graphType(*args_, **kwargs_)3469 factory = staticmethod(factory)3470 def get_node(self): return self.node3471 def set_node(self, node): self.node = node3472 def add_node(self, value): self.node.append(value)3473 def insert_node(self, index, value): self.node[index] = value3474 def export(self, outfile, level, namespace_='', name_='graphType', namespacedef_=''):3475 showIndent(outfile, level)3476 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3477 self.exportAttributes(outfile, level, namespace_, name_='graphType')3478 if self.hasContent_():3479 outfile.write('>\n')3480 self.exportChildren(outfile, level + 1, namespace_, name_)3481 showIndent(outfile, level)3482 outfile.write('</%s%s>\n' % (namespace_, name_))3483 else:3484 outfile.write(' />\n')3485 def exportAttributes(self, outfile, level, namespace_='', name_='graphType'):3486 pass3487 def exportChildren(self, outfile, level, namespace_='', name_='graphType'):3488 for node_ in self.node:3489 node_.export(outfile, level, namespace_, name_='node')3490 def hasContent_(self):3491 if (3492 self.node is not None3493 ):3494 return True3495 else:3496 return False3497 def exportLiteral(self, outfile, level, name_='graphType'):3498 level += 13499 self.exportLiteralAttributes(outfile, level, name_)3500 if self.hasContent_():3501 self.exportLiteralChildren(outfile, level, name_)3502 def exportLiteralAttributes(self, outfile, level, name_):3503 pass3504 def exportLiteralChildren(self, outfile, level, name_):3505 showIndent(outfile, level)3506 outfile.write('node=[\n')3507 level += 13508 for node in self.node:3509 showIndent(outfile, level)3510 outfile.write('model_.node(\n')3511 node.exportLiteral(outfile, level, name_='node')3512 showIndent(outfile, level)3513 outfile.write('),\n')3514 level -= 13515 showIndent(outfile, level)3516 outfile.write('],\n')3517 def build(self, node_):3518 attrs = node_.attributes3519 self.buildAttributes(attrs)3520 for child_ in node_.childNodes:3521 nodeName_ = child_.nodeName.split(':')[-1]3522 self.buildChildren(child_, nodeName_)3523 def buildAttributes(self, attrs):3524 pass3525 def buildChildren(self, child_, nodeName_):3526 if child_.nodeType == Node.ELEMENT_NODE and \3527 nodeName_ == 'node':3528 obj_ = nodeType.factory()3529 obj_.build(child_)3530 self.node.append(obj_)3531# end class graphType3532class nodeType(GeneratedsSuper):3533 subclass = None3534 superclass = None3535 def __init__(self, id=None, label=None, link=None, childnode=None):3536 self.id = id3537 self.label = label3538 self.link = link3539 if childnode is None:3540 self.childnode = []3541 else:3542 self.childnode = childnode3543 def factory(*args_, **kwargs_):3544 if nodeType.subclass:3545 return nodeType.subclass(*args_, **kwargs_)3546 else:3547 return nodeType(*args_, **kwargs_)3548 factory = staticmethod(factory)3549 def get_label(self): return self.label3550 def set_label(self, label): self.label = label3551 def get_link(self): return self.link3552 def set_link(self, link): self.link = link3553 def get_childnode(self): return self.childnode3554 def set_childnode(self, childnode): self.childnode = childnode3555 def add_childnode(self, value): self.childnode.append(value)3556 def insert_childnode(self, index, value): self.childnode[index] = value3557 def get_id(self): return self.id3558 def set_id(self, id): self.id = id3559 def export(self, outfile, level, namespace_='', name_='nodeType', namespacedef_=''):3560 showIndent(outfile, level)3561 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3562 self.exportAttributes(outfile, level, namespace_, name_='nodeType')3563 if self.hasContent_():3564 outfile.write('>\n')3565 self.exportChildren(outfile, level + 1, namespace_, name_)3566 showIndent(outfile, level)3567 outfile.write('</%s%s>\n' % (namespace_, name_))3568 else:3569 outfile.write(' />\n')3570 def exportAttributes(self, outfile, level, namespace_='', name_='nodeType'):3571 if self.id is not None:3572 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))3573 def exportChildren(self, outfile, level, namespace_='', name_='nodeType'):3574 if self.label is not None:3575 showIndent(outfile, level)3576 outfile.write('<%slabel>%s</%slabel>\n' % (namespace_, self.format_string(quote_xml(self.label).encode(ExternalEncoding), input_name='label'), namespace_))3577 if self.link:3578 self.link.export(outfile, level, namespace_, name_='link')3579 for childnode_ in self.childnode:3580 childnode_.export(outfile, level, namespace_, name_='childnode')3581 def hasContent_(self):3582 if (3583 self.label is not None or3584 self.link is not None or3585 self.childnode is not None3586 ):3587 return True3588 else:3589 return False3590 def exportLiteral(self, outfile, level, name_='nodeType'):3591 level += 13592 self.exportLiteralAttributes(outfile, level, name_)3593 if self.hasContent_():3594 self.exportLiteralChildren(outfile, level, name_)3595 def exportLiteralAttributes(self, outfile, level, name_):3596 if self.id is not None:3597 showIndent(outfile, level)3598 outfile.write('id = %s,\n' % (self.id,))3599 def exportLiteralChildren(self, outfile, level, name_):3600 showIndent(outfile, level)3601 outfile.write('label=%s,\n' % quote_python(self.label).encode(ExternalEncoding))3602 if self.link:3603 showIndent(outfile, level)3604 outfile.write('link=model_.linkType(\n')3605 self.link.exportLiteral(outfile, level, name_='link')3606 showIndent(outfile, level)3607 outfile.write('),\n')3608 showIndent(outfile, level)3609 outfile.write('childnode=[\n')3610 level += 13611 for childnode in self.childnode:3612 showIndent(outfile, level)3613 outfile.write('model_.childnode(\n')3614 childnode.exportLiteral(outfile, level, name_='childnode')3615 showIndent(outfile, level)3616 outfile.write('),\n')3617 level -= 13618 showIndent(outfile, level)3619 outfile.write('],\n')3620 def build(self, node_):3621 attrs = node_.attributes3622 self.buildAttributes(attrs)3623 for child_ in node_.childNodes:3624 nodeName_ = child_.nodeName.split(':')[-1]3625 self.buildChildren(child_, nodeName_)3626 def buildAttributes(self, attrs):3627 if attrs.get('id'):3628 self.id = attrs.get('id').value3629 def buildChildren(self, child_, nodeName_):3630 if child_.nodeType == Node.ELEMENT_NODE and \3631 nodeName_ == 'label':3632 label_ = ''3633 for text__content_ in child_.childNodes:3634 label_ += text__content_.nodeValue3635 self.label = label_3636 elif child_.nodeType == Node.ELEMENT_NODE and \3637 nodeName_ == 'link':3638 obj_ = linkType.factory()3639 obj_.build(child_)3640 self.set_link(obj_)3641 elif child_.nodeType == Node.ELEMENT_NODE and \3642 nodeName_ == 'childnode':3643 obj_ = childnodeType.factory()3644 obj_.build(child_)3645 self.childnode.append(obj_)3646# end class nodeType3647class label(GeneratedsSuper):3648 subclass = None3649 superclass = None3650 def __init__(self, valueOf_=''):3651 self.valueOf_ = valueOf_3652 def factory(*args_, **kwargs_):3653 if label.subclass:3654 return label.subclass(*args_, **kwargs_)3655 else:3656 return label(*args_, **kwargs_)3657 factory = staticmethod(factory)3658 def getValueOf_(self): return self.valueOf_3659 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3660 def export(self, outfile, level, namespace_='', name_='label', namespacedef_=''):3661 showIndent(outfile, level)3662 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3663 self.exportAttributes(outfile, level, namespace_, name_='label')3664 if self.hasContent_():3665 outfile.write('>\n')3666 self.exportChildren(outfile, level + 1, namespace_, name_)3667 showIndent(outfile, level)3668 outfile.write('</%s%s>\n' % (namespace_, name_))3669 else:3670 outfile.write(' />\n')3671 def exportAttributes(self, outfile, level, namespace_='', name_='label'):3672 pass3673 def exportChildren(self, outfile, level, namespace_='', name_='label'):3674 if self.valueOf_.find('![CDATA')>-1:3675 value=quote_xml('%s' % self.valueOf_)3676 value=value.replace('![CDATA','<![CDATA')3677 value=value.replace(']]',']]>')3678 outfile.write(value)3679 else:3680 outfile.write(quote_xml('%s' % self.valueOf_))3681 def hasContent_(self):3682 if (3683 self.valueOf_ is not None3684 ):3685 return True3686 else:3687 return False3688 def exportLiteral(self, outfile, level, name_='label'):3689 level += 13690 self.exportLiteralAttributes(outfile, level, name_)3691 if self.hasContent_():3692 self.exportLiteralChildren(outfile, level, name_)3693 def exportLiteralAttributes(self, outfile, level, name_):3694 pass3695 def exportLiteralChildren(self, outfile, level, name_):3696 showIndent(outfile, level)3697 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3698 def build(self, node_):3699 attrs = node_.attributes3700 self.buildAttributes(attrs)3701 self.valueOf_ = ''3702 for child_ in node_.childNodes:3703 nodeName_ = child_.nodeName.split(':')[-1]3704 self.buildChildren(child_, nodeName_)3705 def buildAttributes(self, attrs):3706 pass3707 def buildChildren(self, child_, nodeName_):3708 if child_.nodeType == Node.TEXT_NODE:3709 self.valueOf_ += child_.nodeValue3710 elif child_.nodeType == Node.CDATA_SECTION_NODE:3711 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3712# end class label3713class childnodeType(GeneratedsSuper):3714 subclass = None3715 superclass = None3716 def __init__(self, relation=None, refid=None, edgelabel=None):3717 self.relation = relation3718 self.refid = refid3719 if edgelabel is None:3720 self.edgelabel = []3721 else:3722 self.edgelabel = edgelabel3723 def factory(*args_, **kwargs_):3724 if childnodeType.subclass:3725 return childnodeType.subclass(*args_, **kwargs_)3726 else:3727 return childnodeType(*args_, **kwargs_)3728 factory = staticmethod(factory)3729 def get_edgelabel(self): return self.edgelabel3730 def set_edgelabel(self, edgelabel): self.edgelabel = edgelabel3731 def add_edgelabel(self, value): self.edgelabel.append(value)3732 def insert_edgelabel(self, index, value): self.edgelabel[index] = value3733 def get_relation(self): return self.relation3734 def set_relation(self, relation): self.relation = relation3735 def get_refid(self): return self.refid3736 def set_refid(self, refid): self.refid = refid3737 def export(self, outfile, level, namespace_='', name_='childnodeType', namespacedef_=''):3738 showIndent(outfile, level)3739 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3740 self.exportAttributes(outfile, level, namespace_, name_='childnodeType')3741 if self.hasContent_():3742 outfile.write('>\n')3743 self.exportChildren(outfile, level + 1, namespace_, name_)3744 showIndent(outfile, level)3745 outfile.write('</%s%s>\n' % (namespace_, name_))3746 else:3747 outfile.write(' />\n')3748 def exportAttributes(self, outfile, level, namespace_='', name_='childnodeType'):3749 if self.relation is not None:3750 outfile.write(' relation=%s' % (quote_attrib(self.relation), ))3751 if self.refid is not None:3752 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))3753 def exportChildren(self, outfile, level, namespace_='', name_='childnodeType'):3754 for edgelabel_ in self.edgelabel:3755 showIndent(outfile, level)3756 outfile.write('<%sedgelabel>%s</%sedgelabel>\n' % (namespace_, self.format_string(quote_xml(edgelabel_).encode(ExternalEncoding), input_name='edgelabel'), namespace_))3757 def hasContent_(self):3758 if (3759 self.edgelabel is not None3760 ):3761 return True3762 else:3763 return False3764 def exportLiteral(self, outfile, level, name_='childnodeType'):3765 level += 13766 self.exportLiteralAttributes(outfile, level, name_)3767 if self.hasContent_():3768 self.exportLiteralChildren(outfile, level, name_)3769 def exportLiteralAttributes(self, outfile, level, name_):3770 if self.relation is not None:3771 showIndent(outfile, level)3772 outfile.write('relation = "%s",\n' % (self.relation,))3773 if self.refid is not None:3774 showIndent(outfile, level)3775 outfile.write('refid = %s,\n' % (self.refid,))3776 def exportLiteralChildren(self, outfile, level, name_):3777 showIndent(outfile, level)3778 outfile.write('edgelabel=[\n')3779 level += 13780 for edgelabel in self.edgelabel:3781 showIndent(outfile, level)3782 outfile.write('%s,\n' % quote_python(edgelabel).encode(ExternalEncoding))3783 level -= 13784 showIndent(outfile, level)3785 outfile.write('],\n')3786 def build(self, node_):3787 attrs = node_.attributes3788 self.buildAttributes(attrs)3789 for child_ in node_.childNodes:3790 nodeName_ = child_.nodeName.split(':')[-1]3791 self.buildChildren(child_, nodeName_)3792 def buildAttributes(self, attrs):3793 if attrs.get('relation'):3794 self.relation = attrs.get('relation').value3795 if attrs.get('refid'):3796 self.refid = attrs.get('refid').value3797 def buildChildren(self, child_, nodeName_):3798 if child_.nodeType == Node.ELEMENT_NODE and \3799 nodeName_ == 'edgelabel':3800 edgelabel_ = ''3801 for text__content_ in child_.childNodes:3802 edgelabel_ += text__content_.nodeValue3803 self.edgelabel.append(edgelabel_)3804# end class childnodeType3805class edgelabel(GeneratedsSuper):3806 subclass = None3807 superclass = None3808 def __init__(self, valueOf_=''):3809 self.valueOf_ = valueOf_3810 def factory(*args_, **kwargs_):3811 if edgelabel.subclass:3812 return edgelabel.subclass(*args_, **kwargs_)3813 else:3814 return edgelabel(*args_, **kwargs_)3815 factory = staticmethod(factory)3816 def getValueOf_(self): return self.valueOf_3817 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3818 def export(self, outfile, level, namespace_='', name_='edgelabel', namespacedef_=''):3819 showIndent(outfile, level)3820 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3821 self.exportAttributes(outfile, level, namespace_, name_='edgelabel')3822 if self.hasContent_():3823 outfile.write('>\n')3824 self.exportChildren(outfile, level + 1, namespace_, name_)3825 showIndent(outfile, level)3826 outfile.write('</%s%s>\n' % (namespace_, name_))3827 else:3828 outfile.write(' />\n')3829 def exportAttributes(self, outfile, level, namespace_='', name_='edgelabel'):3830 pass3831 def exportChildren(self, outfile, level, namespace_='', name_='edgelabel'):3832 if self.valueOf_.find('![CDATA')>-1:3833 value=quote_xml('%s' % self.valueOf_)3834 value=value.replace('![CDATA','<![CDATA')3835 value=value.replace(']]',']]>')3836 outfile.write(value)3837 else:3838 outfile.write(quote_xml('%s' % self.valueOf_))3839 def hasContent_(self):3840 if (3841 self.valueOf_ is not None3842 ):3843 return True3844 else:3845 return False3846 def exportLiteral(self, outfile, level, name_='edgelabel'):3847 level += 13848 self.exportLiteralAttributes(outfile, level, name_)3849 if self.hasContent_():3850 self.exportLiteralChildren(outfile, level, name_)3851 def exportLiteralAttributes(self, outfile, level, name_):3852 pass3853 def exportLiteralChildren(self, outfile, level, name_):3854 showIndent(outfile, level)3855 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3856 def build(self, node_):3857 attrs = node_.attributes3858 self.buildAttributes(attrs)3859 self.valueOf_ = ''3860 for child_ in node_.childNodes:3861 nodeName_ = child_.nodeName.split(':')[-1]3862 self.buildChildren(child_, nodeName_)3863 def buildAttributes(self, attrs):3864 pass3865 def buildChildren(self, child_, nodeName_):3866 if child_.nodeType == Node.TEXT_NODE:3867 self.valueOf_ += child_.nodeValue3868 elif child_.nodeType == Node.CDATA_SECTION_NODE:3869 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3870# end class edgelabel3871class linkType(GeneratedsSuper):3872 subclass = None3873 superclass = None3874 def __init__(self, refid=None, external=None, valueOf_=''):3875 self.refid = refid3876 self.external = external3877 self.valueOf_ = valueOf_3878 def factory(*args_, **kwargs_):3879 if linkType.subclass:3880 return linkType.subclass(*args_, **kwargs_)3881 else:3882 return linkType(*args_, **kwargs_)3883 factory = staticmethod(factory)3884 def get_refid(self): return self.refid3885 def set_refid(self, refid): self.refid = refid3886 def get_external(self): return self.external3887 def set_external(self, external): self.external = external3888 def getValueOf_(self): return self.valueOf_3889 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_3890 def export(self, outfile, level, namespace_='', name_='linkType', namespacedef_=''):3891 showIndent(outfile, level)3892 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3893 self.exportAttributes(outfile, level, namespace_, name_='linkType')3894 if self.hasContent_():3895 outfile.write('>\n')3896 self.exportChildren(outfile, level + 1, namespace_, name_)3897 showIndent(outfile, level)3898 outfile.write('</%s%s>\n' % (namespace_, name_))3899 else:3900 outfile.write(' />\n')3901 def exportAttributes(self, outfile, level, namespace_='', name_='linkType'):3902 if self.refid is not None:3903 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))3904 if self.external is not None:3905 outfile.write(' external=%s' % (self.format_string(quote_attrib(self.external).encode(ExternalEncoding), input_name='external'), ))3906 def exportChildren(self, outfile, level, namespace_='', name_='linkType'):3907 if self.valueOf_.find('![CDATA')>-1:3908 value=quote_xml('%s' % self.valueOf_)3909 value=value.replace('![CDATA','<![CDATA')3910 value=value.replace(']]',']]>')3911 outfile.write(value)3912 else:3913 outfile.write(quote_xml('%s' % self.valueOf_))3914 def hasContent_(self):3915 if (3916 self.valueOf_ is not None3917 ):3918 return True3919 else:3920 return False3921 def exportLiteral(self, outfile, level, name_='linkType'):3922 level += 13923 self.exportLiteralAttributes(outfile, level, name_)3924 if self.hasContent_():3925 self.exportLiteralChildren(outfile, level, name_)3926 def exportLiteralAttributes(self, outfile, level, name_):3927 if self.refid is not None:3928 showIndent(outfile, level)3929 outfile.write('refid = %s,\n' % (self.refid,))3930 if self.external is not None:3931 showIndent(outfile, level)3932 outfile.write('external = %s,\n' % (self.external,))3933 def exportLiteralChildren(self, outfile, level, name_):3934 showIndent(outfile, level)3935 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))3936 def build(self, node_):3937 attrs = node_.attributes3938 self.buildAttributes(attrs)3939 self.valueOf_ = ''3940 for child_ in node_.childNodes:3941 nodeName_ = child_.nodeName.split(':')[-1]3942 self.buildChildren(child_, nodeName_)3943 def buildAttributes(self, attrs):3944 if attrs.get('refid'):3945 self.refid = attrs.get('refid').value3946 if attrs.get('external'):3947 self.external = attrs.get('external').value3948 def buildChildren(self, child_, nodeName_):3949 if child_.nodeType == Node.TEXT_NODE:3950 self.valueOf_ += child_.nodeValue3951 elif child_.nodeType == Node.CDATA_SECTION_NODE:3952 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'3953# end class linkType3954class listingType(GeneratedsSuper):3955 subclass = None3956 superclass = None3957 def __init__(self, codeline=None):3958 if codeline is None:3959 self.codeline = []3960 else:3961 self.codeline = codeline3962 def factory(*args_, **kwargs_):3963 if listingType.subclass:3964 return listingType.subclass(*args_, **kwargs_)3965 else:3966 return listingType(*args_, **kwargs_)3967 factory = staticmethod(factory)3968 def get_codeline(self): return self.codeline3969 def set_codeline(self, codeline): self.codeline = codeline3970 def add_codeline(self, value): self.codeline.append(value)3971 def insert_codeline(self, index, value): self.codeline[index] = value3972 def export(self, outfile, level, namespace_='', name_='listingType', namespacedef_=''):3973 showIndent(outfile, level)3974 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))3975 self.exportAttributes(outfile, level, namespace_, name_='listingType')3976 if self.hasContent_():3977 outfile.write('>\n')3978 self.exportChildren(outfile, level + 1, namespace_, name_)3979 showIndent(outfile, level)3980 outfile.write('</%s%s>\n' % (namespace_, name_))3981 else:3982 outfile.write(' />\n')3983 def exportAttributes(self, outfile, level, namespace_='', name_='listingType'):3984 pass3985 def exportChildren(self, outfile, level, namespace_='', name_='listingType'):3986 for codeline_ in self.codeline:3987 codeline_.export(outfile, level, namespace_, name_='codeline')3988 def hasContent_(self):3989 if (3990 self.codeline is not None3991 ):3992 return True3993 else:3994 return False3995 def exportLiteral(self, outfile, level, name_='listingType'):3996 level += 13997 self.exportLiteralAttributes(outfile, level, name_)3998 if self.hasContent_():3999 self.exportLiteralChildren(outfile, level, name_)4000 def exportLiteralAttributes(self, outfile, level, name_):4001 pass4002 def exportLiteralChildren(self, outfile, level, name_):4003 showIndent(outfile, level)4004 outfile.write('codeline=[\n')4005 level += 14006 for codeline in self.codeline:4007 showIndent(outfile, level)4008 outfile.write('model_.codeline(\n')4009 codeline.exportLiteral(outfile, level, name_='codeline')4010 showIndent(outfile, level)4011 outfile.write('),\n')4012 level -= 14013 showIndent(outfile, level)4014 outfile.write('],\n')4015 def build(self, node_):4016 attrs = node_.attributes4017 self.buildAttributes(attrs)4018 for child_ in node_.childNodes:4019 nodeName_ = child_.nodeName.split(':')[-1]4020 self.buildChildren(child_, nodeName_)4021 def buildAttributes(self, attrs):4022 pass4023 def buildChildren(self, child_, nodeName_):4024 if child_.nodeType == Node.ELEMENT_NODE and \4025 nodeName_ == 'codeline':4026 obj_ = codelineType.factory()4027 obj_.build(child_)4028 self.codeline.append(obj_)4029# end class listingType4030class codelineType(GeneratedsSuper):4031 subclass = None4032 superclass = None4033 def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None):4034 self.external = external4035 self.lineno = lineno4036 self.refkind = refkind4037 self.refid = refid4038 if highlight is None:4039 self.highlight = []4040 else:4041 self.highlight = highlight4042 def factory(*args_, **kwargs_):4043 if codelineType.subclass:4044 return codelineType.subclass(*args_, **kwargs_)4045 else:4046 return codelineType(*args_, **kwargs_)4047 factory = staticmethod(factory)4048 def get_highlight(self): return self.highlight4049 def set_highlight(self, highlight): self.highlight = highlight4050 def add_highlight(self, value): self.highlight.append(value)4051 def insert_highlight(self, index, value): self.highlight[index] = value4052 def get_external(self): return self.external4053 def set_external(self, external): self.external = external4054 def get_lineno(self): return self.lineno4055 def set_lineno(self, lineno): self.lineno = lineno4056 def get_refkind(self): return self.refkind4057 def set_refkind(self, refkind): self.refkind = refkind4058 def get_refid(self): return self.refid4059 def set_refid(self, refid): self.refid = refid4060 def export(self, outfile, level, namespace_='', name_='codelineType', namespacedef_=''):4061 showIndent(outfile, level)4062 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4063 self.exportAttributes(outfile, level, namespace_, name_='codelineType')4064 if self.hasContent_():4065 outfile.write('>\n')4066 self.exportChildren(outfile, level + 1, namespace_, name_)4067 showIndent(outfile, level)4068 outfile.write('</%s%s>\n' % (namespace_, name_))4069 else:4070 outfile.write(' />\n')4071 def exportAttributes(self, outfile, level, namespace_='', name_='codelineType'):4072 if self.external is not None:4073 outfile.write(' external=%s' % (quote_attrib(self.external), ))4074 if self.lineno is not None:4075 outfile.write(' lineno="%s"' % self.format_integer(self.lineno, input_name='lineno'))4076 if self.refkind is not None:4077 outfile.write(' refkind=%s' % (quote_attrib(self.refkind), ))4078 if self.refid is not None:4079 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))4080 def exportChildren(self, outfile, level, namespace_='', name_='codelineType'):4081 for highlight_ in self.highlight:4082 highlight_.export(outfile, level, namespace_, name_='highlight')4083 def hasContent_(self):4084 if (4085 self.highlight is not None4086 ):4087 return True4088 else:4089 return False4090 def exportLiteral(self, outfile, level, name_='codelineType'):4091 level += 14092 self.exportLiteralAttributes(outfile, level, name_)4093 if self.hasContent_():4094 self.exportLiteralChildren(outfile, level, name_)4095 def exportLiteralAttributes(self, outfile, level, name_):4096 if self.external is not None:4097 showIndent(outfile, level)4098 outfile.write('external = "%s",\n' % (self.external,))4099 if self.lineno is not None:4100 showIndent(outfile, level)4101 outfile.write('lineno = %s,\n' % (self.lineno,))4102 if self.refkind is not None:4103 showIndent(outfile, level)4104 outfile.write('refkind = "%s",\n' % (self.refkind,))4105 if self.refid is not None:4106 showIndent(outfile, level)4107 outfile.write('refid = %s,\n' % (self.refid,))4108 def exportLiteralChildren(self, outfile, level, name_):4109 showIndent(outfile, level)4110 outfile.write('highlight=[\n')4111 level += 14112 for highlight in self.highlight:4113 showIndent(outfile, level)4114 outfile.write('model_.highlight(\n')4115 highlight.exportLiteral(outfile, level, name_='highlight')4116 showIndent(outfile, level)4117 outfile.write('),\n')4118 level -= 14119 showIndent(outfile, level)4120 outfile.write('],\n')4121 def build(self, node_):4122 attrs = node_.attributes4123 self.buildAttributes(attrs)4124 for child_ in node_.childNodes:4125 nodeName_ = child_.nodeName.split(':')[-1]4126 self.buildChildren(child_, nodeName_)4127 def buildAttributes(self, attrs):4128 if attrs.get('external'):4129 self.external = attrs.get('external').value4130 if attrs.get('lineno'):4131 try:4132 self.lineno = int(attrs.get('lineno').value)4133 except ValueError as exp:4134 raise ValueError('Bad integer attribute (lineno): %s' % exp)4135 if attrs.get('refkind'):4136 self.refkind = attrs.get('refkind').value4137 if attrs.get('refid'):4138 self.refid = attrs.get('refid').value4139 def buildChildren(self, child_, nodeName_):4140 if child_.nodeType == Node.ELEMENT_NODE and \4141 nodeName_ == 'highlight':4142 obj_ = highlightType.factory()4143 obj_.build(child_)4144 self.highlight.append(obj_)4145# end class codelineType4146class highlightType(GeneratedsSuper):4147 subclass = None4148 superclass = None4149 def __init__(self, classxx=None, sp=None, ref=None, mixedclass_=None, content_=None):4150 self.classxx = classxx4151 if mixedclass_ is None:4152 self.mixedclass_ = MixedContainer4153 else:4154 self.mixedclass_ = mixedclass_4155 if content_ is None:4156 self.content_ = []4157 else:4158 self.content_ = content_4159 def factory(*args_, **kwargs_):4160 if highlightType.subclass:4161 return highlightType.subclass(*args_, **kwargs_)4162 else:4163 return highlightType(*args_, **kwargs_)4164 factory = staticmethod(factory)4165 def get_sp(self): return self.sp4166 def set_sp(self, sp): self.sp = sp4167 def add_sp(self, value): self.sp.append(value)4168 def insert_sp(self, index, value): self.sp[index] = value4169 def get_ref(self): return self.ref4170 def set_ref(self, ref): self.ref = ref4171 def add_ref(self, value): self.ref.append(value)4172 def insert_ref(self, index, value): self.ref[index] = value4173 def get_class(self): return self.classxx4174 def set_class(self, classxx): self.classxx = classxx4175 def export(self, outfile, level, namespace_='', name_='highlightType', namespacedef_=''):4176 showIndent(outfile, level)4177 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4178 self.exportAttributes(outfile, level, namespace_, name_='highlightType')4179 outfile.write('>')4180 self.exportChildren(outfile, level + 1, namespace_, name_)4181 outfile.write('</%s%s>\n' % (namespace_, name_))4182 def exportAttributes(self, outfile, level, namespace_='', name_='highlightType'):4183 if self.classxx is not None:4184 outfile.write(' class=%s' % (quote_attrib(self.classxx), ))4185 def exportChildren(self, outfile, level, namespace_='', name_='highlightType'):4186 for item_ in self.content_:4187 item_.export(outfile, level, item_.name, namespace_)4188 def hasContent_(self):4189 if (4190 self.sp is not None or4191 self.ref is not None4192 ):4193 return True4194 else:4195 return False4196 def exportLiteral(self, outfile, level, name_='highlightType'):4197 level += 14198 self.exportLiteralAttributes(outfile, level, name_)4199 if self.hasContent_():4200 self.exportLiteralChildren(outfile, level, name_)4201 def exportLiteralAttributes(self, outfile, level, name_):4202 if self.classxx is not None:4203 showIndent(outfile, level)4204 outfile.write('classxx = "%s",\n' % (self.classxx,))4205 def exportLiteralChildren(self, outfile, level, name_):4206 showIndent(outfile, level)4207 outfile.write('content_ = [\n')4208 for item_ in self.content_:4209 item_.exportLiteral(outfile, level, name_)4210 showIndent(outfile, level)4211 outfile.write('],\n')4212 showIndent(outfile, level)4213 outfile.write('content_ = [\n')4214 for item_ in self.content_:4215 item_.exportLiteral(outfile, level, name_)4216 showIndent(outfile, level)4217 outfile.write('],\n')4218 def build(self, node_):4219 attrs = node_.attributes4220 self.buildAttributes(attrs)4221 for child_ in node_.childNodes:4222 nodeName_ = child_.nodeName.split(':')[-1]4223 self.buildChildren(child_, nodeName_)4224 def buildAttributes(self, attrs):4225 if attrs.get('class'):4226 self.classxx = attrs.get('class').value4227 def buildChildren(self, child_, nodeName_):4228 if child_.nodeType == Node.ELEMENT_NODE and \4229 nodeName_ == 'sp':4230 value_ = []4231 for text_ in child_.childNodes:4232 value_.append(text_.nodeValue)4233 valuestr_ = ''.join(value_)4234 obj_ = self.mixedclass_(MixedContainer.CategorySimple,4235 MixedContainer.TypeString, 'sp', valuestr_)4236 self.content_.append(obj_)4237 elif child_.nodeType == Node.ELEMENT_NODE and \4238 nodeName_ == 'ref':4239 childobj_ = docRefTextType.factory()4240 childobj_.build(child_)4241 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4242 MixedContainer.TypeNone, 'ref', childobj_)4243 self.content_.append(obj_)4244 elif child_.nodeType == Node.TEXT_NODE:4245 obj_ = self.mixedclass_(MixedContainer.CategoryText,4246 MixedContainer.TypeNone, '', child_.nodeValue)4247 self.content_.append(obj_)4248# end class highlightType4249class sp(GeneratedsSuper):4250 subclass = None4251 superclass = None4252 def __init__(self, valueOf_=''):4253 self.valueOf_ = valueOf_4254 def factory(*args_, **kwargs_):4255 if sp.subclass:4256 return sp.subclass(*args_, **kwargs_)4257 else:4258 return sp(*args_, **kwargs_)4259 factory = staticmethod(factory)4260 def getValueOf_(self): return self.valueOf_4261 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4262 def export(self, outfile, level, namespace_='', name_='sp', namespacedef_=''):4263 showIndent(outfile, level)4264 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4265 self.exportAttributes(outfile, level, namespace_, name_='sp')4266 if self.hasContent_():4267 outfile.write('>\n')4268 self.exportChildren(outfile, level + 1, namespace_, name_)4269 showIndent(outfile, level)4270 outfile.write('</%s%s>\n' % (namespace_, name_))4271 else:4272 outfile.write(' />\n')4273 def exportAttributes(self, outfile, level, namespace_='', name_='sp'):4274 pass4275 def exportChildren(self, outfile, level, namespace_='', name_='sp'):4276 if self.valueOf_.find('![CDATA')>-1:4277 value=quote_xml('%s' % self.valueOf_)4278 value=value.replace('![CDATA','<![CDATA')4279 value=value.replace(']]',']]>')4280 outfile.write(value)4281 else:4282 outfile.write(quote_xml('%s' % self.valueOf_))4283 def hasContent_(self):4284 if (4285 self.valueOf_ is not None4286 ):4287 return True4288 else:4289 return False4290 def exportLiteral(self, outfile, level, name_='sp'):4291 level += 14292 self.exportLiteralAttributes(outfile, level, name_)4293 if self.hasContent_():4294 self.exportLiteralChildren(outfile, level, name_)4295 def exportLiteralAttributes(self, outfile, level, name_):4296 pass4297 def exportLiteralChildren(self, outfile, level, name_):4298 showIndent(outfile, level)4299 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))4300 def build(self, node_):4301 attrs = node_.attributes4302 self.buildAttributes(attrs)4303 self.valueOf_ = ''4304 for child_ in node_.childNodes:4305 nodeName_ = child_.nodeName.split(':')[-1]4306 self.buildChildren(child_, nodeName_)4307 def buildAttributes(self, attrs):4308 pass4309 def buildChildren(self, child_, nodeName_):4310 if child_.nodeType == Node.TEXT_NODE:4311 self.valueOf_ += child_.nodeValue4312 elif child_.nodeType == Node.CDATA_SECTION_NODE:4313 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4314# end class sp4315class referenceType(GeneratedsSuper):4316 subclass = None4317 superclass = None4318 def __init__(self, endline=None, startline=None, refid=None, compoundref=None, valueOf_='', mixedclass_=None, content_=None):4319 self.endline = endline4320 self.startline = startline4321 self.refid = refid4322 self.compoundref = compoundref4323 if mixedclass_ is None:4324 self.mixedclass_ = MixedContainer4325 else:4326 self.mixedclass_ = mixedclass_4327 if content_ is None:4328 self.content_ = []4329 else:4330 self.content_ = content_4331 def factory(*args_, **kwargs_):4332 if referenceType.subclass:4333 return referenceType.subclass(*args_, **kwargs_)4334 else:4335 return referenceType(*args_, **kwargs_)4336 factory = staticmethod(factory)4337 def get_endline(self): return self.endline4338 def set_endline(self, endline): self.endline = endline4339 def get_startline(self): return self.startline4340 def set_startline(self, startline): self.startline = startline4341 def get_refid(self): return self.refid4342 def set_refid(self, refid): self.refid = refid4343 def get_compoundref(self): return self.compoundref4344 def set_compoundref(self, compoundref): self.compoundref = compoundref4345 def getValueOf_(self): return self.valueOf_4346 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4347 def export(self, outfile, level, namespace_='', name_='referenceType', namespacedef_=''):4348 showIndent(outfile, level)4349 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4350 self.exportAttributes(outfile, level, namespace_, name_='referenceType')4351 outfile.write('>')4352 self.exportChildren(outfile, level + 1, namespace_, name_)4353 outfile.write('</%s%s>\n' % (namespace_, name_))4354 def exportAttributes(self, outfile, level, namespace_='', name_='referenceType'):4355 if self.endline is not None:4356 outfile.write(' endline="%s"' % self.format_integer(self.endline, input_name='endline'))4357 if self.startline is not None:4358 outfile.write(' startline="%s"' % self.format_integer(self.startline, input_name='startline'))4359 if self.refid is not None:4360 outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))4361 if self.compoundref is not None:4362 outfile.write(' compoundref=%s' % (self.format_string(quote_attrib(self.compoundref).encode(ExternalEncoding), input_name='compoundref'), ))4363 def exportChildren(self, outfile, level, namespace_='', name_='referenceType'):4364 if self.valueOf_.find('![CDATA')>-1:4365 value=quote_xml('%s' % self.valueOf_)4366 value=value.replace('![CDATA','<![CDATA')4367 value=value.replace(']]',']]>')4368 outfile.write(value)4369 else:4370 outfile.write(quote_xml('%s' % self.valueOf_))4371 def hasContent_(self):4372 if (4373 self.valueOf_ is not None4374 ):4375 return True4376 else:4377 return False4378 def exportLiteral(self, outfile, level, name_='referenceType'):4379 level += 14380 self.exportLiteralAttributes(outfile, level, name_)4381 if self.hasContent_():4382 self.exportLiteralChildren(outfile, level, name_)4383 def exportLiteralAttributes(self, outfile, level, name_):4384 if self.endline is not None:4385 showIndent(outfile, level)4386 outfile.write('endline = %s,\n' % (self.endline,))4387 if self.startline is not None:4388 showIndent(outfile, level)4389 outfile.write('startline = %s,\n' % (self.startline,))4390 if self.refid is not None:4391 showIndent(outfile, level)4392 outfile.write('refid = %s,\n' % (self.refid,))4393 if self.compoundref is not None:4394 showIndent(outfile, level)4395 outfile.write('compoundref = %s,\n' % (self.compoundref,))4396 def exportLiteralChildren(self, outfile, level, name_):4397 showIndent(outfile, level)4398 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))4399 def build(self, node_):4400 attrs = node_.attributes4401 self.buildAttributes(attrs)4402 self.valueOf_ = ''4403 for child_ in node_.childNodes:4404 nodeName_ = child_.nodeName.split(':')[-1]4405 self.buildChildren(child_, nodeName_)4406 def buildAttributes(self, attrs):4407 if attrs.get('endline'):4408 try:4409 self.endline = int(attrs.get('endline').value)4410 except ValueError as exp:4411 raise ValueError('Bad integer attribute (endline): %s' % exp)4412 if attrs.get('startline'):4413 try:4414 self.startline = int(attrs.get('startline').value)4415 except ValueError as exp:4416 raise ValueError('Bad integer attribute (startline): %s' % exp)4417 if attrs.get('refid'):4418 self.refid = attrs.get('refid').value4419 if attrs.get('compoundref'):4420 self.compoundref = attrs.get('compoundref').value4421 def buildChildren(self, child_, nodeName_):4422 if child_.nodeType == Node.TEXT_NODE:4423 obj_ = self.mixedclass_(MixedContainer.CategoryText,4424 MixedContainer.TypeNone, '', child_.nodeValue)4425 self.content_.append(obj_)4426 if child_.nodeType == Node.TEXT_NODE:4427 self.valueOf_ += child_.nodeValue4428 elif child_.nodeType == Node.CDATA_SECTION_NODE:4429 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4430# end class referenceType4431class locationType(GeneratedsSuper):4432 subclass = None4433 superclass = None4434 def __init__(self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=''):4435 self.bodystart = bodystart4436 self.line = line4437 self.bodyend = bodyend4438 self.bodyfile = bodyfile4439 self.file = file4440 self.valueOf_ = valueOf_4441 def factory(*args_, **kwargs_):4442 if locationType.subclass:4443 return locationType.subclass(*args_, **kwargs_)4444 else:4445 return locationType(*args_, **kwargs_)4446 factory = staticmethod(factory)4447 def get_bodystart(self): return self.bodystart4448 def set_bodystart(self, bodystart): self.bodystart = bodystart4449 def get_line(self): return self.line4450 def set_line(self, line): self.line = line4451 def get_bodyend(self): return self.bodyend4452 def set_bodyend(self, bodyend): self.bodyend = bodyend4453 def get_bodyfile(self): return self.bodyfile4454 def set_bodyfile(self, bodyfile): self.bodyfile = bodyfile4455 def get_file(self): return self.file4456 def set_file(self, file): self.file = file4457 def getValueOf_(self): return self.valueOf_4458 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_4459 def export(self, outfile, level, namespace_='', name_='locationType', namespacedef_=''):4460 showIndent(outfile, level)4461 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4462 self.exportAttributes(outfile, level, namespace_, name_='locationType')4463 if self.hasContent_():4464 outfile.write('>\n')4465 self.exportChildren(outfile, level + 1, namespace_, name_)4466 showIndent(outfile, level)4467 outfile.write('</%s%s>\n' % (namespace_, name_))4468 else:4469 outfile.write(' />\n')4470 def exportAttributes(self, outfile, level, namespace_='', name_='locationType'):4471 if self.bodystart is not None:4472 outfile.write(' bodystart="%s"' % self.format_integer(self.bodystart, input_name='bodystart'))4473 if self.line is not None:4474 outfile.write(' line="%s"' % self.format_integer(self.line, input_name='line'))4475 if self.bodyend is not None:4476 outfile.write(' bodyend="%s"' % self.format_integer(self.bodyend, input_name='bodyend'))4477 if self.bodyfile is not None:4478 outfile.write(' bodyfile=%s' % (self.format_string(quote_attrib(self.bodyfile).encode(ExternalEncoding), input_name='bodyfile'), ))4479 if self.file is not None:4480 outfile.write(' file=%s' % (self.format_string(quote_attrib(self.file).encode(ExternalEncoding), input_name='file'), ))4481 def exportChildren(self, outfile, level, namespace_='', name_='locationType'):4482 if self.valueOf_.find('![CDATA')>-1:4483 value=quote_xml('%s' % self.valueOf_)4484 value=value.replace('![CDATA','<![CDATA')4485 value=value.replace(']]',']]>')4486 outfile.write(value)4487 else:4488 outfile.write(quote_xml('%s' % self.valueOf_))4489 def hasContent_(self):4490 if (4491 self.valueOf_ is not None4492 ):4493 return True4494 else:4495 return False4496 def exportLiteral(self, outfile, level, name_='locationType'):4497 level += 14498 self.exportLiteralAttributes(outfile, level, name_)4499 if self.hasContent_():4500 self.exportLiteralChildren(outfile, level, name_)4501 def exportLiteralAttributes(self, outfile, level, name_):4502 if self.bodystart is not None:4503 showIndent(outfile, level)4504 outfile.write('bodystart = %s,\n' % (self.bodystart,))4505 if self.line is not None:4506 showIndent(outfile, level)4507 outfile.write('line = %s,\n' % (self.line,))4508 if self.bodyend is not None:4509 showIndent(outfile, level)4510 outfile.write('bodyend = %s,\n' % (self.bodyend,))4511 if self.bodyfile is not None:4512 showIndent(outfile, level)4513 outfile.write('bodyfile = %s,\n' % (self.bodyfile,))4514 if self.file is not None:4515 showIndent(outfile, level)4516 outfile.write('file = %s,\n' % (self.file,))4517 def exportLiteralChildren(self, outfile, level, name_):4518 showIndent(outfile, level)4519 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))4520 def build(self, node_):4521 attrs = node_.attributes4522 self.buildAttributes(attrs)4523 self.valueOf_ = ''4524 for child_ in node_.childNodes:4525 nodeName_ = child_.nodeName.split(':')[-1]4526 self.buildChildren(child_, nodeName_)4527 def buildAttributes(self, attrs):4528 if attrs.get('bodystart'):4529 try:4530 self.bodystart = int(attrs.get('bodystart').value)4531 except ValueError as exp:4532 raise ValueError('Bad integer attribute (bodystart): %s' % exp)4533 if attrs.get('line'):4534 try:4535 self.line = int(attrs.get('line').value)4536 except ValueError as exp:4537 raise ValueError('Bad integer attribute (line): %s' % exp)4538 if attrs.get('bodyend'):4539 try:4540 self.bodyend = int(attrs.get('bodyend').value)4541 except ValueError as exp:4542 raise ValueError('Bad integer attribute (bodyend): %s' % exp)4543 if attrs.get('bodyfile'):4544 self.bodyfile = attrs.get('bodyfile').value4545 if attrs.get('file'):4546 self.file = attrs.get('file').value4547 def buildChildren(self, child_, nodeName_):4548 if child_.nodeType == Node.TEXT_NODE:4549 self.valueOf_ += child_.nodeValue4550 elif child_.nodeType == Node.CDATA_SECTION_NODE:4551 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'4552# end class locationType4553class docSect1Type(GeneratedsSuper):4554 subclass = None4555 superclass = None4556 def __init__(self, id=None, title=None, para=None, sect2=None, internal=None, mixedclass_=None, content_=None):4557 self.id = id4558 if mixedclass_ is None:4559 self.mixedclass_ = MixedContainer4560 else:4561 self.mixedclass_ = mixedclass_4562 if content_ is None:4563 self.content_ = []4564 else:4565 self.content_ = content_4566 def factory(*args_, **kwargs_):4567 if docSect1Type.subclass:4568 return docSect1Type.subclass(*args_, **kwargs_)4569 else:4570 return docSect1Type(*args_, **kwargs_)4571 factory = staticmethod(factory)4572 def get_title(self): return self.title4573 def set_title(self, title): self.title = title4574 def get_para(self): return self.para4575 def set_para(self, para): self.para = para4576 def add_para(self, value): self.para.append(value)4577 def insert_para(self, index, value): self.para[index] = value4578 def get_sect2(self): return self.sect24579 def set_sect2(self, sect2): self.sect2 = sect24580 def add_sect2(self, value): self.sect2.append(value)4581 def insert_sect2(self, index, value): self.sect2[index] = value4582 def get_internal(self): return self.internal4583 def set_internal(self, internal): self.internal = internal4584 def get_id(self): return self.id4585 def set_id(self, id): self.id = id4586 def export(self, outfile, level, namespace_='', name_='docSect1Type', namespacedef_=''):4587 showIndent(outfile, level)4588 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4589 self.exportAttributes(outfile, level, namespace_, name_='docSect1Type')4590 outfile.write('>')4591 self.exportChildren(outfile, level + 1, namespace_, name_)4592 outfile.write('</%s%s>\n' % (namespace_, name_))4593 def exportAttributes(self, outfile, level, namespace_='', name_='docSect1Type'):4594 if self.id is not None:4595 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4596 def exportChildren(self, outfile, level, namespace_='', name_='docSect1Type'):4597 for item_ in self.content_:4598 item_.export(outfile, level, item_.name, namespace_)4599 def hasContent_(self):4600 if (4601 self.title is not None or4602 self.para is not None or4603 self.sect2 is not None or4604 self.internal is not None4605 ):4606 return True4607 else:4608 return False4609 def exportLiteral(self, outfile, level, name_='docSect1Type'):4610 level += 14611 self.exportLiteralAttributes(outfile, level, name_)4612 if self.hasContent_():4613 self.exportLiteralChildren(outfile, level, name_)4614 def exportLiteralAttributes(self, outfile, level, name_):4615 if self.id is not None:4616 showIndent(outfile, level)4617 outfile.write('id = %s,\n' % (self.id,))4618 def exportLiteralChildren(self, outfile, level, name_):4619 showIndent(outfile, level)4620 outfile.write('content_ = [\n')4621 for item_ in self.content_:4622 item_.exportLiteral(outfile, level, name_)4623 showIndent(outfile, level)4624 outfile.write('],\n')4625 showIndent(outfile, level)4626 outfile.write('content_ = [\n')4627 for item_ in self.content_:4628 item_.exportLiteral(outfile, level, name_)4629 showIndent(outfile, level)4630 outfile.write('],\n')4631 showIndent(outfile, level)4632 outfile.write('content_ = [\n')4633 for item_ in self.content_:4634 item_.exportLiteral(outfile, level, name_)4635 showIndent(outfile, level)4636 outfile.write('],\n')4637 showIndent(outfile, level)4638 outfile.write('content_ = [\n')4639 for item_ in self.content_:4640 item_.exportLiteral(outfile, level, name_)4641 showIndent(outfile, level)4642 outfile.write('],\n')4643 def build(self, node_):4644 attrs = node_.attributes4645 self.buildAttributes(attrs)4646 for child_ in node_.childNodes:4647 nodeName_ = child_.nodeName.split(':')[-1]4648 self.buildChildren(child_, nodeName_)4649 def buildAttributes(self, attrs):4650 if attrs.get('id'):4651 self.id = attrs.get('id').value4652 def buildChildren(self, child_, nodeName_):4653 if child_.nodeType == Node.ELEMENT_NODE and \4654 nodeName_ == 'title':4655 childobj_ = docTitleType.factory()4656 childobj_.build(child_)4657 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4658 MixedContainer.TypeNone, 'title', childobj_)4659 self.content_.append(obj_)4660 elif child_.nodeType == Node.ELEMENT_NODE and \4661 nodeName_ == 'para':4662 childobj_ = docParaType.factory()4663 childobj_.build(child_)4664 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4665 MixedContainer.TypeNone, 'para', childobj_)4666 self.content_.append(obj_)4667 elif child_.nodeType == Node.ELEMENT_NODE and \4668 nodeName_ == 'sect2':4669 childobj_ = docSect2Type.factory()4670 childobj_.build(child_)4671 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4672 MixedContainer.TypeNone, 'sect2', childobj_)4673 self.content_.append(obj_)4674 elif child_.nodeType == Node.ELEMENT_NODE and \4675 nodeName_ == 'internal':4676 childobj_ = docInternalS1Type.factory()4677 childobj_.build(child_)4678 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4679 MixedContainer.TypeNone, 'internal', childobj_)4680 self.content_.append(obj_)4681 elif child_.nodeType == Node.TEXT_NODE:4682 obj_ = self.mixedclass_(MixedContainer.CategoryText,4683 MixedContainer.TypeNone, '', child_.nodeValue)4684 self.content_.append(obj_)4685# end class docSect1Type4686class docSect2Type(GeneratedsSuper):4687 subclass = None4688 superclass = None4689 def __init__(self, id=None, title=None, para=None, sect3=None, internal=None, mixedclass_=None, content_=None):4690 self.id = id4691 if mixedclass_ is None:4692 self.mixedclass_ = MixedContainer4693 else:4694 self.mixedclass_ = mixedclass_4695 if content_ is None:4696 self.content_ = []4697 else:4698 self.content_ = content_4699 def factory(*args_, **kwargs_):4700 if docSect2Type.subclass:4701 return docSect2Type.subclass(*args_, **kwargs_)4702 else:4703 return docSect2Type(*args_, **kwargs_)4704 factory = staticmethod(factory)4705 def get_title(self): return self.title4706 def set_title(self, title): self.title = title4707 def get_para(self): return self.para4708 def set_para(self, para): self.para = para4709 def add_para(self, value): self.para.append(value)4710 def insert_para(self, index, value): self.para[index] = value4711 def get_sect3(self): return self.sect34712 def set_sect3(self, sect3): self.sect3 = sect34713 def add_sect3(self, value): self.sect3.append(value)4714 def insert_sect3(self, index, value): self.sect3[index] = value4715 def get_internal(self): return self.internal4716 def set_internal(self, internal): self.internal = internal4717 def get_id(self): return self.id4718 def set_id(self, id): self.id = id4719 def export(self, outfile, level, namespace_='', name_='docSect2Type', namespacedef_=''):4720 showIndent(outfile, level)4721 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4722 self.exportAttributes(outfile, level, namespace_, name_='docSect2Type')4723 outfile.write('>')4724 self.exportChildren(outfile, level + 1, namespace_, name_)4725 outfile.write('</%s%s>\n' % (namespace_, name_))4726 def exportAttributes(self, outfile, level, namespace_='', name_='docSect2Type'):4727 if self.id is not None:4728 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4729 def exportChildren(self, outfile, level, namespace_='', name_='docSect2Type'):4730 for item_ in self.content_:4731 item_.export(outfile, level, item_.name, namespace_)4732 def hasContent_(self):4733 if (4734 self.title is not None or4735 self.para is not None or4736 self.sect3 is not None or4737 self.internal is not None4738 ):4739 return True4740 else:4741 return False4742 def exportLiteral(self, outfile, level, name_='docSect2Type'):4743 level += 14744 self.exportLiteralAttributes(outfile, level, name_)4745 if self.hasContent_():4746 self.exportLiteralChildren(outfile, level, name_)4747 def exportLiteralAttributes(self, outfile, level, name_):4748 if self.id is not None:4749 showIndent(outfile, level)4750 outfile.write('id = %s,\n' % (self.id,))4751 def exportLiteralChildren(self, outfile, level, name_):4752 showIndent(outfile, level)4753 outfile.write('content_ = [\n')4754 for item_ in self.content_:4755 item_.exportLiteral(outfile, level, name_)4756 showIndent(outfile, level)4757 outfile.write('],\n')4758 showIndent(outfile, level)4759 outfile.write('content_ = [\n')4760 for item_ in self.content_:4761 item_.exportLiteral(outfile, level, name_)4762 showIndent(outfile, level)4763 outfile.write('],\n')4764 showIndent(outfile, level)4765 outfile.write('content_ = [\n')4766 for item_ in self.content_:4767 item_.exportLiteral(outfile, level, name_)4768 showIndent(outfile, level)4769 outfile.write('],\n')4770 showIndent(outfile, level)4771 outfile.write('content_ = [\n')4772 for item_ in self.content_:4773 item_.exportLiteral(outfile, level, name_)4774 showIndent(outfile, level)4775 outfile.write('],\n')4776 def build(self, node_):4777 attrs = node_.attributes4778 self.buildAttributes(attrs)4779 for child_ in node_.childNodes:4780 nodeName_ = child_.nodeName.split(':')[-1]4781 self.buildChildren(child_, nodeName_)4782 def buildAttributes(self, attrs):4783 if attrs.get('id'):4784 self.id = attrs.get('id').value4785 def buildChildren(self, child_, nodeName_):4786 if child_.nodeType == Node.ELEMENT_NODE and \4787 nodeName_ == 'title':4788 childobj_ = docTitleType.factory()4789 childobj_.build(child_)4790 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4791 MixedContainer.TypeNone, 'title', childobj_)4792 self.content_.append(obj_)4793 elif child_.nodeType == Node.ELEMENT_NODE and \4794 nodeName_ == 'para':4795 childobj_ = docParaType.factory()4796 childobj_.build(child_)4797 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4798 MixedContainer.TypeNone, 'para', childobj_)4799 self.content_.append(obj_)4800 elif child_.nodeType == Node.ELEMENT_NODE and \4801 nodeName_ == 'sect3':4802 childobj_ = docSect3Type.factory()4803 childobj_.build(child_)4804 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4805 MixedContainer.TypeNone, 'sect3', childobj_)4806 self.content_.append(obj_)4807 elif child_.nodeType == Node.ELEMENT_NODE and \4808 nodeName_ == 'internal':4809 childobj_ = docInternalS2Type.factory()4810 childobj_.build(child_)4811 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4812 MixedContainer.TypeNone, 'internal', childobj_)4813 self.content_.append(obj_)4814 elif child_.nodeType == Node.TEXT_NODE:4815 obj_ = self.mixedclass_(MixedContainer.CategoryText,4816 MixedContainer.TypeNone, '', child_.nodeValue)4817 self.content_.append(obj_)4818# end class docSect2Type4819class docSect3Type(GeneratedsSuper):4820 subclass = None4821 superclass = None4822 def __init__(self, id=None, title=None, para=None, sect4=None, internal=None, mixedclass_=None, content_=None):4823 self.id = id4824 if mixedclass_ is None:4825 self.mixedclass_ = MixedContainer4826 else:4827 self.mixedclass_ = mixedclass_4828 if content_ is None:4829 self.content_ = []4830 else:4831 self.content_ = content_4832 def factory(*args_, **kwargs_):4833 if docSect3Type.subclass:4834 return docSect3Type.subclass(*args_, **kwargs_)4835 else:4836 return docSect3Type(*args_, **kwargs_)4837 factory = staticmethod(factory)4838 def get_title(self): return self.title4839 def set_title(self, title): self.title = title4840 def get_para(self): return self.para4841 def set_para(self, para): self.para = para4842 def add_para(self, value): self.para.append(value)4843 def insert_para(self, index, value): self.para[index] = value4844 def get_sect4(self): return self.sect44845 def set_sect4(self, sect4): self.sect4 = sect44846 def add_sect4(self, value): self.sect4.append(value)4847 def insert_sect4(self, index, value): self.sect4[index] = value4848 def get_internal(self): return self.internal4849 def set_internal(self, internal): self.internal = internal4850 def get_id(self): return self.id4851 def set_id(self, id): self.id = id4852 def export(self, outfile, level, namespace_='', name_='docSect3Type', namespacedef_=''):4853 showIndent(outfile, level)4854 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4855 self.exportAttributes(outfile, level, namespace_, name_='docSect3Type')4856 outfile.write('>')4857 self.exportChildren(outfile, level + 1, namespace_, name_)4858 outfile.write('</%s%s>\n' % (namespace_, name_))4859 def exportAttributes(self, outfile, level, namespace_='', name_='docSect3Type'):4860 if self.id is not None:4861 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4862 def exportChildren(self, outfile, level, namespace_='', name_='docSect3Type'):4863 for item_ in self.content_:4864 item_.export(outfile, level, item_.name, namespace_)4865 def hasContent_(self):4866 if (4867 self.title is not None or4868 self.para is not None or4869 self.sect4 is not None or4870 self.internal is not None4871 ):4872 return True4873 else:4874 return False4875 def exportLiteral(self, outfile, level, name_='docSect3Type'):4876 level += 14877 self.exportLiteralAttributes(outfile, level, name_)4878 if self.hasContent_():4879 self.exportLiteralChildren(outfile, level, name_)4880 def exportLiteralAttributes(self, outfile, level, name_):4881 if self.id is not None:4882 showIndent(outfile, level)4883 outfile.write('id = %s,\n' % (self.id,))4884 def exportLiteralChildren(self, outfile, level, name_):4885 showIndent(outfile, level)4886 outfile.write('content_ = [\n')4887 for item_ in self.content_:4888 item_.exportLiteral(outfile, level, name_)4889 showIndent(outfile, level)4890 outfile.write('],\n')4891 showIndent(outfile, level)4892 outfile.write('content_ = [\n')4893 for item_ in self.content_:4894 item_.exportLiteral(outfile, level, name_)4895 showIndent(outfile, level)4896 outfile.write('],\n')4897 showIndent(outfile, level)4898 outfile.write('content_ = [\n')4899 for item_ in self.content_:4900 item_.exportLiteral(outfile, level, name_)4901 showIndent(outfile, level)4902 outfile.write('],\n')4903 showIndent(outfile, level)4904 outfile.write('content_ = [\n')4905 for item_ in self.content_:4906 item_.exportLiteral(outfile, level, name_)4907 showIndent(outfile, level)4908 outfile.write('],\n')4909 def build(self, node_):4910 attrs = node_.attributes4911 self.buildAttributes(attrs)4912 for child_ in node_.childNodes:4913 nodeName_ = child_.nodeName.split(':')[-1]4914 self.buildChildren(child_, nodeName_)4915 def buildAttributes(self, attrs):4916 if attrs.get('id'):4917 self.id = attrs.get('id').value4918 def buildChildren(self, child_, nodeName_):4919 if child_.nodeType == Node.ELEMENT_NODE and \4920 nodeName_ == 'title':4921 childobj_ = docTitleType.factory()4922 childobj_.build(child_)4923 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4924 MixedContainer.TypeNone, 'title', childobj_)4925 self.content_.append(obj_)4926 elif child_.nodeType == Node.ELEMENT_NODE and \4927 nodeName_ == 'para':4928 childobj_ = docParaType.factory()4929 childobj_.build(child_)4930 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4931 MixedContainer.TypeNone, 'para', childobj_)4932 self.content_.append(obj_)4933 elif child_.nodeType == Node.ELEMENT_NODE and \4934 nodeName_ == 'sect4':4935 childobj_ = docSect4Type.factory()4936 childobj_.build(child_)4937 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4938 MixedContainer.TypeNone, 'sect4', childobj_)4939 self.content_.append(obj_)4940 elif child_.nodeType == Node.ELEMENT_NODE and \4941 nodeName_ == 'internal':4942 childobj_ = docInternalS3Type.factory()4943 childobj_.build(child_)4944 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,4945 MixedContainer.TypeNone, 'internal', childobj_)4946 self.content_.append(obj_)4947 elif child_.nodeType == Node.TEXT_NODE:4948 obj_ = self.mixedclass_(MixedContainer.CategoryText,4949 MixedContainer.TypeNone, '', child_.nodeValue)4950 self.content_.append(obj_)4951# end class docSect3Type4952class docSect4Type(GeneratedsSuper):4953 subclass = None4954 superclass = None4955 def __init__(self, id=None, title=None, para=None, internal=None, mixedclass_=None, content_=None):4956 self.id = id4957 if mixedclass_ is None:4958 self.mixedclass_ = MixedContainer4959 else:4960 self.mixedclass_ = mixedclass_4961 if content_ is None:4962 self.content_ = []4963 else:4964 self.content_ = content_4965 def factory(*args_, **kwargs_):4966 if docSect4Type.subclass:4967 return docSect4Type.subclass(*args_, **kwargs_)4968 else:4969 return docSect4Type(*args_, **kwargs_)4970 factory = staticmethod(factory)4971 def get_title(self): return self.title4972 def set_title(self, title): self.title = title4973 def get_para(self): return self.para4974 def set_para(self, para): self.para = para4975 def add_para(self, value): self.para.append(value)4976 def insert_para(self, index, value): self.para[index] = value4977 def get_internal(self): return self.internal4978 def set_internal(self, internal): self.internal = internal4979 def get_id(self): return self.id4980 def set_id(self, id): self.id = id4981 def export(self, outfile, level, namespace_='', name_='docSect4Type', namespacedef_=''):4982 showIndent(outfile, level)4983 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))4984 self.exportAttributes(outfile, level, namespace_, name_='docSect4Type')4985 outfile.write('>')4986 self.exportChildren(outfile, level + 1, namespace_, name_)4987 outfile.write('</%s%s>\n' % (namespace_, name_))4988 def exportAttributes(self, outfile, level, namespace_='', name_='docSect4Type'):4989 if self.id is not None:4990 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))4991 def exportChildren(self, outfile, level, namespace_='', name_='docSect4Type'):4992 for item_ in self.content_:4993 item_.export(outfile, level, item_.name, namespace_)4994 def hasContent_(self):4995 if (4996 self.title is not None or4997 self.para is not None or4998 self.internal is not None4999 ):5000 return True5001 else:5002 return False5003 def exportLiteral(self, outfile, level, name_='docSect4Type'):5004 level += 15005 self.exportLiteralAttributes(outfile, level, name_)5006 if self.hasContent_():5007 self.exportLiteralChildren(outfile, level, name_)5008 def exportLiteralAttributes(self, outfile, level, name_):5009 if self.id is not None:5010 showIndent(outfile, level)5011 outfile.write('id = %s,\n' % (self.id,))5012 def exportLiteralChildren(self, outfile, level, name_):5013 showIndent(outfile, level)5014 outfile.write('content_ = [\n')5015 for item_ in self.content_:5016 item_.exportLiteral(outfile, level, name_)5017 showIndent(outfile, level)5018 outfile.write('],\n')5019 showIndent(outfile, level)5020 outfile.write('content_ = [\n')5021 for item_ in self.content_:5022 item_.exportLiteral(outfile, level, name_)5023 showIndent(outfile, level)5024 outfile.write('],\n')5025 showIndent(outfile, level)5026 outfile.write('content_ = [\n')5027 for item_ in self.content_:5028 item_.exportLiteral(outfile, level, name_)5029 showIndent(outfile, level)5030 outfile.write('],\n')5031 def build(self, node_):5032 attrs = node_.attributes5033 self.buildAttributes(attrs)5034 for child_ in node_.childNodes:5035 nodeName_ = child_.nodeName.split(':')[-1]5036 self.buildChildren(child_, nodeName_)5037 def buildAttributes(self, attrs):5038 if attrs.get('id'):5039 self.id = attrs.get('id').value5040 def buildChildren(self, child_, nodeName_):5041 if child_.nodeType == Node.ELEMENT_NODE and \5042 nodeName_ == 'title':5043 childobj_ = docTitleType.factory()5044 childobj_.build(child_)5045 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5046 MixedContainer.TypeNone, 'title', childobj_)5047 self.content_.append(obj_)5048 elif child_.nodeType == Node.ELEMENT_NODE and \5049 nodeName_ == 'para':5050 childobj_ = docParaType.factory()5051 childobj_.build(child_)5052 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5053 MixedContainer.TypeNone, 'para', childobj_)5054 self.content_.append(obj_)5055 elif child_.nodeType == Node.ELEMENT_NODE and \5056 nodeName_ == 'internal':5057 childobj_ = docInternalS4Type.factory()5058 childobj_.build(child_)5059 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5060 MixedContainer.TypeNone, 'internal', childobj_)5061 self.content_.append(obj_)5062 elif child_.nodeType == Node.TEXT_NODE:5063 obj_ = self.mixedclass_(MixedContainer.CategoryText,5064 MixedContainer.TypeNone, '', child_.nodeValue)5065 self.content_.append(obj_)5066# end class docSect4Type5067class docInternalType(GeneratedsSuper):5068 subclass = None5069 superclass = None5070 def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None):5071 if mixedclass_ is None:5072 self.mixedclass_ = MixedContainer5073 else:5074 self.mixedclass_ = mixedclass_5075 if content_ is None:5076 self.content_ = []5077 else:5078 self.content_ = content_5079 def factory(*args_, **kwargs_):5080 if docInternalType.subclass:5081 return docInternalType.subclass(*args_, **kwargs_)5082 else:5083 return docInternalType(*args_, **kwargs_)5084 factory = staticmethod(factory)5085 def get_para(self): return self.para5086 def set_para(self, para): self.para = para5087 def add_para(self, value): self.para.append(value)5088 def insert_para(self, index, value): self.para[index] = value5089 def get_sect1(self): return self.sect15090 def set_sect1(self, sect1): self.sect1 = sect15091 def add_sect1(self, value): self.sect1.append(value)5092 def insert_sect1(self, index, value): self.sect1[index] = value5093 def export(self, outfile, level, namespace_='', name_='docInternalType', namespacedef_=''):5094 showIndent(outfile, level)5095 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5096 self.exportAttributes(outfile, level, namespace_, name_='docInternalType')5097 outfile.write('>')5098 self.exportChildren(outfile, level + 1, namespace_, name_)5099 outfile.write('</%s%s>\n' % (namespace_, name_))5100 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalType'):5101 pass5102 def exportChildren(self, outfile, level, namespace_='', name_='docInternalType'):5103 for item_ in self.content_:5104 item_.export(outfile, level, item_.name, namespace_)5105 def hasContent_(self):5106 if (5107 self.para is not None or5108 self.sect1 is not None5109 ):5110 return True5111 else:5112 return False5113 def exportLiteral(self, outfile, level, name_='docInternalType'):5114 level += 15115 self.exportLiteralAttributes(outfile, level, name_)5116 if self.hasContent_():5117 self.exportLiteralChildren(outfile, level, name_)5118 def exportLiteralAttributes(self, outfile, level, name_):5119 pass5120 def exportLiteralChildren(self, outfile, level, name_):5121 showIndent(outfile, level)5122 outfile.write('content_ = [\n')5123 for item_ in self.content_:5124 item_.exportLiteral(outfile, level, name_)5125 showIndent(outfile, level)5126 outfile.write('],\n')5127 showIndent(outfile, level)5128 outfile.write('content_ = [\n')5129 for item_ in self.content_:5130 item_.exportLiteral(outfile, level, name_)5131 showIndent(outfile, level)5132 outfile.write('],\n')5133 def build(self, node_):5134 attrs = node_.attributes5135 self.buildAttributes(attrs)5136 for child_ in node_.childNodes:5137 nodeName_ = child_.nodeName.split(':')[-1]5138 self.buildChildren(child_, nodeName_)5139 def buildAttributes(self, attrs):5140 pass5141 def buildChildren(self, child_, nodeName_):5142 if child_.nodeType == Node.ELEMENT_NODE and \5143 nodeName_ == 'para':5144 childobj_ = docParaType.factory()5145 childobj_.build(child_)5146 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5147 MixedContainer.TypeNone, 'para', childobj_)5148 self.content_.append(obj_)5149 elif child_.nodeType == Node.ELEMENT_NODE and \5150 nodeName_ == 'sect1':5151 childobj_ = docSect1Type.factory()5152 childobj_.build(child_)5153 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5154 MixedContainer.TypeNone, 'sect1', childobj_)5155 self.content_.append(obj_)5156 elif child_.nodeType == Node.TEXT_NODE:5157 obj_ = self.mixedclass_(MixedContainer.CategoryText,5158 MixedContainer.TypeNone, '', child_.nodeValue)5159 self.content_.append(obj_)5160# end class docInternalType5161class docInternalS1Type(GeneratedsSuper):5162 subclass = None5163 superclass = None5164 def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None):5165 if mixedclass_ is None:5166 self.mixedclass_ = MixedContainer5167 else:5168 self.mixedclass_ = mixedclass_5169 if content_ is None:5170 self.content_ = []5171 else:5172 self.content_ = content_5173 def factory(*args_, **kwargs_):5174 if docInternalS1Type.subclass:5175 return docInternalS1Type.subclass(*args_, **kwargs_)5176 else:5177 return docInternalS1Type(*args_, **kwargs_)5178 factory = staticmethod(factory)5179 def get_para(self): return self.para5180 def set_para(self, para): self.para = para5181 def add_para(self, value): self.para.append(value)5182 def insert_para(self, index, value): self.para[index] = value5183 def get_sect2(self): return self.sect25184 def set_sect2(self, sect2): self.sect2 = sect25185 def add_sect2(self, value): self.sect2.append(value)5186 def insert_sect2(self, index, value): self.sect2[index] = value5187 def export(self, outfile, level, namespace_='', name_='docInternalS1Type', namespacedef_=''):5188 showIndent(outfile, level)5189 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5190 self.exportAttributes(outfile, level, namespace_, name_='docInternalS1Type')5191 outfile.write('>')5192 self.exportChildren(outfile, level + 1, namespace_, name_)5193 outfile.write('</%s%s>\n' % (namespace_, name_))5194 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS1Type'):5195 pass5196 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS1Type'):5197 for item_ in self.content_:5198 item_.export(outfile, level, item_.name, namespace_)5199 def hasContent_(self):5200 if (5201 self.para is not None or5202 self.sect2 is not None5203 ):5204 return True5205 else:5206 return False5207 def exportLiteral(self, outfile, level, name_='docInternalS1Type'):5208 level += 15209 self.exportLiteralAttributes(outfile, level, name_)5210 if self.hasContent_():5211 self.exportLiteralChildren(outfile, level, name_)5212 def exportLiteralAttributes(self, outfile, level, name_):5213 pass5214 def exportLiteralChildren(self, outfile, level, name_):5215 showIndent(outfile, level)5216 outfile.write('content_ = [\n')5217 for item_ in self.content_:5218 item_.exportLiteral(outfile, level, name_)5219 showIndent(outfile, level)5220 outfile.write('],\n')5221 showIndent(outfile, level)5222 outfile.write('content_ = [\n')5223 for item_ in self.content_:5224 item_.exportLiteral(outfile, level, name_)5225 showIndent(outfile, level)5226 outfile.write('],\n')5227 def build(self, node_):5228 attrs = node_.attributes5229 self.buildAttributes(attrs)5230 for child_ in node_.childNodes:5231 nodeName_ = child_.nodeName.split(':')[-1]5232 self.buildChildren(child_, nodeName_)5233 def buildAttributes(self, attrs):5234 pass5235 def buildChildren(self, child_, nodeName_):5236 if child_.nodeType == Node.ELEMENT_NODE and \5237 nodeName_ == 'para':5238 childobj_ = docParaType.factory()5239 childobj_.build(child_)5240 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5241 MixedContainer.TypeNone, 'para', childobj_)5242 self.content_.append(obj_)5243 elif child_.nodeType == Node.ELEMENT_NODE and \5244 nodeName_ == 'sect2':5245 childobj_ = docSect2Type.factory()5246 childobj_.build(child_)5247 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5248 MixedContainer.TypeNone, 'sect2', childobj_)5249 self.content_.append(obj_)5250 elif child_.nodeType == Node.TEXT_NODE:5251 obj_ = self.mixedclass_(MixedContainer.CategoryText,5252 MixedContainer.TypeNone, '', child_.nodeValue)5253 self.content_.append(obj_)5254# end class docInternalS1Type5255class docInternalS2Type(GeneratedsSuper):5256 subclass = None5257 superclass = None5258 def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):5259 if mixedclass_ is None:5260 self.mixedclass_ = MixedContainer5261 else:5262 self.mixedclass_ = mixedclass_5263 if content_ is None:5264 self.content_ = []5265 else:5266 self.content_ = content_5267 def factory(*args_, **kwargs_):5268 if docInternalS2Type.subclass:5269 return docInternalS2Type.subclass(*args_, **kwargs_)5270 else:5271 return docInternalS2Type(*args_, **kwargs_)5272 factory = staticmethod(factory)5273 def get_para(self): return self.para5274 def set_para(self, para): self.para = para5275 def add_para(self, value): self.para.append(value)5276 def insert_para(self, index, value): self.para[index] = value5277 def get_sect3(self): return self.sect35278 def set_sect3(self, sect3): self.sect3 = sect35279 def add_sect3(self, value): self.sect3.append(value)5280 def insert_sect3(self, index, value): self.sect3[index] = value5281 def export(self, outfile, level, namespace_='', name_='docInternalS2Type', namespacedef_=''):5282 showIndent(outfile, level)5283 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5284 self.exportAttributes(outfile, level, namespace_, name_='docInternalS2Type')5285 outfile.write('>')5286 self.exportChildren(outfile, level + 1, namespace_, name_)5287 outfile.write('</%s%s>\n' % (namespace_, name_))5288 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS2Type'):5289 pass5290 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS2Type'):5291 for item_ in self.content_:5292 item_.export(outfile, level, item_.name, namespace_)5293 def hasContent_(self):5294 if (5295 self.para is not None or5296 self.sect3 is not None5297 ):5298 return True5299 else:5300 return False5301 def exportLiteral(self, outfile, level, name_='docInternalS2Type'):5302 level += 15303 self.exportLiteralAttributes(outfile, level, name_)5304 if self.hasContent_():5305 self.exportLiteralChildren(outfile, level, name_)5306 def exportLiteralAttributes(self, outfile, level, name_):5307 pass5308 def exportLiteralChildren(self, outfile, level, name_):5309 showIndent(outfile, level)5310 outfile.write('content_ = [\n')5311 for item_ in self.content_:5312 item_.exportLiteral(outfile, level, name_)5313 showIndent(outfile, level)5314 outfile.write('],\n')5315 showIndent(outfile, level)5316 outfile.write('content_ = [\n')5317 for item_ in self.content_:5318 item_.exportLiteral(outfile, level, name_)5319 showIndent(outfile, level)5320 outfile.write('],\n')5321 def build(self, node_):5322 attrs = node_.attributes5323 self.buildAttributes(attrs)5324 for child_ in node_.childNodes:5325 nodeName_ = child_.nodeName.split(':')[-1]5326 self.buildChildren(child_, nodeName_)5327 def buildAttributes(self, attrs):5328 pass5329 def buildChildren(self, child_, nodeName_):5330 if child_.nodeType == Node.ELEMENT_NODE and \5331 nodeName_ == 'para':5332 childobj_ = docParaType.factory()5333 childobj_.build(child_)5334 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5335 MixedContainer.TypeNone, 'para', childobj_)5336 self.content_.append(obj_)5337 elif child_.nodeType == Node.ELEMENT_NODE and \5338 nodeName_ == 'sect3':5339 childobj_ = docSect3Type.factory()5340 childobj_.build(child_)5341 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5342 MixedContainer.TypeNone, 'sect3', childobj_)5343 self.content_.append(obj_)5344 elif child_.nodeType == Node.TEXT_NODE:5345 obj_ = self.mixedclass_(MixedContainer.CategoryText,5346 MixedContainer.TypeNone, '', child_.nodeValue)5347 self.content_.append(obj_)5348# end class docInternalS2Type5349class docInternalS3Type(GeneratedsSuper):5350 subclass = None5351 superclass = None5352 def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):5353 if mixedclass_ is None:5354 self.mixedclass_ = MixedContainer5355 else:5356 self.mixedclass_ = mixedclass_5357 if content_ is None:5358 self.content_ = []5359 else:5360 self.content_ = content_5361 def factory(*args_, **kwargs_):5362 if docInternalS3Type.subclass:5363 return docInternalS3Type.subclass(*args_, **kwargs_)5364 else:5365 return docInternalS3Type(*args_, **kwargs_)5366 factory = staticmethod(factory)5367 def get_para(self): return self.para5368 def set_para(self, para): self.para = para5369 def add_para(self, value): self.para.append(value)5370 def insert_para(self, index, value): self.para[index] = value5371 def get_sect3(self): return self.sect35372 def set_sect3(self, sect3): self.sect3 = sect35373 def add_sect3(self, value): self.sect3.append(value)5374 def insert_sect3(self, index, value): self.sect3[index] = value5375 def export(self, outfile, level, namespace_='', name_='docInternalS3Type', namespacedef_=''):5376 showIndent(outfile, level)5377 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5378 self.exportAttributes(outfile, level, namespace_, name_='docInternalS3Type')5379 outfile.write('>')5380 self.exportChildren(outfile, level + 1, namespace_, name_)5381 outfile.write('</%s%s>\n' % (namespace_, name_))5382 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS3Type'):5383 pass5384 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS3Type'):5385 for item_ in self.content_:5386 item_.export(outfile, level, item_.name, namespace_)5387 def hasContent_(self):5388 if (5389 self.para is not None or5390 self.sect3 is not None5391 ):5392 return True5393 else:5394 return False5395 def exportLiteral(self, outfile, level, name_='docInternalS3Type'):5396 level += 15397 self.exportLiteralAttributes(outfile, level, name_)5398 if self.hasContent_():5399 self.exportLiteralChildren(outfile, level, name_)5400 def exportLiteralAttributes(self, outfile, level, name_):5401 pass5402 def exportLiteralChildren(self, outfile, level, name_):5403 showIndent(outfile, level)5404 outfile.write('content_ = [\n')5405 for item_ in self.content_:5406 item_.exportLiteral(outfile, level, name_)5407 showIndent(outfile, level)5408 outfile.write('],\n')5409 showIndent(outfile, level)5410 outfile.write('content_ = [\n')5411 for item_ in self.content_:5412 item_.exportLiteral(outfile, level, name_)5413 showIndent(outfile, level)5414 outfile.write('],\n')5415 def build(self, node_):5416 attrs = node_.attributes5417 self.buildAttributes(attrs)5418 for child_ in node_.childNodes:5419 nodeName_ = child_.nodeName.split(':')[-1]5420 self.buildChildren(child_, nodeName_)5421 def buildAttributes(self, attrs):5422 pass5423 def buildChildren(self, child_, nodeName_):5424 if child_.nodeType == Node.ELEMENT_NODE and \5425 nodeName_ == 'para':5426 childobj_ = docParaType.factory()5427 childobj_.build(child_)5428 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5429 MixedContainer.TypeNone, 'para', childobj_)5430 self.content_.append(obj_)5431 elif child_.nodeType == Node.ELEMENT_NODE and \5432 nodeName_ == 'sect3':5433 childobj_ = docSect4Type.factory()5434 childobj_.build(child_)5435 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5436 MixedContainer.TypeNone, 'sect3', childobj_)5437 self.content_.append(obj_)5438 elif child_.nodeType == Node.TEXT_NODE:5439 obj_ = self.mixedclass_(MixedContainer.CategoryText,5440 MixedContainer.TypeNone, '', child_.nodeValue)5441 self.content_.append(obj_)5442# end class docInternalS3Type5443class docInternalS4Type(GeneratedsSuper):5444 subclass = None5445 superclass = None5446 def __init__(self, para=None, mixedclass_=None, content_=None):5447 if mixedclass_ is None:5448 self.mixedclass_ = MixedContainer5449 else:5450 self.mixedclass_ = mixedclass_5451 if content_ is None:5452 self.content_ = []5453 else:5454 self.content_ = content_5455 def factory(*args_, **kwargs_):5456 if docInternalS4Type.subclass:5457 return docInternalS4Type.subclass(*args_, **kwargs_)5458 else:5459 return docInternalS4Type(*args_, **kwargs_)5460 factory = staticmethod(factory)5461 def get_para(self): return self.para5462 def set_para(self, para): self.para = para5463 def add_para(self, value): self.para.append(value)5464 def insert_para(self, index, value): self.para[index] = value5465 def export(self, outfile, level, namespace_='', name_='docInternalS4Type', namespacedef_=''):5466 showIndent(outfile, level)5467 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5468 self.exportAttributes(outfile, level, namespace_, name_='docInternalS4Type')5469 outfile.write('>')5470 self.exportChildren(outfile, level + 1, namespace_, name_)5471 outfile.write('</%s%s>\n' % (namespace_, name_))5472 def exportAttributes(self, outfile, level, namespace_='', name_='docInternalS4Type'):5473 pass5474 def exportChildren(self, outfile, level, namespace_='', name_='docInternalS4Type'):5475 for item_ in self.content_:5476 item_.export(outfile, level, item_.name, namespace_)5477 def hasContent_(self):5478 if (5479 self.para is not None5480 ):5481 return True5482 else:5483 return False5484 def exportLiteral(self, outfile, level, name_='docInternalS4Type'):5485 level += 15486 self.exportLiteralAttributes(outfile, level, name_)5487 if self.hasContent_():5488 self.exportLiteralChildren(outfile, level, name_)5489 def exportLiteralAttributes(self, outfile, level, name_):5490 pass5491 def exportLiteralChildren(self, outfile, level, name_):5492 showIndent(outfile, level)5493 outfile.write('content_ = [\n')5494 for item_ in self.content_:5495 item_.exportLiteral(outfile, level, name_)5496 showIndent(outfile, level)5497 outfile.write('],\n')5498 def build(self, node_):5499 attrs = node_.attributes5500 self.buildAttributes(attrs)5501 for child_ in node_.childNodes:5502 nodeName_ = child_.nodeName.split(':')[-1]5503 self.buildChildren(child_, nodeName_)5504 def buildAttributes(self, attrs):5505 pass5506 def buildChildren(self, child_, nodeName_):5507 if child_.nodeType == Node.ELEMENT_NODE and \5508 nodeName_ == 'para':5509 childobj_ = docParaType.factory()5510 childobj_.build(child_)5511 obj_ = self.mixedclass_(MixedContainer.CategoryComplex,5512 MixedContainer.TypeNone, 'para', childobj_)5513 self.content_.append(obj_)5514 elif child_.nodeType == Node.TEXT_NODE:5515 obj_ = self.mixedclass_(MixedContainer.CategoryText,5516 MixedContainer.TypeNone, '', child_.nodeValue)5517 self.content_.append(obj_)5518# end class docInternalS4Type5519class docTitleType(GeneratedsSuper):5520 subclass = None5521 superclass = None5522 def __init__(self, valueOf_='', mixedclass_=None, content_=None):5523 if mixedclass_ is None:5524 self.mixedclass_ = MixedContainer5525 else:5526 self.mixedclass_ = mixedclass_5527 if content_ is None:5528 self.content_ = []5529 else:5530 self.content_ = content_5531 def factory(*args_, **kwargs_):5532 if docTitleType.subclass:5533 return docTitleType.subclass(*args_, **kwargs_)5534 else:5535 return docTitleType(*args_, **kwargs_)5536 factory = staticmethod(factory)5537 def getValueOf_(self): return self.valueOf_5538 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5539 def export(self, outfile, level, namespace_='', name_='docTitleType', namespacedef_=''):5540 showIndent(outfile, level)5541 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5542 self.exportAttributes(outfile, level, namespace_, name_='docTitleType')5543 outfile.write('>')5544 self.exportChildren(outfile, level + 1, namespace_, name_)5545 outfile.write('</%s%s>\n' % (namespace_, name_))5546 def exportAttributes(self, outfile, level, namespace_='', name_='docTitleType'):5547 pass5548 def exportChildren(self, outfile, level, namespace_='', name_='docTitleType'):5549 if self.valueOf_.find('![CDATA')>-1:5550 value=quote_xml('%s' % self.valueOf_)5551 value=value.replace('![CDATA','<![CDATA')5552 value=value.replace(']]',']]>')5553 outfile.write(value)5554 else:5555 outfile.write(quote_xml('%s' % self.valueOf_))5556 def hasContent_(self):5557 if (5558 self.valueOf_ is not None5559 ):5560 return True5561 else:5562 return False5563 def exportLiteral(self, outfile, level, name_='docTitleType'):5564 level += 15565 self.exportLiteralAttributes(outfile, level, name_)5566 if self.hasContent_():5567 self.exportLiteralChildren(outfile, level, name_)5568 def exportLiteralAttributes(self, outfile, level, name_):5569 pass5570 def exportLiteralChildren(self, outfile, level, name_):5571 showIndent(outfile, level)5572 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5573 def build(self, node_):5574 attrs = node_.attributes5575 self.buildAttributes(attrs)5576 self.valueOf_ = ''5577 for child_ in node_.childNodes:5578 nodeName_ = child_.nodeName.split(':')[-1]5579 self.buildChildren(child_, nodeName_)5580 def buildAttributes(self, attrs):5581 pass5582 def buildChildren(self, child_, nodeName_):5583 if child_.nodeType == Node.TEXT_NODE:5584 obj_ = self.mixedclass_(MixedContainer.CategoryText,5585 MixedContainer.TypeNone, '', child_.nodeValue)5586 self.content_.append(obj_)5587 if child_.nodeType == Node.TEXT_NODE:5588 self.valueOf_ += child_.nodeValue5589 elif child_.nodeType == Node.CDATA_SECTION_NODE:5590 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5591# end class docTitleType5592class docParaType(GeneratedsSuper):5593 subclass = None5594 superclass = None5595 def __init__(self, valueOf_='', mixedclass_=None, content_=None):5596 if mixedclass_ is None:5597 self.mixedclass_ = MixedContainer5598 else:5599 self.mixedclass_ = mixedclass_5600 if content_ is None:5601 self.content_ = []5602 else:5603 self.content_ = content_5604 def factory(*args_, **kwargs_):5605 if docParaType.subclass:5606 return docParaType.subclass(*args_, **kwargs_)5607 else:5608 return docParaType(*args_, **kwargs_)5609 factory = staticmethod(factory)5610 def getValueOf_(self): return self.valueOf_5611 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5612 def export(self, outfile, level, namespace_='', name_='docParaType', namespacedef_=''):5613 showIndent(outfile, level)5614 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5615 self.exportAttributes(outfile, level, namespace_, name_='docParaType')5616 outfile.write('>')5617 self.exportChildren(outfile, level + 1, namespace_, name_)5618 outfile.write('</%s%s>\n' % (namespace_, name_))5619 def exportAttributes(self, outfile, level, namespace_='', name_='docParaType'):5620 pass5621 def exportChildren(self, outfile, level, namespace_='', name_='docParaType'):5622 if self.valueOf_.find('![CDATA')>-1:5623 value=quote_xml('%s' % self.valueOf_)5624 value=value.replace('![CDATA','<![CDATA')5625 value=value.replace(']]',']]>')5626 outfile.write(value)5627 else:5628 outfile.write(quote_xml('%s' % self.valueOf_))5629 def hasContent_(self):5630 if (5631 self.valueOf_ is not None5632 ):5633 return True5634 else:5635 return False5636 def exportLiteral(self, outfile, level, name_='docParaType'):5637 level += 15638 self.exportLiteralAttributes(outfile, level, name_)5639 if self.hasContent_():5640 self.exportLiteralChildren(outfile, level, name_)5641 def exportLiteralAttributes(self, outfile, level, name_):5642 pass5643 def exportLiteralChildren(self, outfile, level, name_):5644 showIndent(outfile, level)5645 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5646 def build(self, node_):5647 attrs = node_.attributes5648 self.buildAttributes(attrs)5649 self.valueOf_ = ''5650 for child_ in node_.childNodes:5651 nodeName_ = child_.nodeName.split(':')[-1]5652 self.buildChildren(child_, nodeName_)5653 def buildAttributes(self, attrs):5654 pass5655 def buildChildren(self, child_, nodeName_):5656 if child_.nodeType == Node.TEXT_NODE:5657 obj_ = self.mixedclass_(MixedContainer.CategoryText,5658 MixedContainer.TypeNone, '', child_.nodeValue)5659 self.content_.append(obj_)5660 if child_.nodeType == Node.TEXT_NODE:5661 self.valueOf_ += child_.nodeValue5662 elif child_.nodeType == Node.CDATA_SECTION_NODE:5663 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5664# end class docParaType5665class docMarkupType(GeneratedsSuper):5666 subclass = None5667 superclass = None5668 def __init__(self, valueOf_='', mixedclass_=None, content_=None):5669 if mixedclass_ is None:5670 self.mixedclass_ = MixedContainer5671 else:5672 self.mixedclass_ = mixedclass_5673 if content_ is None:5674 self.content_ = []5675 else:5676 self.content_ = content_5677 def factory(*args_, **kwargs_):5678 if docMarkupType.subclass:5679 return docMarkupType.subclass(*args_, **kwargs_)5680 else:5681 return docMarkupType(*args_, **kwargs_)5682 factory = staticmethod(factory)5683 def getValueOf_(self): return self.valueOf_5684 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5685 def export(self, outfile, level, namespace_='', name_='docMarkupType', namespacedef_=''):5686 showIndent(outfile, level)5687 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5688 self.exportAttributes(outfile, level, namespace_, name_='docMarkupType')5689 outfile.write('>')5690 self.exportChildren(outfile, level + 1, namespace_, name_)5691 outfile.write('</%s%s>\n' % (namespace_, name_))5692 def exportAttributes(self, outfile, level, namespace_='', name_='docMarkupType'):5693 pass5694 def exportChildren(self, outfile, level, namespace_='', name_='docMarkupType'):5695 if self.valueOf_.find('![CDATA')>-1:5696 value=quote_xml('%s' % self.valueOf_)5697 value=value.replace('![CDATA','<![CDATA')5698 value=value.replace(']]',']]>')5699 outfile.write(value)5700 else:5701 outfile.write(quote_xml('%s' % self.valueOf_))5702 def hasContent_(self):5703 if (5704 self.valueOf_ is not None5705 ):5706 return True5707 else:5708 return False5709 def exportLiteral(self, outfile, level, name_='docMarkupType'):5710 level += 15711 self.exportLiteralAttributes(outfile, level, name_)5712 if self.hasContent_():5713 self.exportLiteralChildren(outfile, level, name_)5714 def exportLiteralAttributes(self, outfile, level, name_):5715 pass5716 def exportLiteralChildren(self, outfile, level, name_):5717 showIndent(outfile, level)5718 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5719 def build(self, node_):5720 attrs = node_.attributes5721 self.buildAttributes(attrs)5722 self.valueOf_ = ''5723 for child_ in node_.childNodes:5724 nodeName_ = child_.nodeName.split(':')[-1]5725 self.buildChildren(child_, nodeName_)5726 def buildAttributes(self, attrs):5727 pass5728 def buildChildren(self, child_, nodeName_):5729 if child_.nodeType == Node.TEXT_NODE:5730 obj_ = self.mixedclass_(MixedContainer.CategoryText,5731 MixedContainer.TypeNone, '', child_.nodeValue)5732 self.content_.append(obj_)5733 if child_.nodeType == Node.TEXT_NODE:5734 self.valueOf_ += child_.nodeValue5735 elif child_.nodeType == Node.CDATA_SECTION_NODE:5736 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5737# end class docMarkupType5738class docURLLink(GeneratedsSuper):5739 subclass = None5740 superclass = None5741 def __init__(self, url=None, valueOf_='', mixedclass_=None, content_=None):5742 self.url = url5743 if mixedclass_ is None:5744 self.mixedclass_ = MixedContainer5745 else:5746 self.mixedclass_ = mixedclass_5747 if content_ is None:5748 self.content_ = []5749 else:5750 self.content_ = content_5751 def factory(*args_, **kwargs_):5752 if docURLLink.subclass:5753 return docURLLink.subclass(*args_, **kwargs_)5754 else:5755 return docURLLink(*args_, **kwargs_)5756 factory = staticmethod(factory)5757 def get_url(self): return self.url5758 def set_url(self, url): self.url = url5759 def getValueOf_(self): return self.valueOf_5760 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5761 def export(self, outfile, level, namespace_='', name_='docURLLink', namespacedef_=''):5762 showIndent(outfile, level)5763 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5764 self.exportAttributes(outfile, level, namespace_, name_='docURLLink')5765 outfile.write('>')5766 self.exportChildren(outfile, level + 1, namespace_, name_)5767 outfile.write('</%s%s>\n' % (namespace_, name_))5768 def exportAttributes(self, outfile, level, namespace_='', name_='docURLLink'):5769 if self.url is not None:5770 outfile.write(' url=%s' % (self.format_string(quote_attrib(self.url).encode(ExternalEncoding), input_name='url'), ))5771 def exportChildren(self, outfile, level, namespace_='', name_='docURLLink'):5772 if self.valueOf_.find('![CDATA')>-1:5773 value=quote_xml('%s' % self.valueOf_)5774 value=value.replace('![CDATA','<![CDATA')5775 value=value.replace(']]',']]>')5776 outfile.write(value)5777 else:5778 outfile.write(quote_xml('%s' % self.valueOf_))5779 def hasContent_(self):5780 if (5781 self.valueOf_ is not None5782 ):5783 return True5784 else:5785 return False5786 def exportLiteral(self, outfile, level, name_='docURLLink'):5787 level += 15788 self.exportLiteralAttributes(outfile, level, name_)5789 if self.hasContent_():5790 self.exportLiteralChildren(outfile, level, name_)5791 def exportLiteralAttributes(self, outfile, level, name_):5792 if self.url is not None:5793 showIndent(outfile, level)5794 outfile.write('url = %s,\n' % (self.url,))5795 def exportLiteralChildren(self, outfile, level, name_):5796 showIndent(outfile, level)5797 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5798 def build(self, node_):5799 attrs = node_.attributes5800 self.buildAttributes(attrs)5801 self.valueOf_ = ''5802 for child_ in node_.childNodes:5803 nodeName_ = child_.nodeName.split(':')[-1]5804 self.buildChildren(child_, nodeName_)5805 def buildAttributes(self, attrs):5806 if attrs.get('url'):5807 self.url = attrs.get('url').value5808 def buildChildren(self, child_, nodeName_):5809 if child_.nodeType == Node.TEXT_NODE:5810 obj_ = self.mixedclass_(MixedContainer.CategoryText,5811 MixedContainer.TypeNone, '', child_.nodeValue)5812 self.content_.append(obj_)5813 if child_.nodeType == Node.TEXT_NODE:5814 self.valueOf_ += child_.nodeValue5815 elif child_.nodeType == Node.CDATA_SECTION_NODE:5816 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5817# end class docURLLink5818class docAnchorType(GeneratedsSuper):5819 subclass = None5820 superclass = None5821 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):5822 self.id = id5823 if mixedclass_ is None:5824 self.mixedclass_ = MixedContainer5825 else:5826 self.mixedclass_ = mixedclass_5827 if content_ is None:5828 self.content_ = []5829 else:5830 self.content_ = content_5831 def factory(*args_, **kwargs_):5832 if docAnchorType.subclass:5833 return docAnchorType.subclass(*args_, **kwargs_)5834 else:5835 return docAnchorType(*args_, **kwargs_)5836 factory = staticmethod(factory)5837 def get_id(self): return self.id5838 def set_id(self, id): self.id = id5839 def getValueOf_(self): return self.valueOf_5840 def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_5841 def export(self, outfile, level, namespace_='', name_='docAnchorType', namespacedef_=''):5842 showIndent(outfile, level)5843 outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))5844 self.exportAttributes(outfile, level, namespace_, name_='docAnchorType')5845 outfile.write('>')5846 self.exportChildren(outfile, level + 1, namespace_, name_)5847 outfile.write('</%s%s>\n' % (namespace_, name_))5848 def exportAttributes(self, outfile, level, namespace_='', name_='docAnchorType'):5849 if self.id is not None:5850 outfile.write(' id=%s' % (self.format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))5851 def exportChildren(self, outfile, level, namespace_='', name_='docAnchorType'):5852 if self.valueOf_.find('![CDATA')>-1:5853 value=quote_xml('%s' % self.valueOf_)5854 value=value.replace('![CDATA','<![CDATA')5855 value=value.replace(']]',']]>')5856 outfile.write(value)5857 else:5858 outfile.write(quote_xml('%s' % self.valueOf_))5859 def hasContent_(self):5860 if (5861 self.valueOf_ is not None5862 ):5863 return True5864 else:5865 return False5866 def exportLiteral(self, outfile, level, name_='docAnchorType'):5867 level += 15868 self.exportLiteralAttributes(outfile, level, name_)5869 if self.hasContent_():5870 self.exportLiteralChildren(outfile, level, name_)5871 def exportLiteralAttributes(self, outfile, level, name_):5872 if self.id is not None:5873 showIndent(outfile, level)5874 outfile.write('id = %s,\n' % (self.id,))5875 def exportLiteralChildren(self, outfile, level, name_):5876 showIndent(outfile, level)5877 outfile.write('valueOf_ = "%s",\n' % (self.valueOf_,))5878 def build(self, node_):5879 attrs = node_.attributes5880 self.buildAttributes(attrs)5881 self.valueOf_ = ''5882 for child_ in node_.childNodes:5883 nodeName_ = child_.nodeName.split(':')[-1]5884 self.buildChildren(child_, nodeName_)5885 def buildAttributes(self, attrs):5886 if attrs.get('id'):5887 self.id = attrs.get('id').value5888 def buildChildren(self, child_, nodeName_):5889 if child_.nodeType == Node.TEXT_NODE:5890 obj_ = self.mixedclass_(MixedContainer.CategoryText,5891 MixedContainer.TypeNone, '', child_.nodeValue)5892 self.content_.append(obj_)5893 if child_.nodeType == Node.TEXT_NODE:5894 self.valueOf_ += child_.nodeValue5895 elif child_.nodeType == Node.CDATA_SECTION_NODE:5896 self.valueOf_ += '![CDATA['+child_.nodeValue+']]'5897# end class docAnchorType5898class docFormulaType(GeneratedsSuper):5899 subclass = None5900 superclass = None5901 def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):5902 self.id = id5903 if mixedclass_ is None:5904 self.mixedclass_ = MixedContainer5905 else:5906 self.mixedclass_ = mixedclass_5907 if content_ is None:5908 self.content_ = []5909 else:5910 self.content_ = content_5911 def factory(*args_, **kwargs_):5912 if docFormulaType.subclass:5913