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 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.
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?
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..
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
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.
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
Hi Tommy,
Currently umbImport can only import elements and it only supports a single structure, below you'll find a small example
Let me know if you run into any issues
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
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
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
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
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:
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
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.
is working on a reply...