title: How do you get PL/SQL to parse XML attributes instead of XML elements in Oracle?
body: <p>Please see PL/SQL snippets below:</p>
  
  <pre><code>create table t23 (
      field01 number, 
      field02 number, 
      field03 char(1) 
  );
  </code></pre>
  
  <h1>Example Snippet #1</h1>
  
  <pre><code>declare x varchar2(2000) := '
  &lt;ArrayOfRecords&gt;
  &lt;Record&gt;
  &lt;Field01&gt;130&lt;/Field01&gt; 
  &lt;Field02&gt;1700&lt;/Field02&gt; 
  &lt;Field03&gt;C&lt;/Field03&gt; 
  &lt;/Record&gt; 
  &lt;Record&gt;
  &lt;Field01&gt;131&lt;/Field01&gt; 
  &lt;Field02&gt;1701&lt;/Field02&gt; 
  &lt;Field03&gt;B&lt;/Field03&gt; 
  &lt;/Record&gt;                         
  &lt;/ArrayOfRecords&gt;';
  
  begin
      insert
      into    T23
      SELECT  *
      FROM    XMLTABLE('/ArrayOfRecords/Record'
                  PASSING xmltype(x)
                      COLUMNS 
                      Field01 number PATH 'Field01',
                      Field02 number PATH 'Field02',
                      Field03 char(1) PATH 'Field03'
              );
  end;
  
  -- The records will be here - great!
  select  * from T23;
  </code></pre>
  
  <h1>Example Snippet #2</h1>
  
  <pre><code>declare y varchar2(2000) := '
  &lt;ArrayOfRecords&gt;
  &lt;Record Field01="130" Field02="1700" Field03="C" /&gt;
  &lt;Record Field01="131" Field02="1701" Field03="B" /&gt;
  &lt;/ArrayOfRecords&gt;';
  
  begin
      insert
      into    T23
      SELECT  *
      FROM    XMLTABLE('/ArrayOfRecords/Record'
                  PASSING xmltype(y)
                      COLUMNS 
                      Field01 number PATH 'Field01',
                      Field02 number PATH 'Field02',
                      Field03 char(1) PATH 'Field03'
              );
  end;
  
  -- null values are inserted into the table - not great
  select  * from T23;
  </code></pre>
  
  <p>How do you get the values out of the XML attributes in example snippet #2?  Is there a way to tell xmltype to retrieve data from attributes vs. elements?</p>