Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Parser

 
Ray Dawson
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those are part of the standard Java API. Do the rules restrict you from using some parts of the standard API?
 
Ray Dawson
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Those are part of the standard Java API. Do the rules restrict you from using some parts of the standard API?


Nothing about API is mentioned in the instructions manual :argh:
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So there you go. You can use any class in the standard API.

(Of course it would be ridiculous for a developer certification to be based on a restricted subset of the Java language and API...)
 
Sean Keane
Ranch Hand
Posts: 588
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See section Target Platform and Execution in your instructions.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ray Dawson wrote:Thus for using xml, I need to write a xml parser myself or use an available one like DOM, or SAX etc.


Champ, although this is a nobel initiative, why adding such complexity when logging isn't even required?
 
Ray Dawson
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Sean Keane
Ranch Hand
Posts: 588
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Roel De Nijs
Sheriff
Posts: 10593
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the official page of the OCMJD assignment you'll find:
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:
Enterprise JavaBeans
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).

Just my 2 cents.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2011-09-22 13:26 customer Ray Dawson (id: 10000000) has booked room 15

Some might even say that this is a DSL!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic