aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes XML Parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "XML Parser" Watch "XML Parser" New topic
Author

XML Parser

Ray Dawson
Ranch Hand

Joined: Sep 16, 2011
Posts: 75
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
Bartender

Joined: Oct 14, 2005
Posts: 18124
    
    8

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

Joined: Sep 16, 2011
Posts: 75
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
Bartender

Joined: Oct 14, 2005
Posts: 18124
    
    8

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

Joined: Nov 03, 2010
Posts: 581

See section Target Platform and Execution in your instructions.


SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2246

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?


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Ray Dawson
Ranch Hand

Joined: Sep 16, 2011
Posts: 75
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2246

Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4910
    
  10

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.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2246

2011-09-22 13:26 customer Ray Dawson (id: 10000000) has booked room 15

Some might even say that this is a DSL!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML Parser
 
Similar Threads
parser to be used
XMPP-style (stanza-oriented) XML parsing
client's side parsing using IE 5.0
How to read XML without SAX or DOM parser
Unmarshall Best Practices