mpsn Posted November 17, 2011 Share Posted November 17, 2011 Can someone please explain to me what's the importance of node order? Does certain nodes that appear first or last have impact on traversing time? Any suggestions much appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/251297-node-order/ Share on other sites More sharing options...
gizmola Posted November 17, 2011 Share Posted November 17, 2011 You'll have to be more specific -- provide some context, or a description of the problem you are trying to solve, or the code you're working on and how nodes figure into it. Quote Link to comment https://forums.phpfreaks.com/topic/251297-node-order/#findComment-1288863 Share on other sites More sharing options...
mpsn Posted November 17, 2011 Author Share Posted November 17, 2011 Hi, I think i'm ok, it's context specific: eg: if I have email message: <email> <to/> <from/> <message/> </email> *so it doesn't make sense if a user uses this XML and defines just a message first without a to and from field. Anways, I really hope you can take a look at my other post, it's very simple so I don't know why I'm stuck: When a user logs out, it will timestamp the current date/time to a lastSession field in my db table users. When the same user logs in again, in my Index.php, it should output: "Last session: 2011-11-19", please I hope you can help me out! I'd appreciate it. **Just look at Reply #7** http://www.phpfreaks.com/forums/index.php?topic=347908.0 Quote Link to comment https://forums.phpfreaks.com/topic/251297-node-order/#findComment-1288864 Share on other sites More sharing options...
gizmola Posted November 17, 2011 Share Posted November 17, 2011 If this is your own structure, you can define the valid structure for the document, by defining a DTD for it. This is a nice tutorial that takes you through the process: http://www.xmlfiles.com/dtd/dtd_intro.asp You may not want to create your own DTD, but the point is, that if you are writing parsing code, then the documents need to follow a convention, and based on your example, if you wrote something using simplexml for example that parsed those files, you would not be happy if you could not depend on using: $xml->email->to to get access to the to value, were it present. Quote Link to comment https://forums.phpfreaks.com/topic/251297-node-order/#findComment-1288868 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.