• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XSLT vs Betwixt

 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

When we are parsing 1 xml structure to another ..which of the two optiosn are the best

1) using betwixt
2) usng xslt

And which offers better performance???

Regards
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The betwixt toolkit page says:

The Betwixt library provides an XML introspection mechanism for mapping beans to XML in a flexible way. It is implemented using an XMLIntrospector and XMLBeanInfo classes which are similar to the standard Introspector and BeanInfo from the Java Beans specification.

Betwixt provides a way of turning beans into XML as well as automatically generating digester rules in a way that can be customized on a per type manner in the same way that the BeanInfo mechanism can be used to customize the default introspection on a java object.



So it would be applicable ONLY if you have data in JavaBeans already. What form is your existing "xml structure" right now?

XSLT can be quite fast but may not be appropriate if you are manipulating the basic structure extensively.

This is another of those weird questions asking for a comparison between two completely different kinds of technology. Perhaps you should be stating the problem as generally as possible and looking at all possible approaches.

Bill

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks Will ;

The existing code base uses betwixt to transform xml to bean and bean to xml..but with additional changes to xml files content; the feasibility of keeping the things generic with betwixt is kind of getting difficult; so would it be a good idea to move away from betwixt to
xslt

Regards

 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How complex is the conversion from your existing XML to your desired output?

If there is a major change in the XML hierarchy, XSLT would not be my tool of choice. On the other hand, simple reformatting is exactly what XSLT is good at.

Am I correct in assuming you don't really need the Java bean objects for anything?

Bill

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bill,

We have decided to stick with betwizt itself..and there is no major change...in the conversion..


Am I correct in assuming you don't really need the Java bean objects for anything?



We populate the data inot the beans and finally do the conversion..so its required....
 
reply
    Bookmark Topic Watch Topic
  • New Topic