Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Delphi: Общие вопросы > Xml Collection в Delphi


Автор: AS-Web 24.3.2006, 17:42
Я не могу разобраться, как создать коллекцию XML в Delphi.
Работаю с TXmlDocument и у меня должны быть несколько одинаковых элементов. В Хэлпе написано, что
Цитата

Read Collection to determine whether this node is one of a repeating set of child nodes. The node specified by Collection represents the same node in the XML document as this node’s ParentNode property, but it is specialized to work with this node and any other child nodes of the same type. The node identified by Collection lists ParentNode as the value of its HostNode property.

For example, consider the following XML fragment:

<students>
  <student name="John Smith">
    <grade>incomplete</grade>
  </student>
  <student name="Jane Doe">
    <grade>B+</grade>
  </student>
  <auditor name="Bill Jones"></auditor>
</students>

If this node represents one of the <student> nodes, then ParentNode represents the <students> node, and Collection represents a copy of the <students> node that is used for only those children that are <student> nodes, and not the <auditor> nodes.

If this node does not represent one of a set of repeating child elements, Collection is nil.

то есть достаточно обратиться к Collection ноды, и получим доступ ко всем одноимённым.
НО на практике не получается! Может, кто знает?

Автор: _hunter 24.3.2006, 17:50
код показывай...

Автор: AS-Web 24.3.2006, 17:53
Дык кода нету, я ж говорю , что не могу понять, как создать Элемент коллекции.
То есть прочитать я его не могу, потому что Collection=nil для примера из хелпа, а создать - потому что не могу найти метода

Автор: _hunter 24.3.2006, 18:14
так создать или прочитать?
+ http://delphi.about.com/od/adptips2004/a/bltip1004_4.htm

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)