|
-
February 15th, 2005, 08:14 AM
#1
XML DOM problem with node
Hi,
I have an XML document..
<register name="RID" length="32" address="0x8" resetval="000" access="rw">
<element name="RID" offset="1" length="7" access="rw">
<desc>Revision Identification Number. </desc>
<modified>true</modified>
<state text="A0 stepping" value="" />
<state text="A1 stepping" value="" />
<state text="A2 stepping" value="" />
<state text="B0 stepping" value="" />
</element>
</register>
I need to access the "state" programically using MSXML..
I could reach till element and their attributes..
But I am unable to get to the "state" and text and value associated with it..
Anybody had any idea..
i have used the code below..
Code:
IXMLDOMNode *pNode;
IXMLDOMNode *pNode_child;
IXMLDOMNodeList *childList;
long atlen, pos,
hr = pNode->get_childNodes(&childList); // gives the list of nodes under register
hr = childList->get_length(&atlen_child);
for(pos =0; pos<atlen_child;pos++)
{
hr = childList ->nextNode(&pNode_child);
myFunc(pNode_child);
}
void myFunc(IXMLDOMNode *pNode_child)
{
IXMLDOMNamedNodeMap *AtMap;
pNode_child->get_attributes(&AtMap);
AtMap->get_length(&atlen);
for(pos = 0; pos<atlen;pos++)
{
// now we have the attributes of the element node..
// now what shud be done for getting the 'state '
}
}
Thank you
-
February 15th, 2005, 09:14 AM
#2
Re: XML DOM problem with node
You have not created the instance of 'pNode' and directly using it.
- Ajay.
-
February 15th, 2005, 10:03 AM
#3
Re: XML DOM problem with node
I dont understand..
could you explain?
-
February 16th, 2005, 06:36 AM
#4
Re: XML DOM problem with node
Why not "pNode_child->getAttribute("text")" ?
I dont understand..
could you explain?
Ajay Vijay coplain about missing things like that:
".CreateDispatch("MSXML2.DOMDocument")", "loadXML(" ... etc.
U delcared "IXMLDOMNode *pNode;" but there is no assigment to that pointer.
Best regards,
Krzemo.
Last edited by Krzemo; February 16th, 2005 at 06:45 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|