2

I'm using Solspace Importer to create channel entries from external XML.

It works fine but only with first title/description element (lang="es"). How can I grab data from (lang="en") children?

My XML structure is below & full huge file is here.

<root>
    <property>
        <descriptions>
            <title lang="es">
                <![CDATA[ Bungalow en Altea Hills ]]>
            </title>
            <title lang="en">
                <![CDATA[ Bungalow in Altea Hills ]]>
            </title>
            <description lang="es">
                <![CDATA[
                    Bonito bungalo en Altea Hills con vistas al mar.
                ]]>
            </description>
            <description lang="en">
                <![CDATA[
                    Lovely bungalow in Altea Hills with sea view.
                ]]>
            </description>
        </descriptions>
    </property>
</root>
1

As of this writing, Importer does not read XML node attributes, such as lang="es" for example. Therefore, Importer will read only the first node of a series of nodes named exactly the same, <description> in this case.

I recommend submitting this as a Feature Request under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on. http://support.solspace.com/support/discussions

A workaround would be to use different node names for "en" and "es" nodes. For example:

<description_es>... data ...</description_en>
<description_en>... data ...</description_en>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.