Home arrow Delphi-Kylix arrow Page 3 - Delphi and the DOM
DELPHI-KYLIX

Delphi and the DOM


Welcome to the second part of a four-part series on Delphi and the DOM. In the first article, we discussed Delphi and XML. Now that you have some idea of the core elements of XML documents, we can talk about how to manipulate them in Delphi.

Author Info:
By: David Web
Rating: 4 stars4 stars4 stars4 stars4 stars / 4
November 10, 2008
TABLE OF CONTENTS:
  1. · Delphi and the DOM
  2. · Coding with the DOM in Delphi
  3. · XMLDOM.pas Unit continued
  4. · Even More XMLDOM.pas Unit

print this article
SEARCH DEVARTICLES

Delphi and the DOM - XMLDOM.pas Unit continued
(Page 3 of 4 )


{ EDOMParseError }


EDOMParseError = class(Exception)

private

FParseError: IDOMParseError;

function GetFilePos: Integer;

function GetLine: Integer;

function GetLinePos: Integer;

function GetReason: DOMString;

function GetSrcText: DOMString;

function GetURL: DOMString;

function GetErrorCode: Integer;

protected

property ParseError: IDOMParseError read FParseError;

public

constructor Create(const ParseError: IDOMParseError; const Msg: string);

property ErrorCode: Integer read GetErrorCode;

property URL: DOMString read GetURL;

property Reason: DOMString read GetReason;

property SrcText: DOMString read GetSrcText;

property Line: Integer read GetLine;

property LinePos: Integer read GetLinePos;

property FilePos: Integer read GetFilePos;

end;


{ IDOMImplementation }


IDOMImplementation = interface

['{2BF4C0E0-096E-11D4-83DA-00C04F60B2DD}']

function hasFeature(const feature, version: DOMString): WordBool;

function createDocumentType(const qualifiedName, publicId, { DOM Level 2 }

systemId: DOMString): IDOMDocumentType; safecall;

function createDocument(const namespaceURI, qualifiedName: DOMString;{ DOM Level 2 }

doctype: IDOMDocumentType): IDOMDocument; safecall;

end;


{ IDOMNode }


IDOMNode = interface(IInterface)

['{2BF4C0E1-096E-11D4-83DA-00C04F60B2DD}']

{ Property Acessors }

function get_nodeName: DOMString; safecall;

function get_nodeValue: DOMString; safecall;

procedure set_nodeValue(value: DOMString); safecall;

function get_nodeType: DOMNodeType; safecall;

function get_parentNode: IDOMNode; safecall;

function get_childNodes: IDOMNodeList; safecall;

function get_firstChild: IDOMNode; safecall;

function get_lastChild: IDOMNode; safecall;

function get_previousSibling: IDOMNode; safecall;

function get_nextSibling: IDOMNode; safecall;

function get_attributes: IDOMNamedNodeMap; safecall;

function get_ownerDocument: IDOMDocument; safecall;

function get_namespaceURI: DOMString; safecall;

function get_prefix: DOMString; safecall;

function get_localName: DOMString; safecall;

{ Methods }

function insertBefore(const newChild, refChild: IDOMNode): IDOMNode; safecall;

function replaceChild(const newChild, oldChild: IDOMNode): IDOMNode; safecall;

function removeChild(const childNode: IDOMNode): IDOMNode; safecall;

function appendChild(const newChild: IDOMNode): IDOMNode; safecall;

function hasChildNodes: WordBool; safecall;

function cloneNode(deep: WordBool): IDOMNode; safecall;

procedure normalize; safecall; { DOM Level 2 }

function supports(const feature, version: DOMString): WordBool; { DOM Level 2 }

{ Properties }

property nodeName: DOMString read get_nodeName;

property nodeValue: DOMString read get_nodeValue write set_nodeValue;

property nodeType: DOMNodeType read get_nodeType;

property parentNode: IDOMNode read get_parentNode;

property childNodes: IDOMNodeList read get_childNodes;

property firstChild: IDOMNode read get_firstChild;

property lastChild: IDOMNode read get_lastChild;

property previousSibling: IDOMNode read get_previousSibling;

property nextSibling: IDOMNode read get_nextSibling;

property attributes: IDOMNamedNodeMap read get_attributes;

property ownerDocument: IDOMDocument read get_ownerDocument;

property namespaceURI: DOMString read get_namespaceURI; { DOM Level 2 }

property prefix: DOMString read get_prefix; { DOM Level 2 }

property localName: DOMString read get_localName; { DOM Level 2 }

end;


blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials