Copied to clipboard

Flag this post as spam?

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


  • Tommy Messbauer 16 posts 36 karma points
    Dec 08, 2009 @ 17:06
    Tommy Messbauer
    0

    Xml Import documentation?

    Where can I find documentation on the xml import?  There is an xpath expression here, but I have no idea what the output is supposed to look like.

    Please help.

    -T

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Dec 08, 2009 @ 17:23
    Richard Soeteman
    0

    Hi Tommy,

    Currently umbImport can only import elements and it only supports a single structure, below you'll find a small example

    <

     

    products>

    <

     

    product>

    <

     

    name>Test1</name>

    </

     

    product>

    <

     

    product>

    <

     

    name>Test2</name>

    </

     

    product>

    <

     

    product>

    <

     

    name>Test3</name>

    </

     

    product>

    </

     

    products>

    Let me know if you run into any issues

  • Tommy Messbauer 16 posts 36 karma points
    Dec 08, 2009 @ 19:00
    Tommy Messbauer
    0

    Hi Richard,

    How do the elements get imported?  How do "products" turn into items (maybe I should cann them "nodes")?

    For example: Does a "product" get created as a content (i.e. page) node?  Does the element "name" get inserted as a <data name="name">Test3</data> ?

    Are there any docs that I can just read?

    Thank you for the reply.

    -T

     

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Dec 09, 2009 @ 11:01
    Richard Soeteman
    0

    Hi Tommy,

    In this case you don't have to specify anything. It's a single structure so it should be okay. The elements will be used to convert from the xml to content indeed and in a next step you can map the elements against your document type properties, so you don't have to program anything, it will just work ;-). I don't have documentation at the moment.

    I've created a simpe site with some video's. And you can find some info on my blog  

    Cheers,

    Richard

  • Paul Sørensen 304 posts 650 karma points
    Dec 29, 2009 @ 17:14
    Paul Sørensen
    0

    Hi Richard

    I have an XML file with a structure just as you describe

    <Users>
      <User>
        <Username>pas</Username>
        <Name>Paul</Name>
    ....

    I would assume th right XPath expression is users/user but it keep crashing with Object not set..

    I have also tried to read from a local database with a connection string similar to the one I have en my Umbraco web.config - but it fails to validate data source.

    I managed to get the csv version working an also the SQL version workink towards a local installation of Umbraco.

    Could you provide me with a tip or 2.

    Thanks Paul S

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Dec 30, 2009 @ 08:22
    Richard Soeteman
    0

    Hi Paul,

    I think //Users/User  should work (Xpath is case sensitive). I'm curious about the connection string? It is a Sql Server database? Maybe you can provide the connectionstring without password?

    Cheers,

    Richard

  • Paul Sørensen 304 posts 650 karma points
    Dec 31, 2009 @ 14:37
    Paul Sørensen
    0

    Hi Richard

    I managed to import the information into my hosted site by exporting the data to a CSV file and then import that. I would have been easier it hte SQL part had worked for me but still a nice job you've done..

    SQL

    server=xph-pas;database=xx;user id=umbracouser;password=

    SELECT [name] ,[Email],[vgcnr] ,[login] FROM [dbo].[NewMember]

    I tried to import member information into a hosted site from a local database. First I tried to import the information into a local site and that succeeded

    XML

    I tried //Users/User, /Users/User/, /Users/User, Users/User - all crashed - would have been nice with just an error.

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
    UmbImportLibrary.DataAdapters.DefaultDataAdapters.XmlImportDataAdapter.Validate() +151
    UmbImport.ImportSteps.SelectDataSource.Validate(ImportState state) +29
    UmbImport.UmbImport.Validate(Object source, ServerValidateEventArgs args) +50
    System.Web.UI.WebControls.CustomValidator.OnServerValidate(String value) +140
    System.Web.UI.WebControls.CustomValidator.EvaluateIsValid() +113
    System.Web.UI.WebControls.BaseValidator.Validate() +72
    System.Web.UI.Page.Validate() +141
    System.Web.UI.Page.Validate(String validationGroup) +8741985
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +84
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Jan 01, 2010 @ 08:13
    Richard Soeteman
    0

    That Error should not occur indeed when validating the xml File This is on the todolist now for V1.0.3. I can see nothing wrong in the connection string, maybe it can't connect to the db? Great that it worked with csv import.

    Cheers,

    Richard

  • Scott Hugh Alexandar Petersen 349 posts 164 karma points
    Mar 18, 2010 @ 16:38
    Scott Hugh Alexandar Petersen
    0

    Remember that it should have not <?xml tag at all. Just a plain simple xml file!

    <rows><row><col>data</col></row></rows>
    xpath: //rows/row

    and then you are good.

Please Sign in or register to post replies

Write your reply to:

Draft