XML Export large strings

FPulsfort
Member Posts: 43
Hi,
i need to export a long string to a xml-file. The string contains about 5000 and more characters. When i use a xml-port i get an error message that the string is to long. I've created an element and try to assign the text to this element with e.g. 5 Textvariables each containing 1024 characters. But i get the above mentioned error. When i try to use automation i will get an error that my stack is not large enough.
Can anyone point me to the right direction?
Regards,
Frank
i need to export a long string to a xml-file. The string contains about 5000 and more characters. When i use a xml-port i get an error message that the string is to long. I've created an element and try to assign the text to this element with e.g. 5 Textvariables each containing 1024 characters. But i get the above mentioned error. When i try to use automation i will get an error that my stack is not large enough.
Can anyone point me to the right direction?
Regards,
Frank
0
Comments
-
-
Thanks for your answer, Denster.
i tried both but without success. First i use an xmlport. I inserted a tag teststring with tagtype text. Then i assign 10 Textvariables to the tag like
teststring := Text1 + Text2 + ... + Text10;
When i run the xmlport i get an error that the string is too long for teststring
then i tried to use 'Microsoft XML, v3.0'.IXMLDOMNode. But when i try the same with XMLDomNode,
XMLNode.Text := Text1 + Text2 + ... + Text10;
i get the same error message.
Can you give me an example how to handle this, please?
Thanks and kind regards,
Frank0 -
An XMLPort builds an XML document based on a NAV table, so al you have to do is send in a record. Check out the XML codeunits in the standard Biztalk functionality, and you'll find some examples of how to do that.0
-
Try changing the property of the XMLport text field to BigText and use the ADDTEXT method.Cheers
Carsten
==> How To Ask Questions The Smart Way
This post is my own opinion and does not necessarily reflect the opinion or view of my employer.0 -
Hello. You can't use xml dom because of 250 limit to COM in navision.
You can use xmlports. here is an example.OBJECT XMLport 50001 test { OBJECT-PROPERTIES { Date=04/30/07; Time=[ 8:39:10 PM]; Modified=Yes; Version List=; } PROPERTIES { } ELEMENTS { { [{F174CB18-55F2-4B26-AFEC-D03684586883}]; ;item ;Element ;Table ; VariableName=Item; SourceTable=Table27 } { [{EA1C7685-B63B-4ACA-9C7D-37B6F68258D5}];1 ;No ;Element ;Field ; DataType=Code; SourceField=Item::No. } { [{82C87225-3CA3-4990-9ECF-E976336175C7}];1 ;LargeText ;Element ;Text ; Import::OnAfterAssignVariable=BEGIN Item.Description := COPYSTR(LargeText,1,30); Item."Description 2" := COPYSTR(LargeText,30,30); //Item.modify; END; } } EVENTS { } CODE { BEGIN END. } }
0 -
ara3n wrote:You can't use xml dom because of 250 limit to COM in navision.
It is both possible to read and write elements bigger than 250 char directly with xmldom from C/AL. Now I think of it, I remember making a Base64 encoder and decoder in C/AL and was able to transfer binary files to/from CDATA sections.Regards
Peter0 -
ara3n wrote:Hello. You can't use xml dom because of 250 limit to COM in navision.0
-
DenSter wrote:ara3n wrote:Hello. You can't use xml dom because of 250 limit to COM in navision.
What I mean is any function that returns a string that is greater than 250 will error out.
For example XMLNode.text can return a string that is greater than 250 and you'll get the error.
the XMLNode.appenddata doesn't have appenddata.
For example
You cannot read the following xml file with xmldom.<?xml version="1.0" encoding="UTF-16" standalone="no"?> <item> <No>ha002</No> <LargeText>1111111111111111111111122222222222228888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888882222222222222222222234444444444444444222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222224444</LargeText> </item>
0 -
Sure that will fail, due to maximum variable length in the app for individual element values. But you CAN have a wellformed XML text string that is longer than 250 loaded into an XMLDOM object. I've loaded hundreds of Items in one XML document and successfully imported them into NAV with an XMLPort.0
-
ara3n wrote:You cannot read the following xml file with xmldom.
You can read unlimited nodevalues, but not using xmlnode.text. Take a look at the substringData method...
Well, seems time to make an example for he Tips'n Tricks section 8)Regards
Peter0 -
Hello SilverX,
That it. Now it works.
Thanks for all your answers.
Regards,
Frank0
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