Hi
I have a strange issue with the xml domnode.text, if the text is very long (> 250?).
Both of the 2 ffw. code snippets produce the error "The length of the text string exceeds the size of the string buffer". NewValue is a string with the maxlength of 250.
1)
NewValue := COPYSTR(DOMNode.text,1,250);
2)
DOMNodeText.data := DOMNode.text; //error happens here
NewValue := DOMNodeText.substringData(1,250);
Any ideas? Thank you in advance
Thomas
PS: I hope I didn't post twice, because there was an error with the internet connection when I wanted to post 1 hour ago...
0
Comments
Still having the same problem, maybe it's how Navision handles automation objects, see
http://www.mibuso.com/forum/viewtopic.php?t=7980
Any ideas/comments will be appreciated.
Many thanks in advance.
Thomas
The text of a DOMNode is an object of type IXMLDOMText. You can get at it like this:
Thank you for your info. So far it works now.
CREATE(XMLDom);
XMLDom.async := FALSE;
XMLDom.load('c:\books.xml');
DOMElement := XMLDom.documentElement;
DOMNode := DOMElement.selectSingleNode('//book/description');
// this works
DOMNodeText := DOMNode.firstChild;
// this produces a compile error "an assigment is not allowed for this //variable
DOMNodeText := DOMNode.text;
NewValue := DOMNodeText.substringData(1,250);
Anyway, I'm not so happy with the firstchild property. Is there no way to use the text property?
Thanks in advance
Thomas
RIS Plus, LLC
Does this work for you with Text longer than 250 too? If yes, can you post the code snippet?
To precise my last posting: For me it seems more consequent to use the text-property of a node, rather than use the firstchild-property. However, firstchild works with long text, text doesn't. :?
Any comments to that?
Thomas