Copied to clipboard

Flag this post as spam?

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


  • John C Scott 473 posts 1183 karma points
    May 23, 2011 @ 00:28
    John C Scott
    0

    Import from Attribute

    Importing from XML 

    <film name="Alien V Predator">
    <id>1</id>
    <description>feature film with Lance Hendrikson, Sanaa Lathan</description>
    <year>2003/2004</year>
    <house>20th Century Fox</house>
    <director>Paul Anderson</director>
    <production>John Davies</production>
    <movieclip/>
    </film>

    It's quite important to import the name which is the attribute of the root node.

    Is there any way to do this with CMS Import.

    The only I can think of at the moment is to write an XSLT that transforms the source XML to have that attribute as a node. Not exactly sure how to do that but it must be simple I think. The bit that I'm not sure of is how to just bring everything else in unchanged.

    Other than that is there an easier way that I am missing?

  • John C Scott 473 posts 1183 karma points
    May 23, 2011 @ 01:11
    John C Scott
    0

    also have to import as media items

    <slides>
    <filename jpegURL="images/avp/alien3.jpg"/>
    <filename jpegURL="images/avp/alien7.jpg"/>
    <filename jpegURL="images/avp/alien8.jpg"/>
    <filename jpegURL="images/avp/alien9.jpg"/>
    <filename jpegURL="images/avp/alien5.jpg"/>
    <filename jpegURL="images/avp/alien10.jpg"/>
    <filename jpegURL="images/avp/alien11.jpg"/>
    <filename jpegURL="images/avp/alien12.jpg"/>
    <filename jpegURL="images/avp/alien1.jpg"/>
    <filename jpegURL="images/avp/alien2.jpg"/>
    <filename jpegURL="images/avp/alien13.jpg"/>
    <filename jpegURL="images/avp/alien4.jpg"/>
    <filename jpegURL="images/avp/alien14.jpg"/>
    <filename jpegURL="images/alien/alien1.jpg"/>
    </slides>

    so this is a pain 

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    May 23, 2011 @ 09:05
    Richard Soeteman
    0

    Hi John,

    Xml with attributes is solved in CMSImport 2.0. but in the meanwhile I've written an XmlWithAttributes  DataAdapter for you that will help you. Download it here and but the dll in the bin folder of your website.

    Then when you start using CMSImport you'll see the Xml with attributes as extra Datasource type. Select this one and continue the process like you normally do.

    Then when you are at the mapping screen you will see the attributes prefixed with @ like you see in the following screen.

    Hope this solves your pain.

    Cheers,

    Richard

  • John C Scott 473 posts 1183 karma points
    May 23, 2011 @ 10:57
    John C Scott
    0

    Well that is utterly fantastic. Brilliant I'll try that.

Please Sign in or register to post replies

Write your reply to:

Draft