castor

In Java for XML marshalling/unmarshalling which utility should we use from JAXB, JIBX, CASTOR, ADB etx?

In Java for XML marshalling/unmarshalling one can use JAXB, JIBX, CASTOR, ADB etc. But out of these which is most generic & commonly used? Or is there any other utility available? ...

DOM versus Castor

Can anyone tell me which one better to use for xml parsing - DOM or Castor (with criterion being lesser memory usage)? ...

Castor compilation problem

I got "cannot access org.exolab.castor.core.exceptions.CastorException" from the compiler when I try to use Marshal and unmarshal. I used Castor 1.3 try { Writer writer = new FileWriter("out.xml"); Marshaller.marshal(person, writer); Reader reader = new FileReader("out.xml"); metaType = (Person) Unma...

What is the difference between Castor XML binding and JAXB binding

What is the difference between Castor XML and JAXB binding since both are binding java object to XML and vice versa. Updated : As using Castor I can do this Assume packageA.ClassA and packageB.ClassA have same attributes and class name just that they were located in different package. packageA.ClassA - > XML -> packageB.ClassA By ...

Castor and JAXB Marshaller

Currently I am using Castor framework to marshall the object into xml file it work greats Writer writer = new FileWriter("D:/out.xml"); Marshaller.marshal(test, writer); But now I am using javax.xml.bind to do the same thing. Writer writer = new FileWriter("D:/out.xml"); JAXBContext context = JAXBConte...

using Castor to parse xml based on attribute values

Using Castor to parse the following xml into POJOs using a mapping file is fairly straightforward: <human name="bob"/> <dog owner="alice"/> It uses the name of the element to map to the class. But what if an attribute should be used to do the mapping? e.g.: <animal type="human" name="bob"/> <animal type="dog" owner="alice"/> This...

Trouble setting WS response schema

I'm using soapUI to test some WebServices. In MockService available in soapUI I get this default response <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.someurl.com/schemas"&gt; <soapenv:Header/> <soapenv:Body> <sch:Response> <sch:Somet...

Framework for Delphi similar to Castor

Can anyone suggest: a framework for Delphi for work with XML / XSD like the one that makes Castor for JAVA? Borland XML Data Binding does not offer - he is not flexible. ...

Reverse engineering java objects into an xsd.

http://stackoverflow.com/questions/607141/what-is-jaxb-and-why-would-i-use-it/607248#607248 This fellow mentions some frameworks that allow you to go from java binding objects and re-create the schema that generated them. Does anyone know if this is possible with the Castor binding tool? We are using version .9 something. Someone mod...

Castor: Creating Mapping Files for Classes that have Abstract attributes

Hi, I have this class: public class Source extends Node { protected DistributionSampler delay ; protected DistributionSampler batchsize ; /** * @param name The name of the source node * @param d The {@link DistributionSampler} used to generate the * inter-arrival times */ public Source( String name, DistributionSamp...

XML Parsing / Dom Manipulation in Java

Hi, I'm trying to figure out how best to translate this: <Source><properties> .... <name>wer</name> <delay> <type>Deterministic</type> <parameters length="1"> <param value="78" type="Time"/> </parameters> </delay> <batchSize> <type>Cauchy</type> <parameters length="2"> <param value="23" type="Al...

Castor Mapping Arrays

Hi, I've got a class that has constructor: public ContEmpirical(double xs[], double fs[]) { Check.check(xs.length == fs.length + 1 && fs.length > 0, "Empirical distribution array mismatch"); this.xs = new double[xs.length]; this.xs = xs; this.cs = new double[xs.length]; double fTotal = 0.0; for (int...

LinkedHashMap with Castor

How can I tell Castor to use a LinkedHashMap instead of a HashMap? ...

Spring with Castor - Null Pointer Exception when initialising Application Context

Hi, I'm trying to register my castor mapping files with spring and I appear to be getting a null pointer exception. In my application context I have: <bean id="xmlContext" class="org.castor.spring.xml.XMLContextFactoryBean"> <property name="mappingLocations"> <list> <value>DistributionSamplerMappings.xml</value>...

Saxon XSLT-Transformation: How to change serialization of an empty tag from <x/> to <x></x>?

Hello folks! I do some XSLT-Transformation using Saxon HE 9.2 with the output later being unmarshalled by Castor 1.3.1. The whole thing runs with Java at the JDK 6. My XSLT-Transformation looks like this: <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://my/own/custom/namespace/for/...

Programatically setting castor properites in version 1.3

Hello, I am trying to programmatically set the org.exolab.castor.indent property when marshalling some objects - however, contrary to the documentation published, the class org.exolab.castor.util.LocalConfiguration does not seem to be shipped with the 1.3 release. Currently, I have specified the castor.properties file on the classpath,...

Is org.exolab.castor.xml.schema.Schema thread safe?

Is Castor's Schema object thread safe? ...

Castor: how to map a simple list of strings?

I have the following field in my class: private List<String> messages; Here's the mapping I have: <field name="messages" collection="arraylist" type="string" container="false> <bind-xml name="errors" node="element"/> </field> This is what I get as a result of marshalling: <errors><string>message1</string><string>message2</string...

Can Hibernate default a Null String to Empty String

In our application we are pulling data from a DB2 mainframe database. If the database has "low values" in a field, hibernate sends a "null" value in the object. This occurs even if the column is defined as "not null". As we are doing XML parsing on this, Castor is having trouble with it. I would like to fix this in Hibernate. Also, ...

Sorting XML generated by Castor

Hello, I am using Castor for XML Binding.. We need to sort the XML based on two different fields. Is there way we can specify the sort order in castor while marshalling? Which will be a better approach to do this sorting, if castor don't have this feature. Here is the actual problem with Sorting... I have two collections of two diffe...