XML parser suggestion

C

cbongior

Ok, what I am really looking for is a XML parser equivalently simple to
another I am use to.

I have used the JOX http://www.wutka.com/jox.html parser extensively.
It has some limitations but nothing show stopping. All-in-all, in 2
lines of code I can serialize and deserialize a java class I wrote and
can integrate.

As an aside, I ahve used JAXB and people have suggested it. My hang up
with it is that I can't modify the code to integrate it with my system;
unless someone knows different.

Well, JOX uses bean properties and XML tags (no attributes). I am in a
situation where I will have XML that is heavily attributed with very
few tags.


So, I guess I am looking for XML serializing libraries that allow me to
generate the code. Any thoughts?

Christian

http://christian.bongiorno.org/resume.pdf
 
I

Ivan Bout

Ok, what I am really looking for is a XML parser equivalently simple to
another I am use to.

I have used the JOX http://www.wutka.com/jox.html parser extensively.
It has some limitations but nothing show stopping. All-in-all, in 2
lines of code I can serialize and deserialize a java class I wrote and
can integrate.

As an aside, I ahve used JAXB and people have suggested it. My hang up
with it is that I can't modify the code to integrate it with my system;
unless someone knows different.

Well, JOX uses bean properties and XML tags (no attributes). I am in a
situation where I will have XML that is heavily attributed with very
few tags.


So, I guess I am looking for XML serializing libraries that allow me to
generate the code. Any thoughts?

Christian

http://christian.bongiorno.org/resume.pdf

Hi Christian,

I use XERCES for my XML generation. I am not very familiar with XML but
I think you also could add attributes with it. I followed a tutorial and
now I can generate my own XML files!

Maybe you should take a look at it!

http://www.javazoom.net/services/newsletter/xmlgeneration.html

Ivan
 
C

cbongior

This isn't exactly what I had in Mind.

With the JOX parser you construct your XML as such

<Person>
<givenName>Christian</givenName>
<surName>B.</surName>
<age>999</age>
<clothingSizes>
<shoes>8</shoes>
<shirt>medium</shirt>
<pants>38x30</pants>
</clothingSizes>
<alias>joe</alias>
<alias>paco</alias>
<alias>skippy</alias>
</Person>

This would translate into java code as such

public class Person {

private String givenName = "";
private String surName = "";
private Integer age = "";
private ClothingSizes = null;
private String[] aliases = null;

public String getGivenName() ...
public void setGivenName(String name)...

// other setters and getters.

}

You create the clothing sizes class and proceed the same way.
Basically, through the use of bean introspection you structure your
java code and your XML identically. with the use of an IDE like
Intellij, I can whip up classes to match the XML structure in about 1
minute per class -- debugged and everything. Serializing is 2 lines of
code!

I would love an XML serializer that acutally does the same thing but
with heavily (all tags even) attributed XML. Such as

<Person givenName="Christian" surName="B." age="999"
aliases="joe,paco,skippy">
<ClothingSizes shirt ="medium" shoes="8" pants="38x30"/>
</person>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top