W3C home > Mailing lists > Public > www-dom@w3.org > January to March 1998

IDL errors

From: Werner Donne' <wdonne@ibm.net>
Date: Thu, 26 Mar 1998 18:03:25 +0100
Message-Id: <351A8A5D.70F7E6BB@ibm.net>
To: www-dom@w3.org
Hi,

The IDL in the draft doesn't compile. The following errors occur:

- No forward declarations.
- int used instead of long.
- Order of interface definitions doesn't take into account inheritance.
- All constants in Node clash with interface names. The CORBA spec
(section 3.2.3) clearly specifies identifiers are case insensitive.
- "typedef sequence <wstring> StringList;" appears nowhere but is used
in AttributeDefinition.
- In interface EntityDeclaration DocumentFragmentreplacementSubtree
occurs.
- In EntityReference "void expand(in  );" occurs while it should have no
arguments.

I suggest to introduce the module org::w3::dom.

The attached files compile. That's all I can say about them at the
moment.

With kind regards,

--
Werner Donne'
Re BVBA
Leuvenselaan 172
B-3300 Tienen
tel: (+32) 16 810203
fax: (+32) 16 820826
E-mail: wdonne@ibm.net


module org { module w3 { module dom {

interface DOM;
interface DocumentContext;
interface DocumentFragment;
interface Document;
interface Node;
interface NodeIterator;
interface TreeIterator;
interface Attribute;
interface AttributeList;
interface Element;
interface Text;
interface Comment;
interface PI;

typedef sequence <wstring> StringList;

interface DOM {
       Document            createDocument(in wstring type);
       boolean             hasFeature(in wstring feature);
     };

     interface Node {
       // NodeType
       const long            DOC		  = 1;
       const long            ELEM                 = 2;
       const long            ATTR            = 3;
       const long            PROCI                   = 4;
       const long            CMNT              = 5;
       const long            TXT                  = 6;

       long                 getNodeType();
       Node                getParentNode();
       NodeIterator        getChildNodes();
       boolean             hasChildNodes();
       Node                getFirstChild();
       Node                getPreviousSibling();
       Node                getNextSibling();
       Node                insertBefore(in Node newChild, 
                                        in Node refChild);
       Node                replaceChild(in Node newChild, 
                                        in Node oldChild);
       Node                removeChild(in Node oldChild);
     };

     interface DocumentContext {
       attribute Document       document;
     };

     interface DocumentFragment : Node {
       attribute Document       masterDoc;
     };

     interface Document : DocumentFragment {
       attribute Node           documentType;
       attribute Element        documentElement;
       attribute DocumentContext contextInfo;
       DocumentContext     createDocumentContext();
       Element             createElement(in wstring tagName, 
                                         in AttributeList attributes);
       Text                createTextNode(in wstring data);
       Comment             createComment(in wstring data);
       PI                  createPI(in wstring name, 
                                    in wstring data);
       Attribute           createAttribute(in wstring name, 
                                           in Node value);
       AttributeList       createAttributeList();
       NodeIterator        getElementsByTagName();
     };

     interface NodeIterator {
       unsigned long       getLength();
       Node                getCurrent();
       Node                toNext();
       Node                toPrevious();
       Node                toFirst();
       Node                toLast();
       Node                toNth(in long Nth);
       Node                toNode(in Node destNode);
     };

     interface TreeIterator : NodeIterator {
       unsigned long       numChildren();
       unsigned long       numPreviousSiblings();
       unsigned long       numNextSiblings();
       Node                toParent();
       Node                toPreviousSibling();
       Node                toNextSibling();
       Node                toFirstChild();
       Node                toLastChild();
       Node                toNthChild();
     };

     interface Attribute {
       wstring             getName();
       attribute Node           value;
       attribute boolean        specified;
       wstring             toString();
     };

     interface AttributeList {
       Attribute           getAttribute(in wstring attrName);
       Attribute           setAttribute(in Attribute attr);
       Attribute           remove(in wstring attrName);
       Attribute           item(in unsigned long index);
       unsigned long       getLength();
     };

     interface Element : Node {
       wstring             getTagName();
       AttributeList       attributes();
       void                setAttribute(in Attribute newAttr);
       void                normalize();
       NodeIterator        getElementsByTagName();
     };

     interface Text : Node {
       attribute wstring        data;
       void                append(in wstring data);
       void                insert(in long offset, 
                                  in wstring data);
       void                delete(in long offset, 
                                  in long count);
       void                replace(in long offset, 
                                   in long count, 
                                   in wstring data);
       void                splice(in Element element, 
                                  in long offset, 
                                  in long count);
     };

     interface Comment : Node {
       attribute wstring        data;
     };

     interface PI : Node {
       attribute wstring        name;
       attribute wstring        data;
     };

}; }; };

#include "core.idl"

module org { module w3 { module dom {

interface XMLNode;
interface DocumentType;
interface ElementDefinition;
interface PCDATAToken;
interface ElementToken;
interface ModelGroup;
interface AttributeDefinition;
interface Notation;
interface EntityDeclaration;
interface EntityReference;
interface CDATASection;

interface XMLNode {
       Node                getParentXMLNode(in boolean expandEntities);
       NodeIterator        getChildXMLNodes(in boolean expandEntities);
       boolean             hasChildXMLNodes(in boolean expandEntities);
       Node                getFirstXMLChild(in boolean expandEntities);
       Node                getPreviousXMLSibling(in boolean expandEntities);
       Node                getNextXMLSibling(in boolean expandEntities);
       EntityReference     getEntityReference();
       EntityDeclaration   getEntityDeclaration();
     };

     interface DocumentType {
       attribute wstring        name;
       attribute Node           externalSubset;
       attribute Node           internalSubset;
       attribute Node           generalEntities;
       attribute Node           parameterEntities;
       attribute Node           notations;
       attribute Node           elementTypes;
     };

     interface ElementDefinition : Node {
       // ContentType
       const long            EMPTY                = 1;
       const long            ANY                  = 2;
       const long            PCDATA               = 3;
       const long            MODEL_GROUP          = 4;

       attribute wstring        name;
       attribute long            contentType;
       attribute ModelGroup     contentModel;
       attribute Node           attributeDefinitions;
       attribute Node           inclusions;
       attribute Node           exceptions;
     };

     interface PCDATAToken : Node {
     };

     interface ElementToken : Node {
       // OccurrenceType
       const long            OPT                  = 1;
       const long            PLUS                 = 2;
       const long            REP                  = 3;

       attribute wstring        name;
       attribute long            occurrence;
     };

     interface ModelGroup : Node {
       // OccurrenceType
       const long            OPT                  = 1;
       const long            PLUS                 = 2;
       const long            REP                  = 3;

       // ConnectionType
       const long            OR                   = 1;
       const long            SEQ                  = 2;
       const long            AND                  = 3;

       attribute long            occurrence;
       attribute long            connector;
       attribute Node           tokens;
     };

     interface AttributeDefinition : Node {
       // DeclaredValueType
       const long            CDATA                = 1;
       const long            ID                   = 2;
       const long            IDREF                = 3;
       const long            IDREFS               = 4;
       const long            ENTITY               = 5;
       const long            ENTITIES             = 6;
       const long            NMTOKEN              = 7;
       const long            NMTOKENS             = 8;
       const long            NOTATION             = 9;
       const long            NAME_TOKEN_GROUP     = 10;

       // DefaultValueType
       const long            FIXED                = 1;
       const long            REQUIRED             = 2;
       const long            IMPLIED              = 3;

       attribute wstring        name;
       attribute StringList     allowedTokens;
       attribute long            declaredType;
       attribute long            defaultType;
       attribute Node           defaultValue;
     };

     interface Notation : Node {
       attribute wstring        name;
       attribute boolean        isPublic;
       attribute string         publicIdentifier;
       attribute string         systemIdentifier;
     };

     interface EntityDeclaration {
       attribute wstring        replacementString;
       attribute DocumentFragment replacementSubtree;
     };

     interface EntityReference {
       attribute boolean        isExpanded;
       void                expand();
     };

     interface CDATASection : Text {
     };

}; }; };
Received on Thursday, 26 March 1998 12:28:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:44 GMT