XML Overflow

chupaxchupax Member Posts: 9
Hello

I wrote the following code:

ltBody := lXMLMsgNode.selectnodes('Body').item(0).text;

With ltBody = Text250 and lXMLMsgNode = 'Microsoft XML,v3.0'.LXMLDOMNode (automation)

The body of the XML is of lenght 376 (spaces included).
As expected I get an overflow-error.
To avoid this I changed my code to:

ltBody := copystr(lXMLMsgNode.selectnodes('Body').item(0).text,1,250);

After the change I have an other error, but the error still says that my value is to large.

The next step I tried was

message('%1',copystr(lXMLMsgNode.selectnodes('Body').item(0).text,1,250));

In this last case he gave the error on the message.

Could anyone tell what I'm doing wrong or give a sollution to my problem?

Many thanks in advance.

Comments

  • jhoekjhoek Member Posts: 216
    Text nodes implement the IXMLDOMCharacterData interface. This interface defines a substringData method which will allow you to safely retrieve part of the string, regardless of it's length. Check out the MSXML SDK documentation for more info.
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • ta5ta5 Member Posts: 1,164
  • chupaxchupax Member Posts: 9
    Thanks alot.

    It works fine with the XMLDOMText.
Sign In or Register to comment.