export Carriage Return with XML DOM?
            
                
                    jversusj                
                
                    Member Posts: 489                
            
                        
            
                    hello all,
if you have followed my recent threads, I have been working on an XMLDOM output of a customer product catalog. We are bringing up one of our divisions (currently on Oracle) on to NAV, so I am building a solution to fit an existing data structure.
I have 90% of this complete and recently began working on outputting product family description information in my xml product catalogs. This description is historically under 1000 chars long, but greater than 250. I have created a Product family table and a product family description table in a header/lines relationship. I am using Notepad integration with NAV to edit the description to properly maintain carriage returns, etc. in the data. This essentially populates as many lines as are needed to define the description, with a boolean field (carriage return) to capture if the line ends with CR.
In my XMLDOM code, i retrieve/loop my lines and use ADDTEXT to put them into a bigtext variable, including an Addtext of a CR when needed. After completing the loop, i use GETSUBTEXT to copy out the first 1024 characters into a text variable. I then output this variable in my xmldom code. When i view the resulting XML, the carriage returns are gone.
What can i do differently to output my family description as formatted in the XMLDOM? I am using the AddElement function in XML DOM codeunit to create my node text.
thanks in advance!
                if you have followed my recent threads, I have been working on an XMLDOM output of a customer product catalog. We are bringing up one of our divisions (currently on Oracle) on to NAV, so I am building a solution to fit an existing data structure.
I have 90% of this complete and recently began working on outputting product family description information in my xml product catalogs. This description is historically under 1000 chars long, but greater than 250. I have created a Product family table and a product family description table in a header/lines relationship. I am using Notepad integration with NAV to edit the description to properly maintain carriage returns, etc. in the data. This essentially populates as many lines as are needed to define the description, with a boolean field (carriage return) to capture if the line ends with CR.
In my XMLDOM code, i retrieve/loop my lines and use ADDTEXT to put them into a bigtext variable, including an Addtext of a CR when needed. After completing the loop, i use GETSUBTEXT to copy out the first 1024 characters into a text variable. I then output this variable in my xmldom code. When i view the resulting XML, the carriage returns are gone.
What can i do differently to output my family description as formatted in the XMLDOM? I am using the AddElement function in XML DOM codeunit to create my node text.
thanks in advance!
kind of fell into this...
0                
            Comments
- 
            Please have a look at the preserveWhiteSpace property of the xmlDOM automation object and/or use xml:space="preserve" attributes.0
 - 
            
Thank you for the suggestion. I have tried adding the xml:space="preserve" attribute but my carriages returns still appear to be lost. when viewing the XML.vaprog wrote:Please have a look at the preserveWhiteSpace property of the xmlDOM automation object and/or use xml:space="preserve" attributes.
If i take my xml file and change the extension to .txt and view in notepad, my CR are present, but viewing in IE /Chrome they are absent.
Oh well, I have asked the web team if the CR are really that important. If they are not, I will not worry any more about it. Thanks again!kind of fell into this...0 - 
            Hello
Just my 2 cents:
I had this discussion a few times with senders or recipients of xml files. At the end the conclusion was always that crlf is not important for xml and normally the xml's are viewed either with IE or a tool like xmlSpy, both do not need crlf for a proper look.
Regards
Thomas0 
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
 - 323 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
 
