title: Error message ORA-19279: XPTY0004 received when trying to create view of XML file in PL/SQL
body: <p>I am trying to create a view of some XML files in Oracle PL/SQL. The problem with the data content of the XML files is that a single path often has more than one data entry, as shown below:</p>
  
  <pre><code>&lt;priip&gt;
    &lt;data&gt;
      &lt;properties&gt;
        &lt;priipMonitoringInterval&gt;daily&lt;/priipMonitoringInterval&gt;
        &lt;priipMonitoringStartDate&gt;2017-06-30T13:51:03.168000&lt;/priipMonitoringStartDate&gt;
        &lt;permittedKIDDownloadJurisdictions&gt;
          &lt;item&gt;DE&lt;/item&gt;
          &lt;item&gt;AT&lt;/item&gt;
        &lt;/permittedKIDDownloadJurisdictions&gt;
      &lt;/properties&gt;
    &lt;/data&gt;
  &lt;/priip&gt;
  </code></pre>
  
  <p>I am hence getting an error message which reads: </p>
  
  <p><strong>ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence</strong></p>
  
  <p>Here, clearly, the problem lies with the path:</p>
  
  <pre><code>priip/data/properties/permittedKIDDownloadJurisdictions/item
  </code></pre>
  
  <p>where we have two permissible jurisdictions, DE and AT. I cannot change the raw XML file, and I require all data within the files to be entered into the PL/SQL view. I have attached a sample of my code below, showing what I have already tried to do.</p>
  
  <pre><code>create or replace view PRIIPS_XML_VIEW as
    select *
      from PRIIPS_XML t,
        XMLTable(
          '$p/priip/data'
          passing t.SYS_NC_ROWINFO$ as "p"
  
          columns
            priip_monitoring_interval varchar2(20) path 'properties/priipMonitoringInterval',
            priip_monitoring_start_date varchar2(26) path 'properties/priipMonitoringStartDate',
            kid_download_jurisdiction varchar2(10) path 'properties/permittedKIDDownloadJurisdictions/item'
            );
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>