You are not logged in Log in Join
You are here: Home » Members » jim » ZDOM-save » Attachment

Log in
Name

Password

 
 

History for Attachment

??changed:
-
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
  <head>
    <title>DOM Interface Specification</title>
  </head>

  <body>
    <h1>DOM Interface Specification</h1>

    <h2>Introduction</h2>
    This file will serve as an interface guide to DOM support in Zope.  It will document the interfaces provided by the DOM implementation, required functionality, default behaviors, and error conditions for each method.


    <p>General Note:  The python binding for the DOM has defined attribute access to be in the following forms:</p>

    <ol>
    <li>For accessing attributes, the attribute can be read as an instance variable, and through the function get_attrName().  Ex.<br><br>

    attribute readonly nodeType;<br><br>

    Maps to the following definitions<br><br>

    self.nodeType<br>
    self.get_nodeType()<br><br>
	</li>
    <li>For mutating attributes, the attribute can be set as an instance varible, or through the function set_attrName(value);<br><br>

    attribute nodeName;<br><br>

    Maps to the following definition<br><br>

    self.nodeName<br><br>
    self.set_nodeName(value)<br>

	</li>
    </ol>

    <p>As a general rule, read attribute access will be performed through computed attribute values.  It will be explicitly noted when this is not the case.</p>

    <p><b>Developers Note:</b>  Outstanding issues will be flagged with !!ISSUE!!</p>


    <p>!!ISSUE  The DOM spec defines special operations for DocumentFragments.  Are DocumentFragments defined in Zope???  I don't see how they really fit in.</p>

    <h2>Exceptions</h2>
    <p>
      !!ISSUE How do these map into Zope?  Do we want to raise DOM Exceptions, or Zope Exceptions?
    </p>


    <h2>Node level interfaces</h2>

    <p>Node level interfaces are define basic actions for every node in a DOM tree.  All Zope objects will support the Node interface to its fullest extent.</p>


    <h3>Node Type Definitions</h3>

    <h4>Interface</h4>

    <p>!!ISSUE are these needed at this level?  All Zope Objects are Elements. <br>
    !!If they are used, should they be stored in string format so they are more readable?<br>
    !!dtml-if nodeType='ELEMENT_NODE'<br>
    !!is prettier then<br>
    !!dtml-if nodeType=1<br>
      !!However, in the future we may inherit from this Node in XMLDocument.
      </p>


    <p>The constants define what the type of the node a node is.  The nodeType (get_nodeType()) accessor of a Node will return one of these constants.

    </p>

    ELEMENT_NODE                   = 1;<br>
    ATTRIBUTE_NODE                 = 2;<br>
    TEXT_NODE                      = 3;<br>
    CDATA_SECTION_NODE             = 4;<br>
    ENTITY_REFERENCE_NODE          = 5;<br>
    ENTITY_NODE                    = 6;<br>
    PROCESSING_INSTRUCTION_NODE    = 7;<br>
    COMMENT_NODE                   = 8;<br>
    DOCUMENT_NODE                  = 9;<br>
    DOCUMENT_TYPE_NODE             = 10;<br>
    DOCUMENT_FRAGMENT_NODE         = 11;<br>
    NOTATION_NODE                  = 12;<br>


    <h4>Design Notes</h4>
    <p>All Zope Objects will have a node type of ELEMENT_NODE</p>



    <h4>Parameter Definition</h4>
    <h4>Return Value Definition</h4>
    <h4>Default Implementation</h4>
    <h4>Extending Notes</h4>


    <h3>nodeName</h3>
    <h4>Interface</h4>
    <p>readonly attribute DOMString        nodeName</p>

    <p>!!ISSUE is this the same as an object's title?  Originally the title was mapped to a DOM attribute, maybe it should be moved to the nodeName.  The node name is defined as constants for certain nodes, but it is the tagName for Elements.
      </p><p>
      !! This won't work if we use this class as a base class for XML Document objects
</p>
    
    <h4>Parameter Definition</h4>
    None
    <h4>Return Value Definition</h4>
    The value of the nodeName attribute depends on the type of node being queried.

    <table border='1'>
      <tr>
	<th>nodeType</th>
	<th>nodeName</th>
      </tr>
      <tr>
	<td>Attr</td><td>name of attribute</td>
      </tr>
      <tr>
	<td>CDATASection</td><td>'#cdata-section'</td>
      </tr>
      <tr>
	<td>Comment</td><td>'#comment'</td>
      </tr>
      <tr>
	<td>Document</td><td>'#document'</td>
      </tr>
      <tr>
	<td>DocumentFragment</td><td>'#document-fragment'</td>
      </tr>
      <tr>
	<td>DocumentType</td><td>document type name</td>
      </tr>
      <tr>
	<td>Element</td><td>tag name</td>
      </tr>
      <tr>
	<td>Entity</td><td>entity name</td>
      </tr>
      <tr>
	<td>EntityReference</td><td>name of entity referenced</td>
      </tr>
      <tr>
	<td>Notation</td><td>notation name</td>
      </tr>
      <tr>
	<td>ProcessingInstruction</td><td>target</td>
      </tr>
      <tr>
	<td>Text</td><td>'#text'</td>
      </tr>
    </table>

    <h4>Default Implementation</h4>
    The default implementation will return the tagName of the Z Object.
    <p>!!ISSUE  see previous issue, is this the objects title?</p>
    <h4>Extending Notes</h4>
    None

    <h3>nodeValue</h3>
    <h4>Interface</h4>

    <p>attribute DOMString        nodeValue;</p>
    <p>!!ISSUE This is defined as None for an element, should we support this interface?</p>
    <p>!!Same note on subclassing</p>
    <h4>Parameter Definition</h4>
    None
    <h4>Return Value Definition</h4>
    <p>The nodeValue of an attribute is defined based on the nodeType.

    <table border='1'>
      <tr>
	<th>nodeType</th>
	<th>nodeValue</th>
      </tr>
      <tr>
	<td>Attr</td><td>value of attribute</td>
      </tr>
      <tr>
	<td>CDATASection</td><td>Content of the CDATA Section</td>
      </tr>
      <tr>
	<td>Comment</td><td>Content of the comment</td>
      </tr>
      <tr>
	<td>Document</td><td>NULL</td>
      </tr>
      <tr>
	<td>DocumentFragment</td><td>NULL</td>
      </tr>
      <tr>
	<td>DocumentType</td><td>NULL</td>
      </tr>
      <tr>
	<td>Element</td><td>NULL</td>
      </tr>
      <tr>
	<td>Entity</td><td>NULL</td>
[310 more lines...]