Yes you should use the GetXmlDocumentByUrl extension to achieve your task. Then you can start parsing your XML file through XSLT and place the macro in your desired template.
You could for instance place your XML file in a folder called "ExternalXML" or something like that and place it in the root.
loading xml data
Hi, I'm new to Umbraco, so my question might be very dumb.
I have a xml file with structured data (people contact data, about 100 records).
I need to load this data and output them in Umbraco page.
Where to put this xml file in Umbraco directory structure?,
and how do I load this file through Umbraco xslt
I have already prepared a xslt file in VS:
<asp:Xml id="xmlContacts" runat="server" DocumentSource="contacts.xml"></asp:Xml>
Should I use ... GetXMLDocumentByUrl ?
Thanks anyway,
Marius
Hi Marius
Yes you should use the GetXmlDocumentByUrl extension to achieve your task. Then you can start parsing your XML file through XSLT and place the macro in your desired template.
You could for instance place your XML file in a folder called "ExternalXML" or something like that and place it in the root.
/Jan
Thanks for you answer, Jan.
Can "url" parameter be a local url .. for example.. "/ExternalXML/xmlfile.xml" ?
or a full web path like http://www.any.com/ExternalXML/xmlfile.xml
that means I should change xslt's every time I change home domain...
Chm.
Thanks,
Marius
A little update and more problems...
Also you can get a local xml file on the same server by
GetXMLDocument( Path, 1) 1 indicates here that it is relative path.
But just can't figure out how to make this xslt work in Umbraco,
my xml data: http://www.lvat.lt:81/xmldata/struktura.xml
what I don;t know here is - how to pass these path variables Kontakt to other templates, I need recursively process "Padalinys" template:
Try something like
Thanks man, works.
Can't believe it was that simple.
Yep, Smart things are simple.
Marius.
is working on a reply...