RE: Generate Java class from xml?

2003-12-18 Thread Edgar P Dollin
Castor from exolab http://www.castor.org/ is an excellent xml parser.  There
is also an interesting project for xml - beans
http://xml.apache.org/xmlbeans.

Edgar

 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, December 17, 2003 8:31 PM
 To: Struts Users Mailing List
 Subject: Re: Generate Java class from xml?
 
 
 Hmm, looks pretty good but it doesn't seem to do what I need. Thanks 
 though.
 
 On 12/17/2003 11:54 PMnbsp;Mark Lowe wrote:
  Dont know about using digester but html parser is a handy library.
  
  http://htmlparser.sourceforge.net/
  
  Might help you do what you want.
  
  On 17 Dec 2003, at 22:45, Adam Hardy wrote:
  
  Hi Christopher,
  just a quick question about Digester, perhaps you can save me the
  effort of reading up on it to find out myself, but will 
 Digester be  
  able to parse HTML?
 
  I am dealing with the Internet Explorer bookmarks export 
 file. I have
  already tried JAXB but JAXB chokes on it, saying that the 
 XML is not  
  well-formed.
 
  The bookmarks file has quite a few unpaired p and dt elements,
  which is obviously bad XML.
 
  Thanks
  Adam
 
  On 12/17/2003 09:38 PMnbsp;Christopher Milton wrote:
 
  I use Digester which is used by Struts itself. 
  http://jakarta.apache.org/commons/digester/
  http://www.google.com/search?q=jakarta+digester
  http://www.javaranch.com/newsletter/August2003/
  TouringTheCommonsPart2.html
  --- John Smart [EMAIL PROTECTED] wrote:
 
  There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which,
  unlike Castor, works with JDK 1.4...
 
  Martin Gainty wrote:
 
 
  Castor (http://www.castor.org) which generate the java classes
  with  marshall
  and unmarshall methods, but it is not finished, doesn't 
 care to  
  namespaces,
  owns severals bugs ...
 
  The second one is Xml Spy 5.0, it generate classes from an xsd
  file  which
  wrap on the Dom Tree, but all facets are not implemented as  
  enumeration ...
  but I think that a better version will come soon. 
 Generates JAXP  
  compliant
  Java Beans
  http://www.altova.com/features_java.html
 
  -Martin
 
  - Original Message - From: Vicky  
  [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, December 17, 2003 2:01 PM
  Subject: Generate Java class from xml?
 
 
 
 
  Does anyone have an idea of how i can generate .java file from
  xml  file?
 
 
  Tools like jakrata digester, JOX are there but both of them are
  useful in
  populating java beans from xml. My requirement is to generate 
  .java  file
 
 
  from .xml with getters and setters methods for xml
  elements/attributes. I
 
 
  also tried JAXB. But JAXB generates bunch of files and most of
  them  are
  interfaces, which is not going to work for me.
 
 
  For e.g. i have following xml file and i want to generate
  Address.java
 
 
  file with getters/setters. Any ideas?
 
 
  ?xml version='1.0' encoding='UTF-8' ?
  Address
FirstName type=String/
PoBox type=int/
  ..
  /Address
 
 
  Thanks,
  Vicky
 
 
 
  --
  struts 1.1 + tomcat 5.0.16 + java 1.4.2
  Linux 2.4.20 Debian
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: 
 [EMAIL PROTECTED]
 
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -- 
 struts 1.1 + tomcat 5.0.16 + java 1.4.2
 Linux 2.4.20 Debian
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Generate Java class from xml?

2003-12-18 Thread John Ferguson Smart
Must be a new anti-spam filter on the mail server, I guess...

Adam Hardy wrote:

John,
this is off-topic, but why does your message header contain the word 
***SPAM** ?

On 12/17/2003 08:43 PMnbsp;John Smart wrote:

There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, 
unlike Castor, works with JDK 1.4...

Martin Gainty wrote:

Castor (http://www.castor.org) which generate the java classes with 
marshall
and unmarshall methods, but it is not finished, doesn't care to 
namespaces,
owns severals bugs ...

The second one is Xml Spy 5.0, it generate classes from an xsd file 
which
wrap on the Dom Tree, but all facets are not implemented as 
enumeration ...
but I think that a better version will come soon. Generates JAXP 
compliant
Java Beans
http://www.altova.com/features_java.html

-Martin

- Original Message - From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?
 

Does anyone have an idea of how i can generate .java file from xml 
file?
  


Tools like jakrata digester, JOX are there but both of them are 
useful in
populating java beans from xml. My requirement is to generate .java 
file
from .xml with getters and setters methods for xml 
elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.
 

For e.g. i have following xml file and i want to generate Address.java
  


file with getters/setters. Any ideas?
 

?xml version='1.0' encoding='UTF-8' ?
Address
   FirstName type=String/
   PoBox type=int/
..
/Address
Thanks,
Vicky



--
John Ferguson Smart, PhD
Directeur de Projet
Département informatique Communicante 
AACOM
email : [EMAIL PROTECTED]

-
AACOM - L'Informatique communicante
120 rue du Marin Blanc - Z.I. des Paluds
13685 Aubagne Cedex
tel : 04.42.72.65.69 - fax : 04.42.72.65.68
Web : http://www.aacom.fr
-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Generate Java class from xml?

2003-12-17 Thread Higdon, Brian [VIS-Non JJ]
Have you looked at XML beans:

http://xml.apache.org/xmlbeans/



-Original Message-
From: Vicky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
To: [EMAIL PROTECTED]
Subject: Generate Java class from xml?


Does anyone have an idea of how i can generate .java file from xml file?
Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file
from .xml with getters and setters methods for xml elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me. 
 
For e.g. i have following xml file and i want to generate Address.java file
with getters/setters. Any ideas? 
?xml version='1.0' encoding='UTF-8' ?
 Address
FirstName type=String/
PoBox type=int/
..
/Address
 
 
Thanks,
Vicky




-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing


Re: Generate Java class from xml?

2003-12-17 Thread Martin Gainty
Castor (http://www.castor.org) which generate the java classes with marshall
and unmarshall methods, but it is not finished, doesn't care to namespaces,
owns severals bugs ...

The second one is Xml Spy 5.0, it generate classes from an xsd file which
wrap on the Dom Tree, but all facets are not implemented as enumeration ...
but I think that a better version will come soon. Generates JAXP compliant
Java Beans
http://www.altova.com/features_java.html

-Martin

- Original Message - 
From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?


 Does anyone have an idea of how i can generate .java file from xml file?
Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file
from .xml with getters and setters methods for xml elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.

 For e.g. i have following xml file and i want to generate Address.java
file with getters/setters. Any ideas?
 ?xml version='1.0' encoding='UTF-8' ?
  Address
 FirstName type=String/
 PoBox type=int/
 ..
 /Address


 Thanks,
 Vicky




 -
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: *****SPAM*****Re: Generate Java class from xml?

2003-12-17 Thread John Smart
There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike 
Castor, works with JDK 1.4...

Martin Gainty wrote:

Castor (http://www.castor.org) which generate the java classes with marshall
and unmarshall methods, but it is not finished, doesn't care to namespaces,
owns severals bugs ...
The second one is Xml Spy 5.0, it generate classes from an xsd file which
wrap on the Dom Tree, but all facets are not implemented as enumeration ...
but I think that a better version will come soon. Generates JAXP compliant
Java Beans
http://www.altova.com/features_java.html
-Martin

- Original Message - 
From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?

 

Does anyone have an idea of how i can generate .java file from xml file?
   

Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file
from .xml with getters and setters methods for xml elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.
 

For e.g. i have following xml file and i want to generate Address.java
   

file with getters/setters. Any ideas?
 

?xml version='1.0' encoding='UTF-8' ?
Address
   FirstName type=String/
   PoBox type=int/
..
/Address
Thanks,
Vicky


-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: *****SPAM*****Re: Generate Java class from xml?

2003-12-17 Thread Christopher Milton
I use Digester which is used by Struts itself.

http://jakarta.apache.org/commons/digester/
http://www.google.com/search?q=jakarta+digester
http://www.javaranch.com/newsletter/August2003/TouringTheCommonsPart2.html

--- John Smart [EMAIL PROTECTED] wrote:
 There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike 
 Castor, works with JDK 1.4...
 
 Martin Gainty wrote:
 
 Castor (http://www.castor.org) which generate the java classes with marshall
 and unmarshall methods, but it is not finished, doesn't care to namespaces,
 owns severals bugs ...
 
 The second one is Xml Spy 5.0, it generate classes from an xsd file which
 wrap on the Dom Tree, but all facets are not implemented as enumeration ...
 but I think that a better version will come soon. Generates JAXP compliant
 Java Beans
 http://www.altova.com/features_java.html
 
 -Martin
 
 - Original Message - 
 From: Vicky [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 2:01 PM
 Subject: Generate Java class from xml?
 
 
   
 
 Does anyone have an idea of how i can generate .java file from xml file?
 
 
 Tools like jakrata digester, JOX are there but both of them are useful in
 populating java beans from xml. My requirement is to generate .java file
 from .xml with getters and setters methods for xml elements/attributes. I
 also tried JAXB. But JAXB generates bunch of files and most of them are
 interfaces, which is not going to work for me.
   
 
 For e.g. i have following xml file and i want to generate Address.java
 
 
 file with getters/setters. Any ideas?
   
 
 ?xml version='1.0' encoding='UTF-8' ?
  Address
 FirstName type=String/
 PoBox type=int/
 ..
 /Address
 
 
 Thanks,
 Vicky
 
 
 
 
 -
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
   
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


=
Christopher Milton
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: *****SPAM*****Re: Generate Java class from xml?

2003-12-17 Thread Adam Hardy
John,
this is off-topic, but why does your message header contain the word 
***SPAM** ?

On 12/17/2003 08:43 PMnbsp;John Smart wrote:
There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike 
Castor, works with JDK 1.4...

Martin Gainty wrote:

Castor (http://www.castor.org) which generate the java classes with 
marshall
and unmarshall methods, but it is not finished, doesn't care to 
namespaces,
owns severals bugs ...

The second one is Xml Spy 5.0, it generate classes from an xsd file which
wrap on the Dom Tree, but all facets are not implemented as 
enumeration ...
but I think that a better version will come soon. Generates JAXP 
compliant
Java Beans
http://www.altova.com/features_java.html

-Martin

- Original Message - From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?
 

Does anyone have an idea of how i can generate .java file from xml file?
  
Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file
from .xml with getters and setters methods for xml elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.
 

For e.g. i have following xml file and i want to generate Address.java
  
file with getters/setters. Any ideas?
 

?xml version='1.0' encoding='UTF-8' ?
Address
   FirstName type=String/
   PoBox type=int/
..
/Address
Thanks,
Vicky


--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Generate Java class from xml?

2003-12-17 Thread Adam Hardy
Hi Christopher,
just a quick question about Digester, perhaps you can save me the effort 
of reading up on it to find out myself, but will Digester be able to 
parse HTML?

I am dealing with the Internet Explorer bookmarks export file. I have 
already tried JAXB but JAXB chokes on it, saying that the XML is not 
well-formed.

The bookmarks file has quite a few unpaired p and dt elements, which 
is obviously bad XML.

Thanks
Adam
On 12/17/2003 09:38 PMnbsp;Christopher Milton wrote:
I use Digester which is used by Struts itself.

http://jakarta.apache.org/commons/digester/
http://www.google.com/search?q=jakarta+digester
http://www.javaranch.com/newsletter/August2003/TouringTheCommonsPart2.html
--- John Smart [EMAIL PROTECTED] wrote:

There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike 
Castor, works with JDK 1.4...

Martin Gainty wrote:


Castor (http://www.castor.org) which generate the java classes with marshall
and unmarshall methods, but it is not finished, doesn't care to namespaces,
owns severals bugs ...
The second one is Xml Spy 5.0, it generate classes from an xsd file which
wrap on the Dom Tree, but all facets are not implemented as enumeration ...
but I think that a better version will come soon. Generates JAXP compliant
Java Beans
http://www.altova.com/features_java.html
-Martin

- Original Message - 
From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?





Does anyone have an idea of how i can generate .java file from xml file?
  

Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file

from .xml with getters and setters methods for xml elements/attributes. I

also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.


For e.g. i have following xml file and i want to generate Address.java
  

file with getters/setters. Any ideas?



?xml version='1.0' encoding='UTF-8' ?
Address
  FirstName type=String/
  PoBox type=int/
..
/Address
Thanks,
Vicky


--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Generate Java class from xml?

2003-12-17 Thread Mark Lowe
Dont know about using digester but html parser is a handy library.

http://htmlparser.sourceforge.net/

Might help you do what you want.

On 17 Dec 2003, at 22:45, Adam Hardy wrote:

Hi Christopher,
just a quick question about Digester, perhaps you can save me the  
effort of reading up on it to find out myself, but will Digester be  
able to parse HTML?

I am dealing with the Internet Explorer bookmarks export file. I have  
already tried JAXB but JAXB chokes on it, saying that the XML is not  
well-formed.

The bookmarks file has quite a few unpaired p and dt elements,  
which is obviously bad XML.

Thanks
Adam
On 12/17/2003 09:38 PMnbsp;Christopher Milton wrote:
I use Digester which is used by Struts itself.
http://jakarta.apache.org/commons/digester/
http://www.google.com/search?q=jakarta+digester
http://www.javaranch.com/newsletter/August2003/ 
TouringTheCommonsPart2.html
--- John Smart [EMAIL PROTECTED] wrote:
There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which,  
unlike Castor, works with JDK 1.4...

Martin Gainty wrote:


Castor (http://www.castor.org) which generate the java classes with  
marshall
and unmarshall methods, but it is not finished, doesn't care to  
namespaces,
owns severals bugs ...

The second one is Xml Spy 5.0, it generate classes from an xsd file  
which
wrap on the Dom Tree, but all facets are not implemented as  
enumeration ...
but I think that a better version will come soon. Generates JAXP  
compliant
Java Beans
http://www.altova.com/features_java.html

-Martin

- Original Message - From: Vicky  
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?




Does anyone have an idea of how i can generate .java file from xml  
file?

Tools like jakrata digester, JOX are there but both of them are  
useful in
populating java beans from xml. My requirement is to generate .java  
file

from .xml with getters and setters methods for xml  
elements/attributes. I

also tried JAXB. But JAXB generates bunch of files and most of them  
are
interfaces, which is not going to work for me.


For e.g. i have following xml file and i want to generate  
Address.java

file with getters/setters. Any ideas?


?xml version='1.0' encoding='UTF-8' ?
Address
  FirstName type=String/
  PoBox type=int/
..
/Address
Thanks,
Vicky


--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Generate Java class from xml?

2003-12-17 Thread Adam Hardy
Hmm, looks pretty good but it doesn't seem to do what I need. Thanks 
though.

On 12/17/2003 11:54 PMnbsp;Mark Lowe wrote:
Dont know about using digester but html parser is a handy library.

http://htmlparser.sourceforge.net/

Might help you do what you want.

On 17 Dec 2003, at 22:45, Adam Hardy wrote:

Hi Christopher,
just a quick question about Digester, perhaps you can save me the  
effort of reading up on it to find out myself, but will Digester be  
able to parse HTML?

I am dealing with the Internet Explorer bookmarks export file. I have  
already tried JAXB but JAXB chokes on it, saying that the XML is not  
well-formed.

The bookmarks file has quite a few unpaired p and dt elements,  
which is obviously bad XML.

Thanks
Adam
On 12/17/2003 09:38 PMnbsp;Christopher Milton wrote:

I use Digester which is used by Struts itself.
http://jakarta.apache.org/commons/digester/
http://www.google.com/search?q=jakarta+digester
http://www.javaranch.com/newsletter/August2003/ 
TouringTheCommonsPart2.html
--- John Smart [EMAIL PROTECTED] wrote:

There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which,  
unlike Castor, works with JDK 1.4...

Martin Gainty wrote:


Castor (http://www.castor.org) which generate the java classes 
with  marshall
and unmarshall methods, but it is not finished, doesn't care to  
namespaces,
owns severals bugs ...

The second one is Xml Spy 5.0, it generate classes from an xsd 
file  which
wrap on the Dom Tree, but all facets are not implemented as  
enumeration ...
but I think that a better version will come soon. Generates JAXP  
compliant
Java Beans
http://www.altova.com/features_java.html

-Martin

- Original Message - From: Vicky  [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?



Does anyone have an idea of how i can generate .java file from 
xml  file?

Tools like jakrata digester, JOX are there but both of them are  
useful in
populating java beans from xml. My requirement is to generate 
.java  file


from .xml with getters and setters methods for xml  
elements/attributes. I


also tried JAXB. But JAXB generates bunch of files and most of 
them  are
interfaces, which is not going to work for me.


For e.g. i have following xml file and i want to generate  
Address.java

file with getters/setters. Any ideas?


?xml version='1.0' encoding='UTF-8' ?
Address
  FirstName type=String/
  PoBox type=int/
..
/Address
Thanks,
Vicky


--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]