This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm thinking on logging client data in .xml format so that its much easier to access & interpret compared to plain text.
By client data I meant, when a user books a record he's asked for his info like say his name & location, this data along with his customer id is logged in the .xml file.
Thus for using xml, I need to write a xml parser myself or use an available one like DOM, or SAX etc.
So my question is can I use these parsers for the assignment ? I just hope I dont get auto-disqualified
The assignment generally requires that you can write code using the Java programming language, using any and all constructions. You must also be able to make reasonable use of the following additional facilities and APIs:
Thread handling and synchronization
Swing (and AWT to the extent necessary to support Swing)
Standard file IO (java.io, not java.nio)
Either: Socket-based network programming and serialization _or_ Java RMI (Java Remote Method Invocation) (your choice of one or the other, not both).
The following APIs and facilities may not be used:
Servlets, JSP technology, or any other web-oriented APIs
NIO, the New IO facilities
Java DataBase Connectivity (JDBC) and SQL
Java IDL API and CORBA
Third party software libraries or tools (such as browsers)
So you can use any parser from the SDK.
But like Roberto already mentioned: why would you make this extra effort? First of all logging is not required at all. Secondly you say that xml is easier to interpret than plain text, but interpreting this plain text log is fairly easy: 2011-09-22 13:26 customer Ray Dawson (id: 10000000) has booked room 15. And finally we never look at our logs until something unexpected has happened (and we use plain text logging and so far that has never been a problem to access and interpret).