Title: Problem with attributes
Last modified: January 13, 2022

---

# Problem with attributes

 *  Resolved [stea1978](https://wordpress.org/support/users/stea1978/)
 * (@stea1978)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/problem-with-attributes-6/)
 * Hello. I have an xml with prodcuts which have differnets attributes.
    For example
   one product has three attributes: <attributes> <attr> <name>Lumens</name> <text
   >2600</text> </attr> <attr> <name>Material</name> <text>Acrylic</text> </attr
   > <attr> <name>Color</name> <text>White</text> </attr> </attributes>
 * and another has two of this three attributes:
    <attributes> <attr> <name>Lumens
   </name> <text>2900</text> </attr> <attr> <name>Color</name> <text>Black</text
   > </attr> </attributes>
 * So i create three attributes in wp all import plugin and
    in field name i give
   the name of the slug lumens and i drag the attribute in value {attributes[1]/
   attr[1]/text[1]} in second field name i give the name of the slug material and
   i drag the attribute in value {attributes[1]/attr[2]/text[1]} and in third field
   name i give the name of the slug color and i drag the attribute in value {attributes[
   1]/attr[3]/text[1]}.
 * The problem is that in second product which has two attributes and not three 
   in attribute color instead of take the name of this attribute takes the name 
   of attribute Material but with the right value of black.
 * I dont know if i have a clear explanation..
    I wish you could help me, i made
   all the imports write and works fine but without the right attributes i can’t
   import the xml.
 * Thanks in advance and i hope you can help me find out where i am wrong

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/problem-with-attributes-6/#post-15266139)
 * Hi [@stea1978](https://wordpress.org/support/users/stea1978/),
 * You can use XPath queries to make sure you’re getting the correct attribute names&
   values in each record. For example:
 *     ```
       Lumens: {attributes/attr[./name="Lumens"]/text[1]}
       Material: {attributes/attr[./name="Material"]/text[1]}
       Color: {attributes/attr[./name="Color"]/text[1]}
       ```
   
 * See: [https://d.pr/i/nBFugq](https://d.pr/i/nBFugq).
 *  Thread Starter [stea1978](https://wordpress.org/support/users/stea1978/)
 * (@stea1978)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/problem-with-attributes-6/#post-15268623)
 * Thank you for your response.
    I think it’s a solution of my problem. I’ll test
   it and i see if it will work.
 * Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problem with attributes’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [stea1978](https://wordpress.org/support/users/stea1978/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/problem-with-attributes-6/#post-15268623)
 * Status: resolved