I have an external XML file from another website i would like to import into my umbraco solution - and then the items posted to my page made search-able .. how do i do this?
I have an external XML file from another website i would like to import into my umbraco solution - and then the items posted to my page made search-able .. how do i do this?
The umbraco.library contains a method that fetches xml from Urls, umbraco.library.GetXmlDocumentByUrl. Using this method you can load the xml document into a xslt variable in a xslt stylesheet using the following code:
its not so much making an XML search engine for umbraco .. its more importing the XML file to umbraco and making it searchable with that exact same search engine as you mention .. :-)
When you mentioned searching I presumed you were talking about visible content published on the website, and hence searchable via search providers like google.
Not sure about this, but I think XsltSearch only searches content in the umbraco store (the umbraco.config file in other words). So if you really need a local search, you'll prbably have to import the data into umbraco via some kind of import procedure, Look at Richards umbImport tool mentioned in Jamies post.
but cant get umbImport tool to work ... :s .. tried both "umbimport_0.1.zip" as well as "Umbimport__1.0_Beta1.zip" ... :-/
umbimport_0.1.zip fails on install ...
and
Umbimport__1.0_Beta1.zip fails when i goto the menu options that has been installed ..
maby the solution would be to get my programmers to code some kind of .NET control that imports XML to something each time a specific page is hit? i dunno really ..
Does the data need to be in umbraco itself? or could it be accessed as an external file? In what way do you need to use the XML file I guess, on the website or inside umbraco?
Also as a review, how do you need to search the xml document?
Regards importing an XML in .net you could look at XmlDocument.load() which takes a file path, like I said I don't know how you want to use it.
external XML file made searchable??
I have an external XML file from another website i would like to import into my umbraco solution - and then the items posted to my page made search-able .. how do i do this?
My XML file looks like kinda like this:
I have an external XML file from another website i would like to import into my umbraco solution - and then the items posted to my page made search-able .. how do i do this?
My XML file looks like kinda like this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <Travelize>
<Exporttype>myTours</Exporttype>
- <rejse>
<destination>myDestination</destination>
<hotel>myHotel</hotel>
<rejse>
</Travelize>
Any help would be appreciated .. :-)
Hi Jonas,
I'm not sure exactly how you'd import that file into a usable state for umbraco, but for inspiration look at
http://umbimport.soetemansoftware.nl/ it imports xml and data into umbraco, although I've never used it.
As far as making an xml -based search engine for umbraco nodes you could look at XSLTsearch made by Doug, http://www.percipientstudios.com/xsltsearch.aspx.
I hope this helps a little, if anyone has an experience in using the umbimport I think this would be the import first step.
- Jamie
The period got stuck on my second URL so to clarify: http://www.percipientstudios.com/xsltsearch.aspx
Hi Jonas
The umbraco.library contains a method that fetches xml from Urls, umbraco.library.GetXmlDocumentByUrl. Using this method you can load the xml document into a xslt variable in a xslt stylesheet using the following code:
From then on the root of the remote xml doc is accessible through the $externalXml variable.
Regards
.Hauge
its not so much making an XML search engine for umbraco .. its more importing the XML file to umbraco and making it searchable with that exact same search engine as you mention .. :-)
but then all i have to do is:
<xsl:variable name="xmlFile" select="umbraco.library:GetXmlDocumentByUrl('http://www.mySite.com/xmlFeed.xml')" />
<xsl:for-each select="$xmlFile/Travelize//rejse">
<div><xsl:value-of select="destination"/> - <xsl:value-of select="hotel"/></div>
</xsl:for-each>
and when i output that to a page, thats made searchable by the XSLT search engine that i can install from the packages?
Cause - that does not work ..
wheres my edit button?
When you mentioned searching I presumed you were talking about visible content published on the website, and hence searchable via search providers like google.
Not sure about this, but I think XsltSearch only searches content in the umbraco store (the umbraco.config file in other words). So if you really need a local search, you'll prbably have to import the data into umbraco via some kind of import procedure, Look at Richards umbImport tool mentioned in Jamies post.
.Hauge
okay ..
but cant get umbImport tool to work ... :s .. tried both "umbimport_0.1.zip" as well as "Umbimport__1.0_Beta1.zip" ... :-/
umbimport_0.1.zip fails on install ...
and
Umbimport__1.0_Beta1.zip fails when i goto the menu options that has been installed ..
maby the solution would be to get my programmers to code some kind of .NET control that imports XML to something each time a specific page is hit? i dunno really ..
Does the data need to be in umbraco itself? or could it be accessed as an external file? In what way do you need to use the XML file I guess, on the website or inside umbraco?
Also as a review, how do you need to search the xml document?
Regards importing an XML in .net you could look at XmlDocument.load() which takes a file path, like I said I don't know how you want to use it.
Hi there,
If you want to import the data into Umbraco, and make it maintainable (edit button) then you have a couple of options.
Either use umbImport ( http://our.umbraco.org/projects/umbimport ) - I would really suggest you tried to make that work. It would probably be the quickest way.
Another way is to write some c# and make a usercontrol and do the import yourself. Creating new nodes (documents) is fairly easy - http://our.umbraco.org/wiki/reference/api-cheatsheet/creating-a-document
Or ... you can do a XSLT extension that allows you to create nodes. This would allow you to do something like this:
I've used this approach a couple of times .. when the need is max. flexibility.
/Jesper
is working on a reply...