Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Cort Larsen 421 posts 1038 karma points
    Oct 30, 2012 @ 09:05
    Peter Cort Larsen
    0

    Nested xml nodes

    Hi,

     

    Is it possible to import nested xml nodes as nested document nodes into Umbraco?

     

    Say i have this: xml:

    <?xml version="1.0" encoding="utf-8"?>
    <documents>
    <document>
    <bullets>1</bullets>
    <title>Main title</title>
    <text>
    lorem ipsum
    </text>
    <document>
    <bullets>1.1</bullets>
    <title>sub item</title>
    <text>
    lorem ipsum
    </text>
    </document>
    </document>
    </documents>

     

    Can that be turned into this:

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Oct 30, 2012 @ 09:42
    Richard Soeteman
    0

    Hi,

    You would need the PRO version and a relation to the parent id so if the document can include a parentbullet element then it's possible. Then you can select //document, select Recursive import and select parentbullet as the parent relation.

    Hope this helps,

    Richard

  • Peter Cort Larsen 421 posts 1038 karma points
    Oct 30, 2012 @ 14:51
    Peter Cort Larsen
    0

    Ok, thanks

  • Carrie 20 posts 42 karma points
    Jun 09, 2014 @ 23:09
    Carrie
    0

    Hi Richard,

    I'm using Umbraco 6.2.1 and CMSImport 2.5.2 and trying to do the nested nodes but am failing. I'm pulling XML that looks like this (I took out extraneous tags)

    <Interior id="4535" parentID="1066" level="2" nodeName="NODE ONE" path="-1,1066,4535" isDoc="">
    <Interior id="4537" parentID="4535" level="3" nodeName="NODE TWO" path="-1,1066,4535,4537" isDoc="">
    <Interior id="4800" parentID="4537" level="4"  nodeName="NODE THREE" path="-1,1066,4535,4537,4800" isDoc="">
    </Interior>
    </Interior>
    </Interior>

    I've set up the import like so: 

    It only imports the top node (NODE ONE). What am I missing? 

    Thanks!

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Jun 10, 2014 @ 07:01
    Richard Soeteman
    0

    The xml is nested. I assume you are not using an xpath expression. What you can do is specify //Interior as xpath that will give you one list with all interor nodes and then it will work I think.

    Best,

    Richard

  • Carrie 20 posts 42 karma points
    Jun 10, 2014 @ 13:25
    Carrie
    0

    That was exactly my issue, thank you!!!

    I do have one more problem though. A media picker is importing images and then linking to their folder instead of the media file. 

    This is the page field:

    This is the media section:

     

     

    Any ideas on that one?

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Jun 11, 2014 @ 07:14
    Richard Soeteman
    0

    Hi Carrie,

    Then the filename must be the foldername instead of the real file. Otherwise it would have pointed to the filename. Maybe check the xml for that and edit it to select the filename instead of folder?

    Best,

    Richard

  • Carrie 20 posts 42 karma points
    Jun 11, 2014 @ 14:49
    Carrie
    0

    Ahhh, doh! I get it now, the field was just the media ID. Thank you so much for responding so quickly, you are always very helpful!

Please Sign in or register to post replies

Write your reply to:

Draft