Page 1 of 1
XML files
Posted: Sun Sep 12, 2010 5:06 pm
by SirWobbyTheFirst
Hi guys, I don't know which sort of topic this fits into because its for rev as well as other uses so don't clip me across the ear if its in the wrong forum. Could anyone recommend any good tutorials for reading and writing XML files because I am a complete beginner when it comes to XML and it would be sweeet!!! (Family Guy Reference Sorry) if I could be able to share data between Visual Basic (Or any non-revolution language you can think of) and Revolution using one standard.
Plus it would really sweeten the deal with my boss because I am hoping to finally be able to put my network and programming skills to some use, especially in the north east of england where computer jobs are nearly extinct. As per-se any help would be most appreciated especially now.
Thanks, Michael.
Re: XML files
Posted: Sun Sep 12, 2010 7:59 pm
by FourthWorld
RSS is a great starting point for playing with XML because it's both simple and useful. Check out the RSS example in the Internet section of the Rev Resource Center.
Re: XML files
Posted: Sun Sep 12, 2010 8:17 pm
by SirWobbyTheFirst
Alright thanks FourthWorld, I'll take a look at that.
EDIT: FourthWorld, I've figured out how to get rev to reference information from the XML file but I don't know how to write the XML back to disk if I make changes to it. The dictionary doesn't list any functions or commands in the XML section for performing such an action neither, could you shed some light on this situation please?
Thanks, Michael.
Re: XML files
Posted: Thu Sep 23, 2010 7:37 am
by hliljegren
To write an XML tree to file is quite easy! There is a command called revXMLText that turns your XML tree into a text chunk, then you can use "URL" to write it to a file:
put revXMLText( xmlTreeID,,true) into URL "file:my/path/to/my/XMLFile.xml"
The double ,, is actually needed. As a second parameter you can supply a node on where to start and if you don't supply anything it will start at the tree root. The last parameter is if you want it pretty-printed or not (i.e indentation or not)
Re: XML files
Posted: Thu Sep 23, 2010 4:16 pm
by SirWobbyTheFirst
Oh right, thanks for the info hliljegren, I was beginning to think I might have to just keep my Visual Basic and Rev apps seperated or use text files. Thanks alot.
