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

Support xpath(‘<>’) for write (especially for SOAPCALL/HTTPCALL but also OUTPUT)

    Details

    • Type: Improvement
    • Status: Accepted
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ESP, Language
    • Labels:
    • Compatibility:
      Major

      Description

      The XPATH attribute is used when reading and writing files to indicate the XML markup.

      We currently support the expression XPATH('<>') to allow the programmer to say that the string is to be left "as is" so that it can include embedded XML.

      For example, consider the definition:
      EXPORT AbstractXML := RECORD,MAXLENGTH(100000)
      UNICODE abstract_original

      {XPATH('@original')}

      ;
      UNICODE abstract_language

      {XPATH('@xml:lang')}

      ;
      UNICODE abstract_publisher_copyright

      {XPATH('publishercopyright')}

      ;
      UNICODE abstract

      {XPATH('<>')}

      ;
      END;

      When this definition is used with a DATASET(...,XML) function, the abstract field can have embedded XML for subsequent parsing.

      This should work for output as well.

      The instant case that motivates this request is a SOAPCALL where the contents of an attribute were expected to contain a CDATA. For example:
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Header/>
      <SOAP-ENV:Body>
      <a xmlns="http://mynamespace">
      <b type="New""><![CDATA[ Lord & Taylor ]]> </b>
      <c>false</c>
      </a>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      A note from Tony says "You could argue xpath(‘<>’), which when reading xml means “read all child content as an xml string”, should mean “do not escape xml output” when writing. It would then be symmetrical for read and write. But I don’t think that works currently. You could open an issue to support that… if so you should probably mention SOAPCALL explicitly."

        Attachments

          Activity

            People

            • Assignee:
              afishbeck Anthony Fishbeck
              Reporter:
              johnholt John Holt
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: