#11
|
|||
|
|||
![]()
I'm getting below error. Please find the attached channel for reference. could you please check and let me know what's issue
TypeError: setName is not a function, it is xml. Last edited by yeruva; 09-13-2018 at 12:10 PM. |
#12
|
|||
|
|||
![]()
Your source connector is a Channel Reader, not a Database Reader. This thread was specifically for converting the XML returned by a Database Reader. If your XML messages are in a different format, please start a new thread.
|
#13
|
|||
|
|||
![]()
I expanded Tonys code to also include a header row:
Code:
msg.setName('delimited'); // technically, this line is optional. for each (var result in msg.result) result.setName('row'); //get the name of each element and add it as a header row var headerRow = new XML('<row/>'); for each (var element in msg.row[0].children()){ if (element != null){ var name = element.name(); var headerColumn = new XML('<' + name + '>' + name + '</' + name + '>'); headerRow.appendChild(headerColumn); } } msg.prependChild(headerRow);
__________________
Jon Bartels Zen is hiring!!!! http://consultzen.com/careers/ Talented healthcare IT professionals wanted. Engineers to sales to management. Good benefits, great working environment, genuinely interesting work. |
#14
|
|||
|
|||
![]() Quote:
Tell me, how did you learn the details of the internal representations Mirth Connect uses for its various data types? I've been working with Connect for years, and the whole time I've been frustrated that I can't find clear and complete documentation of stuff like this. If you know of a resource I should be using, I'll be grateful to hear it! |
#15
|
|||
|
|||
![]()
For the code you quoted, it was just looking at the transformed content of the two types and noticed they had a similar structure.
I do spend quite a bit of time poking around in the source code when I'm curious how certain things work. It's sparse on documentation, but the code base itself is pretty clean and easy to follow most of the time. Today happens to be the 1-year annivesary of the announcement that they moved the public repo to github, which makes it more accessible than it was previously. http://www.mirthproject.org/communit...d.php?t=218333 A local copy of the repo and a good IDE helps with browsing. |
![]() |
Tags |
csv, delimited, sql, xml |
Thread Tools | |
Display Modes | |
|
|