NAV writing blob to xmldom

jwilder
Member Posts: 263
I am using the xmldom automation to create an Item Export. (I have NAV 2009 R2)
My one problem is that I have a blob field with text that is over 1024 characters.
How can you write to a node if you have more than 1024 characters?
xmlnode.text := bigtext unfortunatley does not work. Maybe I could use a variant variable or is there an xmldom command to add text so I could call it multiple times?
My one problem is that I have a blob field with text that is over 1024 characters.
How can you write to a node if you have more than 1024 characters?
xmlnode.text := bigtext unfortunatley does not work. Maybe I could use a variant variable or is there an xmldom command to add text so I could call it multiple times?
Jason Wilder
jwilder@stonewallkitchen.com
jwilder@stonewallkitchen.com
0
Answers
-
I think you need to use attributes, as shown in this reply.* Daniele Rebussi * | * Rebu NAV Diary *0
-
The data can not be written to an attribute only an element. But based on your post I do see a " NodeText.appendData" which is what I need.
I can do this:
Node.Text := first 1024 characters;
nodetext.appendData(second1024 characters);
nodetext.appendData(third1024 characters);
etc...
The only problem now is I can't figure out how to instantiate the nodetext automation variable. The variable is 'Microsoft XML, v6.0'.IXMLDOMText. It compiles when I do nodetext := node; but I get an error during runtime.
Anyone know how to instantiate a nodetext variable of type automation ('Microsoft XML, v6.0'.IXMLDOMText)?Jason Wilder
jwilder@stonewallkitchen.com0 -
Have you tried in this way?
xmlTextNode := xmlDoc.createTextNode('');
An alternative way would be to export the data with an xmlport property of the text field to BigText and use the AddText method.* Daniele Rebussi * | * Rebu NAV Diary *1 -
Xmlports do totally work with bigtext but unfortunately I have other requirements such as hiding and showing certain elements based on certain conditions.
Based on your post I was able to get this to work so thanks a lot!
I ended up with this:
variables:
NewNode 'Microsoft XML, v6.0'.IXMLDOMNode
xmlTextNode 'Microsoft XML, v6.0'.IXMLDOMText
TextArray - Text1024 Dimensions=2
xmlTextNode := XMLDoc.createTextNode(TextArray[1]);
NewNode.appendChild(xmlTextNode);
xmlTextNode.appendData(TextArray[2]);
This is just a snipet and does include creation of xmldoc and elements. Newnode was already instantiated so you don't see that here. TextArray[1] has 1024 characters of data in it as does TextArray[2].Jason Wilder
jwilder@stonewallkitchen.com0 -
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