XML: How to import >1024 chars

rozema
Member Posts: 15
Hello all,
Could/would someone help? (Checked out Mibuso before posting this but could not find the solution or make it work)
My issue: I need to import xml file with a field > 1024 Characters. (in this example code import the calendar data from outlook).
I do not want to use xml port but use the automation variables.
I receive the error "the length of the text string exceeds the size of the string buffer".
I tried to use other XML automation type (eg 'Microsoft XML, v6.0'.IXMLDOMText), but I could not get it working:
Anyone knows how to fix this (and want to share)? Much appreciated!!!!!
IF ISCLEAR(XMLDocument) THEN CREATE(XMLDocument);
XMLDocument.load('x:\tmp\Calendar.xml');
XMLNodeList := XMLDocument.getElementsByTagName('Calendar');
XMLNode := XMLNodeList.item(0);
BEGIN
REPEAT
i := i + 1;
Cal_Rec.INIT;
Cal_Rec."No." := i;
Cal_Rec.Subject := XMLNode.selectNodes('Subject').item(0).text;
EVALUATE(Cal_Rec.StartDate,XMLNode.selectNodes('StartDate').item(0).text);
Cal_Rec.MeetingOrganizer := XMLNode.selectNodes('MeetingOrganizer').item(0).text;
Cal_Rec.Categories := XMLNode.selectNodes('Categories').item(0).text;
// CODE LINE BELOW IS THE PROBLEM...
Cal_Rec.Description := copystr(XMLNode.selectNodes('Description').item(0).text,1,250);
//
Cal_Rec.INSERT;
XMLNode := XMLNodeList.nextNode;
UNTIL ((ISCLEAR(XMLNode)) OR (i = 10));
END;
Kind regards, Peter
Could/would someone help? (Checked out Mibuso before posting this but could not find the solution or make it work)
My issue: I need to import xml file with a field > 1024 Characters. (in this example code import the calendar data from outlook).
I do not want to use xml port but use the automation variables.
I receive the error "the length of the text string exceeds the size of the string buffer".
I tried to use other XML automation type (eg 'Microsoft XML, v6.0'.IXMLDOMText), but I could not get it working:
Anyone knows how to fix this (and want to share)? Much appreciated!!!!!
IF ISCLEAR(XMLDocument) THEN CREATE(XMLDocument);
XMLDocument.load('x:\tmp\Calendar.xml');
XMLNodeList := XMLDocument.getElementsByTagName('Calendar');
XMLNode := XMLNodeList.item(0);
BEGIN
REPEAT
i := i + 1;
Cal_Rec.INIT;
Cal_Rec."No." := i;
Cal_Rec.Subject := XMLNode.selectNodes('Subject').item(0).text;
EVALUATE(Cal_Rec.StartDate,XMLNode.selectNodes('StartDate').item(0).text);
Cal_Rec.MeetingOrganizer := XMLNode.selectNodes('MeetingOrganizer').item(0).text;
Cal_Rec.Categories := XMLNode.selectNodes('Categories').item(0).text;
// CODE LINE BELOW IS THE PROBLEM...
Cal_Rec.Description := copystr(XMLNode.selectNodes('Description').item(0).text,1,250);
//
Cal_Rec.INSERT;
XMLNode := XMLNodeList.nextNode;
UNTIL ((ISCLEAR(XMLNode)) OR (i = 10));
END;
Kind regards, Peter
0
Comments
-
Sounds like you are running on NAV2009 as NAV2013 and forward can handle unlimited strings.
Anways; Last time I had the same problem (in XBRL in NAV5) I wrote the xml node to a BLOB, and then read it back one piece at the time. That way you can copy or split the description. But it is a bit cumbersome.Bardur Knudsen
Microsoft - Dynamics NAV0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions