Items (xmldoc)

De Wiki1000
(Différences entre les versions)
(Nouvelle page : <source lang='delphi'>property Items[index:Integer]:TxmlItem;</source> '''Lecture/Ecriture''' Cette propriété accède aux éléments racines. Exemple: <source lang='delphi'> pro...)
 
 
Ligne 1 : Ligne 1 :
 
<source lang='delphi'>property Items[index:Integer]:TxmlItem;</source>
 
<source lang='delphi'>property Items[index:Integer]:TxmlItem;</source>
  
'''Lecture/Ecriture'''
+
'''Lecture seule'''
  
 
Cette propriété accède aux éléments racines.
 
Cette propriété accède aux éléments racines.
Ligne 11 : Ligne 11 :
 
   if doc.Count<>0 then
 
   if doc.Count<>0 then
 
   doSomething(doc.Items[0]);
 
   doSomething(doc.Items[0]);
 +
end;
 +
</source>
 +
 +
'''Utilisation en itérateur'''
 +
<source lang='delphi'>
 +
procedure foo(doc:TxmlDocument);
 +
var itm:TxmlItem;
 +
begin
 +
  foreach itm in doc do
 +
  doSomething(itm);
 
end;
 
end;
 
</source>
 
</source>

Version actuelle en date du 11 août 2009 à 09:12

property Items[index:Integer]:TxmlItem;

Lecture seule

Cette propriété accède aux éléments racines.

Exemple:

procedure foo(doc:TxmlDocument);
begin
  if doc.Count<>0 then
   doSomething(doc.Items[0]);
end;

Utilisation en itérateur

procedure foo(doc:TxmlDocument);
var itm:TxmlItem;
begin
  foreach itm in doc do
   doSomething(itm);
end;

Voir aussi:

Documents XML (tech)Développement DSM





Whos here now:   Members 0   Guests 0   Bots & Crawlers 1
 
Outils personnels