You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Zhang, Larry (L.)" <lz...@ford.com> on 2007/02/22 22:42:32 UTC

Xml utilities

I am trying to develop some classes used for XML parsing or generating
purposes. But I think it is difficult to abstract to write a common
utility since each XML document is different, and to parse that
document, we should have a different parser. So the question is what
utility class will look like so that it abstract some common
methods/usage so that all the team members can use the utility class. If
you can point me some example, that should be great.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Xml utilities

Posted by Brian Thompson <el...@gmail.com>.
I've had pretty good luck with Jibx; just write binding definitions to 
correspond to your POJOs, run the binding compiler, and start the 
application.

The binding definitions are the most involved part, and those are just 
some XML telling Jibx how each POJO corresponds to a data XML structure.


-Brian




Kalra, Ashwani wrote:
> There are already so many tools to automate this. With these tools you
> don't have to write ugly parsing code. Search for xml beans, jaxb,
> Castor. They all require schema to work on and then it will generate
> some stubs which are specific to your schema. These classes will be just
> like javabeans and you can call getter methods to extract the data.
> 
> In case your schema changes, you have to just run the tool again. 
> 
> /Ashwani 
> 
> 
>  
> 
> -----Original Message-----
> From: Zhang, Larry (L.) [mailto:lzhang20@ford.com] 
> Sent: Friday, February 23, 2007 3:13 AM
> To: Struts Users Mailing List
> Subject: Xml utilities
> 
> I am trying to develop some classes used for XML parsing or generating
> purposes. But I think it is difficult to abstract to write a common
> utility since each XML document is different, and to parse that
> document, we should have a different parser. So the question is what
> utility class will look like so that it abstract some common
> methods/usage so that all the team members can use the utility class. If
> you can point me some example, that should be great.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Xml utilities

Posted by "Kalra, Ashwani" <as...@capgemini.com>.
There are already so many tools to automate this. With these tools you
don't have to write ugly parsing code. Search for xml beans, jaxb,
Castor. They all require schema to work on and then it will generate
some stubs which are specific to your schema. These classes will be just
like javabeans and you can call getter methods to extract the data.

In case your schema changes, you have to just run the tool again. 

/Ashwani 


 

-----Original Message-----
From: Zhang, Larry (L.) [mailto:lzhang20@ford.com] 
Sent: Friday, February 23, 2007 3:13 AM
To: Struts Users Mailing List
Subject: Xml utilities

I am trying to develop some classes used for XML parsing or generating
purposes. But I think it is difficult to abstract to write a common
utility since each XML document is different, and to parse that
document, we should have a different parser. So the question is what
utility class will look like so that it abstract some common
methods/usage so that all the team members can use the utility class. If
you can point me some example, that should be great.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Xml utilities

Posted by Niall Pemberton <ni...@gmail.com>.
On 2/22/07, Zhang, Larry (L.) <lz...@ford.com> wrote:
> I am trying to develop some classes used for XML parsing or generating
> purposes. But I think it is difficult to abstract to write a common
> utility since each XML document is different, and to parse that
> document, we should have a different parser. So the question is what
> utility class will look like so that it abstract some common
> methods/usage so that all the team members can use the utility class. If
> you can point me some example, that should be great.

http://jakarta.apache.org/commons/digester/

Niall

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Xml utilities

Posted by sr...@wachovia.com.
Hi Zhang,

I am not sure if i got your question correct. But, if you want some 
already existing XML parsers then DOM and SAX Parsers are the ones which 
are used extensively. Again, i might be missing more efficient ones.