Re: Kak получить список childNodes ?
От: atrofa Украина  
Дата: 15.09.04 06:58
Оценка:
Здравствуйте, Аноним, Вы писали:

А><root>

А> <param name="AA" type="int">
А> <constraint type="range">
А> </constraint>
А> </param>
А> <param name="BB" type= "string">
А> <constraint type="oneof">
А> </constraint>
А> <constraint type="oneof">
А> </constraint>
А> </param>
А></root>

А>Есть XML(вверху) и есть код(внизу):


А>[из org.w3c.dom]


А>Node root = doc.getFirstChild();

А>NodeList params = root.getChildNodes();
А>int g = params.getLength();


CComPtr<IXMLDOMDocument> spXMLDom = NULL;
CComPtr<IXMLDOMElement> psElement = NULL;

VARIANT_BOOL bResult;

spXMLDom.CoCreateInstance(__uuidof(DOMDocument));
spXMLDom->load(CComVariant(L"test.xml"), &bResult);

spXMLDom->selectNodes(CComBSTR(L"//param"),&spNodesList);
long nLenNodeList;
spNodesList->get_length(&nLenNodeList);
вроде так...
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.