• Resolved mattce

    (@mattce)


    Hi,
    I’m confronted with a problem when trying to import data from a large XML file. The file is provided by an affiliate network, so I’m not able to edit it directly, it would only be possible by a filter or something comparable, if this might be a solution to my issue.

    Normally the data is provided in this pattern:

    <DisplayPrice>999.99 EUR</DisplayPrice>

    So, we have an opening Tag with the name, the value, and a closing tag.

    But this list also includes values like:

    <Properties>
    <Property Title=”value1″ Text=”{value}”/>
    <Property Title=”value2″ Text=”{value}”/>
    <Property Title=”value3″ Text=”{value}”/>
    </Properties>

    How am I able to import such attributes into custom fields?

    When I’m trying it with drag&drop, I get values like:
    {Properties[1]/Property[1]}
    {Properties[1]/Property[2]}
    {Properties[1]/Property[3]}

    But these statements return an empty value, so I think, the problem is the different layout of the values..?

    Is there any way to get these Text=”” values? Something with @text maybe?

    I’ve tried different ways, but none of them worked. Would be happy, if you could help me with this.

    Thanks a lot! 🙂

    Greetings

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @mattce

    You can click the attribute names (“Title” or “Text”) and drag them into the import – it will generate XPaths like this:

    {Properties[1]/Property[1]/@Title}
    {Properties[1]/Property[1]/@Text}

    Thread Starter mattce

    (@mattce)

    Oh, now I’m feeling very stupid, not trying this. 🙂

    It works, thanks a lot! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to import Attributes from XML-File’ is closed to new replies.