I am writing a java application that takes schema-bounded XML as input and needs to translate it to a protbuf. There is no processing needed to be done; I simply need to grab a few fields from the XML and use them to create a protobuf.
I was hoping I could use JIBX to directly map the XML to my protobuf's Builder class, thus eliminating any middle work. However, JIBX requires the set-methods of the object being built to return void (http://jibx.sourceforge.net/details/binding-attributes.html). Protobuf's generated Builder class follows the builder design pattern and does not return void from its setter method.
Is there anyway to circumvent this issue and have JIBX directly translate XML to a protobuf class? Perhaps there is another XML parsing tool* I should look into using? Or will I have to write some intermediate code to facilitate the translation between XML and protobuf?
*note: the input XML I am receiving is extremely large, and I only need a handful of fields from it. This discounts some of the heavier XML parsing tools from my use.
I ended up performing an XSL Transformation on the input xml and fed the output through a (small) custom SAX Parser to create the protobuf. Thanks for the help!