[XML-SIG] Minidom proposal

Paul Prescod paul@prescod.net
Fri, 18 Feb 2000 07:53:56 -0800


I propose the following interface for a module that would go
into Python 1.6 (excuse my IDLish shorthand)

class Node :
	[List of Node] childNodes
	Node parent

class Document(Node):
	Element documentElement

class Attribute(Node):
	string namespaceURI
	string prefix
	string localName
	string value
	element ownerElement

class Element(Node):
	string tagname
	# check what the DOM does with namespaces
	{Dictionary of Name->Value} attributes
	GetElementsByTagName( tagname ) -> List[Node]:
	getElementsByTagNameNS(
		DOMString namespaceURI, 
                DOMString localName) -> NodeList
	string namespaceURI
	string prefix
	string localName

class Comment(Node):
	String data

class ProcessingInstruction(Node):
	String target
	String data

class Text( Node ):
	String data

All properties could be read-write but there would be no special cut and
paste/clone methods.

Opinions?

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
"The calculus and the rich body of mathematical analysis to which it
gave rise made modern science possible, but it was the algorithm that
made possible the modern world." 
        - from "Advent of the Algorithm" David Berlinski
	http://www.opengroup.com/mabooks/015/0151003386.shtml