Home arrow Delphi-Kylix arrow Page 4 - 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 - Even More XMLDOM.pas Unit
(Page 4 of 4 )


{ IDOMNodeList }


IDOMNodeList = interface

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

{ Property Acessors }

function get_item(index: Integer): IDOMNode; safecall;

function get_length: Integer; safecall;

{ Properties }

property item[index: Integer]: IDOMNode read get_item; default;

property length: Integer read get_length;

end;


{ IDOMNamedNodeMap }


IDOMNamedNodeMap = interface

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

{ Property Acessors }

function get_item(index: Integer): IDOMNode; safecall;

function get_length: Integer; safecall;

{ Methods }

function getNamedItem(const name: DOMString): IDOMNode; safecall;

function setNamedItem(const arg: IDOMNode): IDOMNode; safecall;

function removeNamedItem(const name: DOMString): IDOMNode; safecall;

function getNamedItemNS(const namespaceURI, localName: DOMString): IDOMNode; safecall; { DOM Level 2 }

function setNamedItemNS(const arg: IDOMNode): IDOMNode; safecall; { DOM Level 2 }

function removeNamedItemNS(const namespaceURI, localName: DOMString): IDOMNode; safecall; { DOM Level 2 }

{ Properties }

property item[index: Integer]: IDOMNode read get_item; default;

property length: Integer read get_length;

end;


{ IDOMCharacterData }


IDOMCharacterData = interface(IDOMNode)

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

{ Property Acessors }

function get_data: DOMString; safecall;

procedure set_data(const data: DOMString); safecall;

function get_length: Integer; safecall;

{ Methods }

function substringData(offset, count: Integer): DOMString; safecall;

procedure appendData(const data: DOMString); safecall;

procedure insertData(offset: Integer; const data: DOMString); safecall;

procedure deleteData(offset, count: Integer); safecall;

procedure replaceData(offset, count: Integer; const data: DOMString); safecall;

{ Properties }

property data: DOMString read get_data write set_data;

property length: Integer read get_length;

end;


{ IDOMAttr }


IDOMAttr = interface(IDOMNode)

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

{ Property Acessors }

function get_name: DOMString; safecall;

function get_specified: WordBool; safecall;

function get_value: DOMString; safecall;

procedure set_value(const attributeValue: DOMString); safecall;

function get_ownerElement: IDOMElement; safecall;

{ Properties }

property name: DOMString read get_name;

property specified: WordBool read get_specified;

property value: DOMString read get_value write set_value;

property ownerElement: IDOMElement read get_ownerElement; { DOM Level 2 }

end;


{ IDOMElement }


IDOMElement = interface(IDOMNode)

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

{ Property Acessors }

function get_tagName: DOMString; safecall;

{ Methods }

function getAttribute(const name: DOMString): DOMString; safecall;

procedure setAttribute(const name, value: DOMString); safecall;

procedure removeAttribute(const name: DOMString); safecall;

function getAttributeNode(const name: DOMString): IDOMAttr; safecall;

function setAttributeNode(const newAttr: IDOMAttr): IDOMAttr; safecall;

function removeAttributeNode(const oldAttr: IDOMAttr): IDOMAttr; safecall;

function getElementsByTagName(const name: DOMString): IDOMNodeList; safecall;

function getAttributeNS(const namespaceURI, localName: DOMString): DOMString; safecall; { DOM Level 2 }

procedure setAttributeNS(const namespaceURI, qualifiedName, value: DOMString); safecall; { DOM Level 2 }

procedure removeAttributeNS(const namespaceURI, localName: DOMString); safecall; { DOM Level 2 }

function getAttributeNodeNS(const namespaceURI, localName: DOMString): IDOMAttr; safecall; { DOM Level 2 }

function setAttributeNodeNS(const newAttr: IDOMAttr): IDOMAttr; safecall; { DOM Level 2 }

function getElementsByTagNameNS(const namespaceURI,

localName: DOMString): IDOMNodeList; safecall; { DOM Level 2 }

function hasAttribute(const name: DOMString): WordBool; safecall; { DOM Level 2 }

function hasAttributeNS(const namespaceURI, localName: DOMString): WordBool; safecall; { DOM Level 2 }

{ Properties }

property tagName: DOMString read get_tagName;

end;


{ IDOMText }


IDOMText = interface(IDOMCharacterData)

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

function splitText(offset: Integer): IDOMText; safecall;

end;


{ IDOMComment }


IDOMComment = interface(IDOMCharacterData)

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

end;


{ IDOMCDATASection }


IDOMCDATASection = interface(IDOMText)

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

end;



In the next article we will look at a partial listing of the xmlintf unit and then write a program to demonstrate how to use DOM in Delphi.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

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