Mon Mar 19, 2018 12:19 pm
Login Register Lost Password? Contact Us

Load XML Inline into a dataset?

Comments and questions related to the Enterprise Control Language

Wed Nov 22, 2017 4:22 pm Change Time Zone

This might be a pretty basic question, I can't find any examples in the documentation though. I'm trying to load some XML data into a dataset like so:

Code: Select all
test := '<row><name>greg</name></row>';

r := {
   string name {xpath('name')};

DS := DATASET(test, r, XML('row'));

Of course it tries to open a logical file with the string assigned to test. I feel like there was a way to do this but can't figure it out.
Posts: 12
Joined: Thu Sep 28, 2017 8:06 pm

Tue Nov 28, 2017 6:29 pm Change Time Zone


Unfortunately, inline DATASETs do not support the XML option. You can remove the XML option and then you will have a single variable length STRING field that you can use PARSE to extract your xml, but if what you want to do is develop code to operate on XML datasets, then you'll need to write your test XML data to a disk file that a standard XML DATASET can operate on.


Community Advisory Board Member
Community Advisory Board Member
Posts: 1337
Joined: Wed Oct 26, 2011 7:40 pm

Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest