Jump to content

Recommended Posts

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 :)

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

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?

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

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.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.