25 July 2002

Appendix A: IDL Definitions

This appendix contains the complete OMG IDL [OMG IDL] for the Level 3 Document Object Model Validation definitions.

The IDL files are also available as: http://www.w3.org/TR/2002/WD-DOM-Level-3-Val-20020725/idl.zip


// File: validation.idl


#include "dom.idl"

#pragma prefix "dom.w3c.org"
module validation

  typedef dom::Node Node;
  typedef dom::NodeList NodeList;
  typedef dom::DOMString DOMString;
  typedef dom::Attr Attr;

  exception ExceptionVAL {
    unsigned short   code;
  // ExceptionVALCode
  const unsigned short      NO_GRAMMAR_AVAILABLE           = 1;
  const unsigned short      VALIDATION_ERR                 = 2;

  interface NodeEditVAL {

    // CheckTypeVAL
    const unsigned short      WF_CHECK                       = 1;
    const unsigned short      NS_WF_CHECK                    = 2;
    const unsigned short      PARTIAL_VALIDITY_CHECK         = 3;
    const unsigned short      STRICT_VALIDITY_CHECK          = 4;

    boolean            canInsertBefore(in Node newChild, 
                                       in Node refChild);
    boolean            canRemoveChild(in Node oldChild);
    boolean            canReplaceChild(in Node newChild, 
                                       in Node oldChild);
    boolean            canAppendChild(in Node newChild);
    boolean            isNodeValid(in boolean deep, 
                                   in unsigned short wFValidityCheckLevel)

  interface ElementEditVAL : NodeEditVAL {
    readonly attribute NodeList        definedElementTypes;
    unsigned short     contentType();
    boolean            canSetAttribute(in DOMString attrname, 
                                       in DOMString attrval);
    boolean            canSetAttributeNode(in Attr attrNode);
    boolean            canSetAttributeNS(in DOMString name, 
                                         in DOMString attrval, 
                                         in DOMString namespaceURI);
    boolean            canRemoveAttribute(in DOMString attrname);
    boolean            canRemoveAttributeNS(in DOMString attrname, 
                                            in DOMString namespaceURI);
    boolean            canRemoveAttributeNode(in Node attrNode);
    NodeList           getChildElements();
    NodeList           getParentElements();
    NodeList           getAttributeList();
    boolean            isElementDefined(in DOMString elemTypeName);
    boolean            isElementDefinedNS(in DOMString elemTypeName, 
                                          in DOMString namespaceURI, 
                                          in DOMString name);

  interface CharacterDataEditVAL : NodeEditVAL {
    readonly attribute boolean         isWhitespaceOnly;
    boolean            canSetData(in unsigned long offset, 
                                  in DOMString arg);
    boolean            canAppendData(in DOMString arg);
    boolean            canReplaceData(in unsigned long offset, 
                                      in unsigned long count, 
                                      in DOMString arg);
    boolean            canInsertData(in unsigned long offset, 
                                     in DOMString arg);
    boolean            canDeleteData(in unsigned long offset, 
                                     in unsigned long count);

  interface DocumentEditVAL : NodeEditVAL {
             attribute boolean         continuousValidityChecking;
    void               validateInDocument()

#endif // _VALIDATION_IDL_