how can we remove an attribute from IXMLDOMNodePtr??? - XML SOAP
This is a discussion on how can we remove an attribute from IXMLDOMNodePtr??? - XML SOAP ; wanted to remove "Name" attribute from the below tag, but i am only having
IXMLDOMNode pointer and not IXMLDOMElement pointer of "Option".
removeAttribute method is only available in IXMLDOMElement interface.
<Option Name="ABCD">0</Option>
I tried the below code and it works ...
-
how can we remove an attribute from IXMLDOMNodePtr???
wanted to remove "Name" attribute from the below tag, but i am only having
IXMLDOMNode pointer and not IXMLDOMElement pointer of "Option".
removeAttribute method is only available in IXMLDOMElement interface.
<Option Name="ABCD">0</Option>
I tried the below code and it works properly,but my concern is if it is
correct to just assign pOptionNode to pTempElement.
MSXML2::IXMLDOMElementPtr pTempElement = pOptionNode; //pOptionsNode is
IXMLDOMNode of
"Options".Is this right to do?
_bstr_t bstrName = "Name";
hRes = pTempElement->removeAttribute(bstrName);
If assigning IXMLDOMNodePtr to IXMLDOMElementPtr is incorrect? how can we
remove an attribute from the available IXMLDOMNodePtr???
Regards,
Alamelu N
-
RE: how can we remove an attribute from IXMLDOMNodePtr???
Proper way is to use QueryInterface() to get an interface pointer to
IXMLDOMElement. Even it works for you, it can change in the future since it
is an implementation detail.
--
S. Huseyin Ulger [MSFT]
MSXML Dev
"Alamelu" wrote:
> wanted to remove "Name" attribute from the below tag, but i am only having
> IXMLDOMNode pointer and not IXMLDOMElement pointer of "Option".
> removeAttribute method is only available in IXMLDOMElement interface.
>
> <Option Name="ABCD">0</Option>
>
> I tried the below code and it works properly,but my concern is if it is
> correct to just assign pOptionNode to pTempElement.
>
> MSXML2::IXMLDOMElementPtr pTempElement = pOptionNode; //pOptionsNode is
> IXMLDOMNode of
> "Options".Is this right to do?
> _bstr_t bstrName = "Name";
> hRes = pTempElement->removeAttribute(bstrName);
>
> If assigning IXMLDOMNodePtr to IXMLDOMElementPtr is incorrect? how can we
> remove an attribute from the available IXMLDOMNodePtr???
>
> Regards,
> Alamelu N
Similar Threads
-
By Application Development in forum Sharepoint
Replies: 0
Last Post: 08-29-2007, 12:44 AM
-
By Application Development in forum Javascript
Replies: 4
Last Post: 04-24-2007, 09:53 AM
-
By Application Development in forum XML SOAP
Replies: 6
Last Post: 12-08-2006, 10:03 AM
-
By Application Development in forum XML SOAP
Replies: 2
Last Post: 07-27-2006, 01:32 AM
-
By Application Development in forum Microsoft Exchange
Replies: 1
Last Post: 12-08-2003, 03:35 PM