You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/07/15 21:20:03 UTC

cvs commit: xml-xerces/c/src/xercesc/dom DOMNode.hpp

tng         2002/07/15 12:20:03

  Modified:    c/src/xercesc/dom DOMNode.hpp
  Log:
  DOM L3:
  1. Add DOMNode::TreePosition
  3. declare dummy DOMNode::getBaseURI, compareTreePosition, get/setTextContent, lookupNamespacePrefix, isDefaultNamespace, lookupNamespaceURI, getInterface
  
  Revision  Changes    Path
  1.9       +239 -4    xml-xerces/c/src/xercesc/dom/DOMNode.hpp
  
  Index: DOMNode.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/DOMNode.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DOMNode.hpp	27 Jun 2002 18:40:20 -0000	1.8
  +++ DOMNode.hpp	15 Jul 2002 19:20:03 -0000	1.9
  @@ -229,6 +229,42 @@
           DOCUMENT_FRAGMENT_NODE      = 11,
           NOTATION_NODE               = 12
       };
  +
  +    /**
  +     * TreePosition:
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * <p><code>TREE_POSITION_PRECEDING:</code>
  +     * The node precedes the reference node.</p>
  +     * <p><code>TREE_POSITION_FOLLOWING:</code>
  +     * The node follows the reference node.</p>
  +     * <p><code>TREE_POSITION_ANCESTOR:</code>
  +     * The node is an ancestor of the reference node.</p>
  +     * <p><code>TREE_POSITION_DESCENDANT:</code>
  +     * The node is a descendant of the reference node.</p>
  +     * <p><code>TREE_POSITION_EQUIVALENT:</code>
  +     * The two nodes have an equivalent position. This is the case of two
  +     * attributes that have the same <code>ownerElement</code>, and two
  +     * nodes that are the same.</p>
  +     * <p><code>TREE_POSITION_SAME_NODE:</code>
  +     * The two nodes are the same. Two nodes that are the same have an
  +     * equivalent position, though the reverse may not be true.</p>
  +     * <p><code>TREE_POSITION_DISCONNECTED:</code>
  +     * The two nodes are disconnected, they do not have any common ancestor.
  +     * This is the case of two nodes that are not in the same document.</p>
  +     *
  +     * @since DOM Level 3
  +     */
  +    enum DOMTreePosition {
  +        TREE_POSITION_PRECEDING   = 0x01,
  +        TREE_POSITION_FOLLOWING   = 0x02,
  +        TREE_POSITION_ANCESTOR    = 0x04,
  +        TREE_POSITION_DESCENDANT  = 0x08,
  +        TREE_POSITION_EQUIVALENT  = 0x10,
  +        TREE_POSITION_SAME_NODE   = 0x20,
  +        TREE_POSITION_DISCONNECTED = 0x00
  +    };
       //@}
   
       // -----------------------------------------------------------------------
  @@ -715,12 +751,213 @@
        * <p><b>"Experimental - subject to change"</b></p>
        *
        * @param key The key the object is associated to.
  -     * @return Returns the <code>DOMObject</code> associated to the given key
  +     * @return Returns the <code>void*</code> associated to the given key
        *   on this node, or <code>null</code> if there was none.
        * @see setUserData
        * @since DOM Level 3
        */
       virtual void*             getUserData(const XMLCh* key) const = 0;
  +
  +
  +    /**
  +     * The absolute base URI of this node or <code>null</code> if undefined.
  +     * This value is computed according to . However, when the
  +     * <code>DOMDocument</code> supports the feature "HTML" , the base URI is
  +     * computed using first the value of the href attribute of the HTML BASE
  +     * element if any, and the value of the <code>documentURI</code>
  +     * attribute from the <code>DOMDocument</code> interface otherwise.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * <br> When the node is an <code>DOMElement</code>, a <code>DOMDocument</code>
  +     * or a a <code>DOMProcessingInstruction</code>, this attribute represents
  +     * the properties [base URI] defined in . When the node is a
  +     * <code>DOMNotation</code>, an <code>DOMEntity</code>, or an
  +     * <code>DOMEntityReference</code>, this attribute represents the
  +     * properties [declaration base URI].
  +     * @since DOM Level 3
  +     */
  +    virtual const XMLCh*           getBaseURI() const = 0;
  +
  +    /**
  +     * Compares a node with this node with regard to their position in the
  +     * tree and according to the document order. This order can be extended
  +     * by module that define additional types of nodes.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @param other The node to compare against this node.
  +     * @return Returns how the given node is positioned relatively to this
  +     *   node.
  +     * @since DOM Level 3
  +     */
  +    virtual short                  compareTreePosition(DOMNode* other) = 0;
  +
  +    /**
  +     * This attribute returns the text content of this node and its
  +     * descendants. When it is defined to be null, setting it has no effect.
  +     * When set, any possible children this node may have are removed and
  +     * replaced by a single <code>DOMText</code> node containing the string
  +     * this attribute is set to. On getting, no serialization is performed,
  +     * the returned string does not contain any markup. No whitespace
  +     * normalization is performed, the returned string does not contain the
  +     * element content whitespaces . Similarly, on setting, no parsing is
  +     * performed either, the input string is taken as pure textual content.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * <br>The string returned is made of the text content of this node
  +     * depending on its type, as defined below:
  +     * <table border='1'>
  +     * <tr>
  +     * <th>Node type</th>
  +     * <th>Content</th>
  +     * </tr>
  +     * <tr>
  +     * <td valign='top' rowspan='1' colspan='1'>
  +     * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
  +     * DOCUMENT_FRAGMENT_NODE</td>
  +     * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
  +     * attribute value of every child node, excluding COMMENT_NODE and
  +     * PROCESSING_INSTRUCTION_NODE nodes</td>
  +     * </tr>
  +     * <tr>
  +     * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
  +     * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
  +     * <td valign='top' rowspan='1' colspan='1'>
  +     * <code>nodeValue</code></td>
  +     * </tr>
  +     * <tr>
  +     * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
  +     * <td valign='top' rowspan='1' colspan='1'>
  +     * null</td>
  +     * </tr>
  +     * </table>
  +     * @exception DOMException
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
  +     * @exception DOMException
  +     *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than
  +     *   fit in a <code>DOMString</code> variable on the implementation
  +     *   platform.
  +     * @since DOM Level 3
  +     */
  +    virtual const XMLCh*           getTextContent() const = 0;
  +
  +    /**
  +     * This attribute returns the text content of this node and its
  +     * descendants. When it is defined to be null, setting it has no effect.
  +     * When set, any possible children this node may have are removed and
  +     * replaced by a single <code>DOMText</code> node containing the string
  +     * this attribute is set to. On getting, no serialization is performed,
  +     * the returned string does not contain any markup. No whitespace
  +     * normalization is performed, the returned string does not contain the
  +     * element content whitespaces . Similarly, on setting, no parsing is
  +     * performed either, the input string is taken as pure textual content.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * <br>The string returned is made of the text content of this node
  +     * depending on its type, as defined below:
  +     * <table border='1'>
  +     * <tr>
  +     * <th>Node type</th>
  +     * <th>Content</th>
  +     * </tr>
  +     * <tr>
  +     * <td valign='top' rowspan='1' colspan='1'>
  +     * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
  +     * DOCUMENT_FRAGMENT_NODE</td>
  +     * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
  +     * attribute value of every child node, excluding COMMENT_NODE and
  +     * PROCESSING_INSTRUCTION_NODE nodes</td>
  +     * </tr>
  +     * <tr>
  +     * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
  +     * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
  +     * <td valign='top' rowspan='1' colspan='1'>
  +     * <code>nodeValue</code></td>
  +     * </tr>
  +     * <tr>
  +     * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
  +     * <td valign='top' rowspan='1' colspan='1'>
  +     * null</td>
  +     * </tr>
  +     * </table>
  +     * @exception DOMException
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
  +     * @exception DOMException
  +     *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than
  +     *   fit in a <code>DOMString</code> variable on the implementation
  +     *   platform.
  +     * @since DOM Level 3
  +     */
  +    virtual void                   setTextContent(const XMLCh* textContent) = 0;
  +
  +    /**
  +     * Look up the prefix associated to the given namespace URI, starting from
  +     * this node.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @param namespaceURI The namespace URI to look for.
  +     * @param useDefault  Indicates if the lookup mechanism should take into
  +     *   account the default namespace or not.
  +     * @return Returns an associated namespace prefix if found,
  +     *   <code>null</code> if none is found and <code>useDefault</code> is
  +     *   false, or <code>null</code> if not found or it is the default
  +     *   namespace and <code>useDefault</code> is <code>true</code>. If more
  +     *   than one prefix are associated to the namespace prefix, the
  +     *   returned namespace prefix is implementation dependent.
  +     * @since DOM Level 3
  +     */
  +    virtual const XMLCh*           lookupNamespacePrefix(const XMLCh* namespaceURI,
  +                                                         bool useDefault) = 0;
  +
  +    /**
  +     * This method checks if the specified <code>namespaceURI</code> is the
  +     * default namespace or not.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @param namespaceURI The namespace URI to look for.
  +     * @return  <code>true</code> if the specified <code>namespaceURI</code>
  +     *   is the default namespace, <code>false</code> otherwise.
  +     * @since DOM Level 3
  +     */
  +    virtual bool                   isDefaultNamespace(const XMLCh* namespaceURI) = 0;
  +
  +    /**
  +     * Look up the namespace URI associated to the given prefix, starting from
  +     * this node.
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @param prefix The prefix to look for. If this parameter is
  +     *   <code>null</code>, the method will return the default namespace URI
  +     *   if any.
  +     * @return Returns the associated namespace URI or <code>null</code> if
  +     *   none is found.
  +     * @since DOM Level 3
  +     */
  +    virtual const XMLCh*           lookupNamespaceURI(const XMLCh* prefix) = 0;
  +
  +    /**
  +     * This method makes available a <code>DOMNode</code>'s specialized interface
  +     *
  +     * <p><b>"Experimental - subject to change"</b></p>
  +     *
  +     * @param feature The name of the feature requested (case-insensitive).
  +     * @return Returns an alternate <code>DOMNode</code> which implements the
  +     *   specialized APIs of the specified feature, if any, or
  +     *   <code>null</code> if there is no alternate <code>DOMNode</code> which
  +     *   implements interfaces associated with that feature. Any alternate
  +     *   <code>DOMNode</code> returned by this method must delegate to the
  +     *   primary core <code>DOMNode</code> and not return results inconsistent
  +     *   with the primary core <code>DOMNode</code> such as <code>key</code>,
  +     *   <code>attributes</code>, <code>childNodes</code>, etc.
  +     * @since DOM Level 3
  +     */
  +    virtual DOMNode*               getInterface(const XMLCh* feature) = 0;
       //@}
   
       // -----------------------------------------------------------------------
  @@ -743,8 +980,6 @@
        */
       virtual void              release() = 0;
       //@}
  -
  -
   };
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org