This may not be a hard question for you guys, but to me this is a big deal. I'm new to Umbraco and XSLT - but I can see that this is a smart way to do websites.
My question is: How do I get data from a XML-file into the XSLT and display the data? How do I link them together?
I hope to get a answer quick - I have worked with this in 3 days now!
I have allready seen those... I don't think they describe fx where to put the XML-file, and how the data from the XML come into the XSLT. Or is it me who are stupid?
The XML file is automatically generated for you so you don't need to put it anywhere..
With regards to XSLT the complete XML document of the published site gets put into a variable named "currentPage" you can use this variable within your XSLT file to access the XML.
If you have downloaded Umbraco 4.5 in the last week or so you should also note that most of the documentation you find will not be up to date as the XML schema has changed slightly. You can however get 4.5 to output the old schema so don't let this worry you.
The xml is genereated by umbraco at every page view where you can both access currentPage xml and also use some of the build in xslt extentions to get xml from other douments or media. Then you use xslt til parse the xml into html that make up your website.
What if I need other data than Umbraco provides? Fx a list of my DVDs. Insted of creating a page that I should update every time I buy a new DVD, I would like to have the information in XML.
You can still use "external data" in your umbraco website. If you can find a way to return an XmlDocument from your sql query (if you store info in your db), then you could quite easily use xslt to display a list of all dvd's in your database.
For example, you could write your own xslt extension which grabs the dvd list from your datasource (whatever that may be) and use xslt/xpath to transform that list to show on your website. You'll find info on xslt extensions (how to build/install/use) in the wiki section
New in XSLT and Umbraco - how do these work?
This may not be a hard question for you guys, but to me this is a big deal. I'm new to Umbraco and XSLT - but I can see that this is a smart way to do websites.
My question is: How do I get data from a XML-file into the XSLT and display the data? How do I link them together?
I hope to get a answer quick - I have worked with this in 3 days now!
Thank you
Hi,
Watch the 5 free videos here http://umbraco.tv/documentation/videos/for-site-builders/foundation/document-types and all should become clear. If you know a little about Umbraco you can just skip to the "Creating your first XSLT macro" video.
Best of luck
Rich
I have allready seen those... I don't think they describe fx where to put the XML-file, and how the data from the XML come into the XSLT. Or is it me who are stupid?
The XML file is automatically generated for you so you don't need to put it anywhere..
With regards to XSLT the complete XML document of the published site gets put into a variable named "currentPage" you can use this variable within your XSLT file to access the XML.
To get a further understanding you can read all about umbraco, currentPage and XSLT here http://umbraco.org/documentation/books/xslt-basics/understanding-currentpage
If you have downloaded Umbraco 4.5 in the last week or so you should also note that most of the documentation you find will not be up to date as the XML schema has changed slightly. You can however get 4.5 to output the old schema so don't let this worry you.
Rich
The xml is genereated by umbraco at every page view where you can both access currentPage xml and also use some of the build in xslt extentions to get xml from other douments or media. Then you use xslt til parse the xml into html that make up your website.
What if I need other data than Umbraco provides? Fx a list of my DVDs. Insted of creating a page that I should update every time I buy a new DVD, I would like to have the information in XML.
You can still use "external data" in your umbraco website. If you can find a way to return an XmlDocument from your sql query (if you store info in your db), then you could quite easily use xslt to display a list of all dvd's in your database.
For example, you could write your own xslt extension which grabs the dvd list from your datasource (whatever that may be) and use xslt/xpath to transform that list to show on your website. You'll find info on xslt extensions (how to build/install/use) in the wiki section
Hope this helps.
Regards,
/Dirk
Okay, thanks for your replies!
I really this will work out...
This page should help you on your way.
http://umbraco.org/documentation/books/how-to-import-rss-(and-other)-data
Rich
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.