Using LOAD XML in MySQL, trying to bypass trivial labels
I'm trying to use LOAD XML to load an XML file into MySQL. My problem is that many of the fields in the XML file have trivial tags and attributes that I'd like to ignore. For example for this XML:


    <list>
        <Patient>
            <Text>PA9</Text>
            <Species>Human</Species>
        </Patient>
    </list>


I would like to produce

    +---------+
    | Patient |
    +---------+
    | PA9     |
    +---------+

The best I can do right now is manually deleting the undesired attributes:

    <Patient>PA9</Patient>
And executing

    >CREATE TABLE People (Patient VARCHAR(20));

    >LOAD XML LOCAL INFILE '~/file.xml' INTO TABLE People ROWS IDENTIFIED BY '<Patient>';

Which gives the desired result, but is impractical for large files. Is there any way to automatically pick a desired attribute and ignore the rest?

Note: There are many Patient objects in my actual file, I included only one to simplify the question.

This is my first post, if I've formatted wrong or am unclear please let me know.
Using LOAD XML in MySQL, trying to bypass trivial labels
===

I'm trying to use LOAD XML to load an XML file into MySQL. My problem is that many of the fields in the XML file have trivial tags and attributes that I'd like to ignore. For example for this XML:


    <list>
        <Patient>
            <Text>PA9</Text>
            <Species>Human</Species>
        </Patient>
    </list>


I would like to produce

    +---------+
    | Patient |
    +---------+
    | PA9     |
    +---------+

The best I can do right now is manually deleting the undesired attributes:

    <Patient>PA9</Patient>
And executing

    >CREATE TABLE People (Patient VARCHAR(20));

    >LOAD XML LOCAL INFILE '~/file.xml' INTO TABLE People ROWS IDENTIFIED BY '<Patient>';

Which gives the desired result, but is impractical for large files. Is there any way to automatically pick a desired attribute and ignore the rest?

Note: There are many Patient objects in my actual file, I included only one to simplify the question.

This is my first post, if I've formatted wrong or am unclear please let me know.