definition Property

Returns the definition of the node in the document type definition (DTD) or schema.

var objXMLDOMNode = oXMLDOMNode.definition;

HRESULT get_definition(
  IXMLDOMNode** definitionNode
);

General Remarks

The definition property is not supported when using inline schemas. This behavior is by design because the node being referenced can be deleted or modified after the document is loaded, yielding unpredictable results.

This value depends on the value of the nodeType property.

Value Description
NODE_ENTITY_REFERENCE Returns the node for the entity referenced; that is, the ENTITY element that was defined for a given ENTITYREF. Given the ENTITYREF &x;, for example, the definition property returns the node in the DOCTYPE node's entity collection that defines the corresponding ENTITY: <!ENTITY x "y">.
NODE_ENTITY For unparsed entities, returns the NOTATION definition from the DOCTYPE node's notation collection. For example, given the ENTITY <!ENTITY networth SYSTEM "networth.xls" NDATA XLS>, the definition property returns the node corresponding to the notation <!NOTATION XLS PUBLIC "http://example.microsoft.com/office/excel">. For parsed entities, returns Null.
NODE_ATTRIBUTE Returns the XML-Data Schema AttributeType for a given ATTRIBUTE node. For example, the definition property for the attribute myAttribute="123" returns the node corresponding to the element <AttributeType name= "myAttribute"> in the schema. Returns Null when a DTD is used or when no schema is present.
NODE_ELEMENT Returns the XML-Data Schema ElementType for a given ELEMENT node. For example, given the element <myelement>, the definition property returns the node <ElementType name="myelement"> in the specified external schema. Returns Null when a DTD is used or when no schema is present.
NODE_CDATA_SECTION, NODE_COMMENT, NODE_DOCUMENT, NODE_DOCUMENT_FRAGMENT, NODE_DOCUMENT_TYPE, NODE_NOTATION, NODE_PROCESSING_INSTRUCTION, NODE_TEXT Returns Null.

The definition property is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM). The property is read-only, and applies to the following objects and interfaces:IXMLDOMAttribute, IXMLDOMCDATASection, IXMLDOMCharacterData, IXMLDOMComment, DOMDocument, IXMLDOMDocumentFragment, IXMLDOMDocumentType, IXMLDOMElement, IXMLDOMEntity, IXMLDOMEntityReference, IXMLDOMNode, IXMLDOMNotation, IXMLDOMProcessingInstruction, IXMLDOMText, and IXTLRuntime.

See Also

nodeType Property

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.