Re: Parsing XML scheme (xsd) to python objects

2006-02-09 Thread Chris McDonough
You don't just want to parse the XSD data because there lots of XML parsers for Python. You want to validate documents against the schema, right? I haven't yet seen a good XML schema validator for Python. libxml2 has good bindings for validating XML against RelaxNG schemas. - C Bizarro-02 wr

Re: breadth first search

2006-02-08 Thread Chris McDonough
Peter Otten wrote: > Chris McDonough wrote: > >>> Can Python >>> create list dynamically, I want to implement a program which will read >>> data from a file and store each line into a list, is this possible? >> L = [] >> [L.append(line) for line in (op

Re: breadth first search

2006-02-08 Thread Chris McDonough
News wrote: > I am new in using Python > > Anyone know how to implement breadth first search using Python? Breadth-first search of what? It depends what kind of tree you're searching, but here's a page with a few implementations: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/231503

encoding during elementtree serialization

2006-02-08 Thread Chris McDonough
ElementTree's XML serialization routine implied by tree._write(file, node, encoding, namespaces looks like this (elided): def _write(self, file, node, encoding, namespaces): # write XML to file tag = node.tag if tag is Comment: file.write("" % _escape_