Not quite. This line:
attrVal =
nodeElement->getAttribute(XMLString::transcode(attributeName));
has a memory leak.
XMLCh* attrName = XMLString::transcode(attributeName);
attrVal = nodeElement->getAttribute(attrName);
delete [] attrName;
Dave
"Andreas B.
Thun" To: [EMAIL PROTECTED]
<[EMAIL PROTECTED]> cc: (bcc: David N
Bertoni/Cambridge/IBM)
Subject: Re: parsing DOM tree: How to
get attribute values ( I don�t
03/24/2003 08:26 like mondays)
AM
Please respond
to xerces-c-dev
it works!!
finally, here is the proper code for the archive:
//
---------------------------------------------------------------------------
// printAttributeValue
//
---------------------------------------------------------------------------
static void printAttributeValue(DOMNode *node, char *attributeName)
{
const XMLCh *attrVal;
char *chAttrVal;
DOMElement *nodeElement = NULL;
if (node)
{
nodeElement = static_cast<DOMElement*>(node);
attrVal =
nodeElement->getAttribute(XMLString::transcode(attributeName));
chAttrVal = XMLString::transcode(attrVal);
std::cout << " attribute: " << chAttrVal << std::endl;
delete [] chAttrVal;
}
return;
} // printAttributeValue()
I was right with that:
> In my opinion the first child of ElementLength
> was the attribute min.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Re: parsing DOM tree: How to get attribute values ( I don=?ISO-8859-1?Q?=B4t_like_mondays=29?=
David N Bertoni/Cambridge/IBM Mon, 24 Mar 2003 08:45:50 -0800
- RE: parsing DOM tree: How to get attribute v... Baliyan, Parul
- Re: parsing DOM tree: How to get attrib... Andreas B. Thun
- Re: parsing DOM tree: How to get at... Andreas B. Thun
- RE: parsing DOM tree: How to get at... Erik Rydgren
- RE: parsing DOM tree: How to ge... Erik Rydgren
- Re: parsing DOM tree: How t... Andreas B. Thun
- Re: parsing DOM tree: ... Alberto Massari
- Re: parsing DOM tr... Andreas B. Thun
- Re: parsing DOM tr... Alberto Massari
- Re: parsing DOM tr... Andreas B. Thun
- Re: parsing DOM tr... David N Bertoni/Cambridge/IBM
- Re: parsing DOM tr... Andreas B. Thun
- Re: parsing DOM tr... Vitaly Prapirny
- Re: parsing DOM tr... Andreas B. Thun
