XML parser suggestion

  • Follow


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

0
Reply cbongior (40) 7/20/2005 3:16:37 PM

cbongior@stny.rr.com wrote:
> 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
0
Reply ivan2 7/20/2005 7:14:26 PM


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>

0
Reply cbongior (40) 7/21/2005 2:30:46 PM

2 Replies
18 Views

(page loaded in 0.08 seconds)

Similiar Articles:













7/28/2012 9:15:00 PM


Reply: