Load InStream to Xml Automation

PureHeart
Member Posts: 190
Hi All,
I'm really struggling here with something that should be simple....
What I am trying to do is to load a stream to the XML DOMDocument automation without saving it to a file and then loading it.......but it doesn't work the load instruction fails without any error but simply not writing anything to the automation...
here's the code
Please HELP!!!
Thanks ALL
I'm really struggling here with something that should be simple....
What I am trying to do is to load a stream to the XML DOMDocument automation without saving it to a file and then loading it.......but it doesn't work the load instruction fails without any error but simply not writing anything to the automation...
here's the code
CREATE(XMLDocOut); TempBlob.Blob.CREATEOUTSTREAM(OutStream); OutStream.WRITE('<a>test</a>'); IF TempBlob.Blob.HASVALUE THEN BEGIN TempBlob.Blob.CREATEINSTREAM(StreamInObj); //This always returns zero, so the loading fails..but WHY???? MESSAGE(FORMAT(XMLDocOut.load(StreamInObj))); END; //This File is empty XMLDocOut.save('c:\stream2.xml')
Please HELP!!!
Thanks ALL
Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=1123
http://www.mibuso.com/dlinfo.asp?FileID=1123
0
Comments
-
use TempBlob.CALCFIELDS(Blob) before TempBlob.Blob.HASVALUE0
-
yes i'm using calcfields but it doesn't change....:(Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Please HELP!
Am I the only one that had this idea?? ](*,)Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Use WRITETEXT instead of WRITE.
Maybe you should also not name Fields and Variables with reserved Words like Blob or OutStream.0 -
Alexander Broz wrote:Use WRITETEXT instead of WRITE.
Maybe you should also not name Fields and Variables with reserved Words like Blob or OutStream.
Thank you so much Alexander I thought I tried the WRITETEXT but.....It is now working!
This is the code that will work:CREATE(XMLDocOut); TempBlob.Blob.CREATEOUTSTREAM(OutStream); OutStream.WRITETEXT('<a>test'); OutStream.WRITETEXT('<b>test'); OutStream.WRITETEXT('<c>test</c></b></a>'); TempBlob.Blob.CREATEINSTREAM(InStream); XMLDocOut.load(InStream); XMLDocOut.save('c:\stream2.xml')
Thanks Again and I hope this will help someone else!Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Hiii PureHeart, nice post.... i need your help actually i have to do similar kind of thing, i would be thankful to you if you could tell me the type of the variables that you have used in this code.
Thanks in advance =D>0 -
Yes sure the XMLDocOut is an automation of Microsoft XML, v3.0'.DOMDocument and tempblob is the table tempblob and outstream is outstream...Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Thanks for the reply Pure Heart..
I need one more favor from you have you ever seen this kind of error -
"Streams cannot be used with client-side invoked automation objects."
Getting this error when ran the code depicted in your post...
Am working on NAV 2013 r2.
Thanks In advance =D>0
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