Changeset 39 for trunk/include/helpers


Ignore:
Timestamp:
Feb 23, 2001, 7:50:07 AM (24 years ago)
Author:
umoeller
Message:

Misc. fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/xml.h

    r38 r39  
    5252                // more than one declaration for an attribute type
    5353        ERROR_DOM_UNDECLARED_ATTRIBUTE,
     54        ERROR_ELEMENT_CANNOT_HAVE_CONTENT,
     55                // element was declared "empty" and contains text anyway,
     56                // or was declared "children" and contains something other
     57                // than whitespace
     58        ERROR_DOM_INVALID_ATTRIB_VALUE,
     59        ERROR_DOM_REQUIRED_ATTRIBUTE_MISSING,
     60        ERROR_DOM_SUBELEMENT_IN_EMPTY_ELEMENT,
    5461// END MATCHING ERROR MESSAGES (xmlDescribeError)
    5562
     
    6067        // additional DOM errors
    6168        ERROR_DOM_NODETYPE_NOT_SUPPORTED,
    62                 // invalid node type in xmlCreateNode
     69                // invalid node type in xmlCreateDomNode
    6370        ERROR_DOM_NO_DOCUMENT,
    6471                // cannot find document node
     
    8087    typedef enum _NODEBASETYPE
    8188    {
     89        TYPE_UNKNOWN,
     90
    8291        DOMNODE_ELEMENT,                // node is a DOM ELEMENT
    8392        DOMNODE_ATTRIBUTE,              // node is a DOM ATTRIBUTE
     
    219228        NODEBASE        NodeBase;
    220229
    221         // PXSTRING    pstrNodeName;            // ptr is NULL if none
    222230        PXSTRING        pstrNodeValue;           // ptr is NULL if none
    223231
     
    270278
    271279        TREE        *AttribDeclBasesTree;
    272                     // tree with pointers to _CMATTRIBUTEDEDECLBASE nodes
     280                    // tree with pointers to _CMATTRIBUTEDECLBASE nodes
    273281
    274282    } DOMDOCTYPENODE, *PDOMDOCTYPENODE;
     
    291299    } DOMDOCUMENTNODE, *PDOMDOCUMENTNODE;
    292300
    293     APIRET xmlCreateNode(PDOMNODE pParentNode,
    294                          ULONG ulNodeType,
    295                          PDOMNODE *ppNew);
    296 
    297     ULONG xmlDeleteNode(PDOMNODE pNode);
     301    APIRET xmlCreateDomNode(PDOMNODE pParentNode,
     302                            NODEBASETYPE ulNodeType,
     303                            const char *pcszNodeName,
     304                            ULONG ulNodeNameLength,
     305                            PDOMNODE *ppNew);
     306
     307    VOID xmlDeleteNode(PNODEBASE pNode);
    298308
    299309    /* ******************************************************************
     
    328338    typedef struct _CMELEMENTPARTICLE
    329339    {
    330         NODEBASE          CMNode;         // has TREE* as first item in turn
    331                     // NODEBASE.ulCMNodeType may be one of these:
     340        NODEBASE          NodeBase;       // has TREE* as first item in turn
     341                    // NODEBASE.ulNodeType may be one of these:
    332342                    // -- ELEMENTPARTICLE_EMPTY:
    333343                    //          ulRepeater will be XML_CQUANT_NONE, rest is NULL
     
    354364                    // -- XML_CQUANT_PLUS
    355365
     366        struct _CMELEMENTPARTICLE *pParentParticle;     // or NULL if this is in the
     367                                                        // CMELEMENTDECLNODE
     368
    356369        PLINKLIST       pllSubNodes;
    357370                    // linked list of sub-CMELEMENTPARTICLE structs
     
    378391     *
    379392     *      For the "root" element declaration in the DTD,
    380      *      Particle.NODEBASE.ulCMNodeType will always be one of the following:
     393     *      Particle.NODEBASE.ulNodeType will always be one of the following:
    381394     *
    382395     *      -- ELEMENTPARTICLE_EMPTY: element must be empty.
     
    438451     *@@ CMATTRIBUTEDECL:
    439452     *      single attribute declaration within the attribute
    440      *      declarations tree in _CMATTRIBUTEDEDECLBASE.
     453     *      declarations tree in _CMATTRIBUTEDECLBASE.
    441454     *
    442455     *@@added V0.9.9 (2001-02-16) [umoeller]
     
    445458    typedef struct _CMATTRIBUTEDECL
    446459    {
    447         NODEBASE          CMNode;         // has TREE* as first item in turn
    448                     // CMNode.strName is attribute name
    449 
    450         // XSTRING         strType;
     460        NODEBASE          NodeBase;       // has TREE* as first item in turn
     461                    // NodeBase.strName is attribute name
    451462
    452463        ATTRIBTYPE      ulAttrType;
     
    463474        TREE            *ValuesTree;
    464475                    // enumeration of allowed values, if CMAT_ENUM;
    465                     // tree entries are plain NODEBASEs
     476                    // tree entries are plain NODEBASEs with
     477                    // ATTRIBUTE_DECLARATION_ENUM type
    466478
    467479        ATTRIBCONSTRAINT    ulConstraint;
     
    479491
    480492    /*
    481      *@@ CMATTRIBUTEDEDECLBASE:
     493     *@@ CMATTRIBUTEDECLBASE:
    482494     *      representation of an @attribute_declaration.
    483495     *
     
    493505     */
    494506
    495     typedef struct _CMATTRIBUTEDEDECLBASE
    496     {
    497         NODEBASE        CMNode;         // has TREE* as first item in turn
    498                     // CMNode.strName is element name
     507    typedef struct _CMATTRIBUTEDECLBASE
     508    {
     509        NODEBASE        NodeBase;         // has TREE* as first item in turn
     510                    // NodeBase.strName is element name
    499511
    500512        TREE            *AttribDeclsTree;
    501513                            // root of tree with CMATTRIBUTEDECL;
    502514
    503     } CMATTRIBUTEDEDECLBASE, *PCMATTRIBUTEDEDECLBASE;
     515    } CMATTRIBUTEDECLBASE, *PCMATTRIBUTEDECLBASE;
    504516
    505517    /*
     
    513525    typedef struct _CMENTITYDECLNODE
    514526    {
    515         NODEBASE          CMNode;
     527        NODEBASE          NodeBase;
    516528    } CMENTITYDECLNODE, *PCMENTITYDECLNODE;
    517529
     
    526538    typedef struct _CMNOTATIONDECLNODE
    527539    {
    528         NODEBASE          CMNode;
     540        NODEBASE          NodeBase;
    529541    } CMNOTATIONDECLNODE, *PCMNOTATIONDECLNODE;
    530542
     
    568580                            // expat parser instance
    569581
    570         LINKLIST        llStack;
     582        LINKLIST        llElementStack;
    571583                            // stack for maintaining the current items;
    572                             // these point to the NODERECORDs (no auto-free)
     584                            // these point to DOMSTACKITEMs (auto-free)
    573585
    574586        PDOMNODE        pLastWasTextNode;
    575587
    576         PCMATTRIBUTEDEDECLBASE pAttListDeclCache;
     588        PCMATTRIBUTEDECLBASE pAttListDeclCache;
    577589                            // cache for attribute declarations according
    578590                            // to attdecl element name
     
    595607                                          const XSTRING *pstrElementName);
    596608
    597     PCMATTRIBUTEDEDECLBASE xmlFindAttribDeclBase(PXMLDOM pDom,
     609    PCMATTRIBUTEDECLBASE xmlFindAttribDeclBase(PXMLDOM pDom,
    598610                                                 const XSTRING *pstrElementName);
    599611
    600612    PCMATTRIBUTEDECL xmlFindAttribDecl(PXMLDOM pDom,
    601613                                       const XSTRING *pstrElementName,
    602                                        const XSTRING *pstrAttribName);
     614                                       const XSTRING *pstrAttribName,
     615                                       PCMATTRIBUTEDECLBASE *ppAttribDeclBase);
    603616
    604617#endif
Note: See TracChangeset for help on using the changeset viewer.