Carmageddon Posted September 4, 2009 Share Posted September 4, 2009 Hi guys! I've been googling for some time now, with little luck finding something, that would allow me to easily read, write to XML files.. something that would have all the exceptions handling already built in, such as if no file, create it, if exists, and I want to add an attribute, check if it exists.. if not add it - and so on - same for reading/deleting etc. Now, best I've found is this Dom Document class someone spanish wrote and published on PHP Classes site, however I was unable to figure out how to use it Basically, I am trying to write status page at work (which already works btw..), but I want to store information about each station in one XML file, that'd look something such as this: <stations> <station01> <status>on hold></status> <note>broken</note> </station01> <station02> <status>running></status> <note>need to do x y z on it</note> </station02> </stations> So basically, I could dynamically create stations, remove them, or attributes in them.. I could add new attributes suddenly like, that station is on hold starting from todays date, etc.. so the whole thing would be very scalable and supporting any features I'd add in the future. Basically I have a table generated by iterating over some data, parsed, then displaying table with all stations, I have ActiveX script which allows us to click a button or a pic, and launch VNC client to the station without even typing the machine's ip, or putty without typing login details (required minor changes to IE security settings). for us its secure enough as its internal VPN networks, and only like 10 ppl MAX are watching the self refreshing status page at any time.. usually 6 or so, so performance isn't an issue. Thanks! hope I get some ideas here regarding the XML thing Quote Link to comment https://forums.phpfreaks.com/topic/173075-need-help-finding-a-class-to-streamline-using-xml-files/ Share on other sites More sharing options...
trq Posted September 4, 2009 Share Posted September 4, 2009 I think you misread the topic of this board. Quote Link to comment https://forums.phpfreaks.com/topic/173075-need-help-finding-a-class-to-streamline-using-xml-files/#findComment-912232 Share on other sites More sharing options...
Carmageddon Posted September 4, 2009 Author Share Posted September 4, 2009 oh, well I did read it, and it seems to me closest section to my question.. its about php, coding and stuff after all... But if you can suggest me a more suitable section, please do Quote Link to comment https://forums.phpfreaks.com/topic/173075-need-help-finding-a-class-to-streamline-using-xml-files/#findComment-912269 Share on other sites More sharing options...
RichardRotterdam Posted September 4, 2009 Share Posted September 4, 2009 Now, best I've found is this Dom Document class someone spanish wrote and published on PHP Classes site, however I was unable to figure out how to use it Take a look at DOMDocument in the manual Quote Link to comment https://forums.phpfreaks.com/topic/173075-need-help-finding-a-class-to-streamline-using-xml-files/#findComment-912281 Share on other sites More sharing options...
trq Posted September 4, 2009 Share Posted September 4, 2009 oh, well I did read it, and it seems to me closest section to my question.. its about php, coding and stuff after all... But if you can suggest me a more suitable section, please do Exactly, its for help with PHP coding problems. Do you have any? Quote Link to comment https://forums.phpfreaks.com/topic/173075-need-help-finding-a-class-to-streamline-using-xml-files/#findComment-912316 Share on other sites More sharing options...
Carmageddon Posted September 4, 2009 Author Share Posted September 4, 2009 Now, best I've found is this Dom Document class someone spanish wrote and published on PHP Classes site, however I was unable to figure out how to use it Take a look at DOMDocument in the manual I did, but to use that, means I'd have to spend 1-2 work days, to build my own DOM access and usage class.. which would naturally have a lot of bugs to iron out etc, which is why I am looking for something general thats already made, to allow me easy use of XML files without writing all the procedures manually... much like the libraries available for C#, Java etc where you only have easy to use interface without needing to write the whole thing on your own. Exactly, its for help with PHP coding problems. Do you have any? I am sorry, I still have not seen any suggestion for a more suitable section for this question? As I see it, this is related to php coding.. but instead of asking about bugs I'd have if I were to start writing my own XML read/write class, I am asking how to avoid those errors, and the wasted time writing it in advance. So, sorry if this thinking ahead, is not to your liking mate oh, well I did read it, and it seems to me closest section to my question.. its about php, coding and stuff after all... But if you can suggest me a more suitable section, please do Also, if this helps you relax, consider this thread a discussion about how to use the php code that shows here: http://www.phpclasses.org/browse/package/1652.html So now its also about help with php code, happy? hehe Quote Link to comment https://forums.phpfreaks.com/topic/173075-need-help-finding-a-class-to-streamline-using-xml-files/#findComment-912367 Share on other sites More sharing options...
RichardRotterdam Posted September 4, 2009 Share Posted September 4, 2009 I did, but to use that, means I'd have to spend 1-2 work days, to build my own DOM access and usage class.. which would naturally have a lot of bugs to iron out etc, And that's what this board is for. Helping people to solve bugs in their code or how to write something better. Believe it or not a lot of people here actually like solving bugs and learn how to code. A lot of people here in this community get a certain satisfaction from the fact that someone else has learned by their helping hand. If someone gets stuck with something code related then this is the place to ask. I am sorry, I still have not seen any suggestion for a more suitable section for this question? As I see it, this is related to php coding.. but instead of asking about bugs I'd have if I were to start writing my own XML read/write class, I am asking how to avoid those errors, and the wasted time writing it in advance. So, sorry if this thinking ahead, is not to your liking mate oh, well I did read it, and it seems to me closest section to my question He's actually right though. If time is of the essence rather then solving the problem by spending time writing code yourself then you might be better off on the freelance board. But if you can suggest me a more suitable section, please do Also, if this helps you relax, consider this thread a discussion about how to use the php code that shows here: http://www.phpclasses.org/browse/package/1652.HTML I took a look at that class and it's written in 2005 and written in PHP4 syntax. This was when PHP4 was most common. PHP5+ is the most used version these days and you can simply use DOMDocument as it is very similar to the written class you linked to. Quote Link to comment https://forums.phpfreaks.com/topic/173075-need-help-finding-a-class-to-streamline-using-xml-files/#findComment-912412 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.