|
NAMEDOM_Node - the Document Object Model (DOM) DOM_Node interfaceSYNOPSIS#include <domc.h> DOM_Node *DOM_Node_insertBefore(DOM_Node *this, DOM_Node *newChild, DOM_Node *refChild); DESCRIPTIONValues of nodeName, nodeValue, and attributes according to node typeNode InterfacenodeNamenodeValuenodeType DOM_Attrnameofattributevalueofattribute DOM_ATTRIBUTE_NODE DOM_CDATASection#cdata-sectioncontentoftheCDATASection DOM_CDATA_SECTION_NODE DOM_Comment#commentcontentofthecomment DOM_COMMENT_NODE DOM_Document#document NULL DOM_DOCUMENT_NODE DOM_DocumentFragment#document-fragment NULL DOM_DOCUMENT_FRAGMENT_NODE DOM_DocumentTypedocumenttypename NULL DOM_DOCUMENT_TYPE_NODE DOM_Elementtagname NULL DOM_ELEMENT_NODE DOM_Entityentityname NULL DOM_ENTITY_NODE DOM_EntityReferencenameofentityreferenced NULL DOM_ENTITY_REFERENCE_NODE DOM_Notationnotationname NULL DOM_NOTATION_NODE DOM_ProcessingInstructiontargetcontentexcludingtarget DOM_PROCESSING_INSTRUCTION_NODE DOM_Text#textcontentofthetextnode DOM_TEXT_NODEThe DOM_Node type is the primary datatype of the Document Object Model. Most of the other DOM interfaces inherit this interface. All DOM_Nodes have nodeName, nodeValue, and nodeType members. The vaules of these members depends on the node type. For example the DOM_Element node has a nodeValue corresponding to the tag name and a NULL nodeValue.Only the DOM_Element node type has attributes. All other node types have a NULL attributes member. Child nodes are accessable through the childNodes DOM_NodeList member and the firstChild, lastChild, previousSibling, and nextSibling members. Not all element types have child nodes. In DOMC node inheritance is emulated with simple typedef statements and a union that contains all possible subclass attributes. To access a child interface specific attribute it may be necessary to access it through this union. For example the systemId of a notation node is currently only accessible through the union like: DOM_String *sysid; sysid = node->u.Notation.systemId; Care must be taken when modifing these union members (this is not well defined yet). Attributes accessible through the union that may need to be modified have helper methods to make this less awkward. The DOM_Node_setNodeValue function must be used to set the nodeValue member.Functions to get and set certain node members DOM_Node_getNodeValueget nodeValue attribute DOM_Node_setNodeValueset nodeValue and corresponding value in child interface DOM_Document_getDoctypegetthe doctype node of the document DOM_Document_getDocumentElementgetthe documentElement of the document DOM_CharacterData_getLengthgetthe length of a DOM_Text, DOM_Comment, DOM_CDATASection, or DOM_ProcessingInstruction The all-important DOM_Node structure follows although some fields are left out in the interest of brevity. It may be necessary to look at this structure in the domc.h header. struct DOM_Node { DOM_String *nodeName; DOM_String *nodeValue; unsigned short nodeType; DOM_Node *parentNode; DOM_NodeList *childNodes; DOM_Node *firstChild; DOM_Node *lastChild; DOM_Node *previousSibling; DOM_Node *nextSibling; DOM_NamedNodeMap *attributes; DOM_Document *ownerDocument; union { struct { DOM_DocumentType *doctype; DOM_Element *documentElement; DOM_String *version; DOM_String *encoding; int standalone; } Document; struct { DOM_NamedNodeMap *entities; DOM_NamedNodeMap *notations; DOM_String *publicId; DOM_String *systemId; DOM_String *internalSubset; } DocumentType; struct { int specified; DOM_Element *ownerElement; } Attr; struct { int length; } CharacterData; struct { DOM_String *publicId; DOM_String *systemId; } Notation; struct { DOM_String *publicId; DOM_String *systemId; DOM_String *notationName; } Entity; struct { DOM_String *target; DOM_String *data; } ProcessingInstruction; } u; };
RETURNS
Visit the GSP FreeBSD Man Page Interface. |