Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: xml element text being concatenated xml element text being concatenatedTo: NULL Date: 12/6/2005 2:08:00 PM I have a question on the max size of text that can be contained in an
XML element body when using msxml? I have the following code, which
works well when I have a small amount of text in the element body. My
application places a large block of text in the element body and this
ends up losing data when I try and parse it out.
Any thoughts?
Thanks.
LPTSTR XMLEventParser::getElementText(CComPtr<IXMLDOMNodeList>
nodeList, wchar_t* attrName)
{
HRESULT hr;
CComBSTR attrNameAttr("name");
CComVariant attrNameVal(VT_EMPTY);
CComPtr<IXMLDOMElement> iElement;
CComPtr<IXMLDOMNode> iNode;
BSTR eleText = NULL;
while((nodeList->nextNode(&iNode)) != S_FALSE)
{
hr = iNode->QueryInterface(IID_IXMLDOMElement, (LPVOID*)&iElement);
if(SUCCEEDED(hr))
{
iElement->getAttribute(attrNameAttr, &attrNameVal);
if(wcscmp(attrNameVal.bstrVal, attrName) == 0)
{
iElement->get_text(&eleText);
if(eleText != NULL)
{
return newStringFromBSTR(eleText);
}
}
}
attrNameVal.Clear();
iNode = NULL;
iElement = NULL;
}
return NULL;
}
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
