Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-12731

Add better XML parsing support

    XMLWordPrintable

Details

    Description

      Our current support for XML parsing via ECL language constructs is quite limited.
      You must specify an xpath as entry point into elements you want to parse and the record definition must specify the attributes in those detected elements.
      e.g.

      rec := RECORD
      string afield

      Unknown macro: {xpath('Fields/afield')}

      ;
      END;
      ds := DATASET('~somexml', rec, XML('/Dataset/Row'));

      That's okay, if the XML is well defined, pre-known structure and doesn't contain recursion, but you cannot parse arbitrary XML this way.

      As a result, ECL users have been known to workaround this fact, by parsing XML as CSV, splicing it into flat records representing tags and depth.

      We should discuss what ECL constructs/syntax would be sensible and what backend support would be useful, to parse arbitrary XML.

      From an implementation point of view, I think it will need something that allows a SAX type approach, where you can hook new tags, new attributes etc and construct the rows/datasets you want.

      Attachments

        Activity

          People

            jakesmith Jake Smith
            jakesmith Jake Smith
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: