Re: [castor-user] Problems building Castor and Adaptx

2005-04-27 Thread Keith Visco
Michael, It sounds like you're trying to build Castor with a version of Xerces that is not compatible with the one that Adaptx was built with, and then it seems like you're trying to build Adaptx with a version of JAXP that is not compatible with the one that Adaptx was written against. Are

Re: [castor-user] ExceptionInInitializerError

2005-04-28 Thread Keith Visco
It looks like you have a conflict between versions of Jakarta commons and log4j jars that you are using and the ones that Castor was compiled with. --Keith Ravi M wrote: Hi All, I am using castor -0.96 to marshall and unmarshall the xml file. Following is the scenario where I am

Re: [castor-user] [XML] one doubt - help

2005-05-04 Thread Keith Visco
You'll need to create a custom FieldHandler for this to parse the contents of your text value. Take a look at the website for a simple tuturial on FieldHanders. --Keith venkatesh babu wrote: Hi, I have one doubt, Will castor be able to extract datas from these type xml ?xml version=1.0

Re: [castor-user] [XML] what are properties available to use in castor.properties

2005-05-04 Thread Keith Visco
Take a look at the default castor.properties file in the castor jar, it lists most of the available properties. I noticed at least one property missing which I'll try to correct, but most of them are listed. --Keith venkatesh babu wrote: Hi, I wanted to know, how castor.properties file is

Re: [castor-user] Marshaller cannot find mapping file and I don't know why ...

2005-05-10 Thread Keith Visco
Neville, I ran into this issue myself the other day and I checked in a patch to the CVS for it. Can you try the CVS to see if the patch works for you. The weird thing was that the only reason I ran into it was because I had a type in my filename. If I actually used the correct filename, it was

Re: [castor-user] Mapping Java field content to XML element name

2005-05-11 Thread Keith Visco
Alexander, This isn't something easily done in Castor. I've done this myself in the past using a dynamic FieldDescriptor approach, basically you need to override the XMLClassDescriptor#getFieldDescriptor method such that it creates an XMLFieldDescriptor using the passed in xml name, or returns

Re: [castor-user] Able to marshal array but not unmarshal array

2005-05-11 Thread Keith Visco
Mark, What happens if you don't supress the xsi:type? --Keith Mark Chamness wrote: Perhaps something is wrong with my approach. Here is my test case that is failing: --- package org.agitar; import junit.framework.Assert; import junit.framework.TestCase; import

Re: [castor-user] Castor ignoring setSuppressXSIType

2005-06-02 Thread Keith Visco
Todd, Which marshal method are you invoking. Make sure it's not one of the static methods. --Keith Todd Huss wrote: We're using Castor 0.9.6 and the Marshaller seems to be ignoring the following suppress statements: Marshaller marshaller = new Marshaller(root);

[castor-user] Re: [castor-dev] Issue tracking and http://bugzilla.exolab.org

2005-06-02 Thread Keith Visco
Just as a note on this, I've closed the Bugzilla for Castor bug entry. There is no notice available on the Bugzilla site about this as I don't have access to the machine hosting bugzilla, but users are no longer allowed to enter new bugs in that system. As Werner mentioned, please use our

Re: [castor-user] interface ComponentBinding ?

2005-06-02 Thread Keith Visco
The contributor who was working on that is not currently active, so we have no current time frame on when it will be supported. It's available for implementing if your interested in taking it on! :-) --Keith ultan o'carroll wrote: I notice in

Re: [castor-user] castor source generator

2005-06-22 Thread Keith Visco
Bill, The change was due to a bug fix for complexType inheritence in which the unmarshal() method signature cannot be overridden when extending a class. The easiest fix was to simply default to java.lang.Object. I checked in a patch that searches for the proper base type if the class extends

Re: [castor-user] RE: Avoiding setting empty integer elements to zero

2005-07-29 Thread Keith Visco
Dinesh, Castor treats missing elements as null and empty elements as non-null. In order to treat an empty element as null, you need to use nillable=true in your schema. Nillable support is not completely finished and there is an open bug report in Jira for this. --Keith Pandey, Dinesh

Re: [castor-user] Marshalling with line seperators

2005-08-10 Thread Keith Visco
http://castor.codehaus.org/xml-faq.html#The-XML-is-marshalled-on-one-line,-how-do-I-force-line-breaks? [EMAIL PROTECTED] wrote: Hi all, I am using castor to marshall an object using mapping xml. The xml is unmarshalled in a single line. Is there a way to unmarshall with line seperators, so

Re: [castor-user] [XML] AsReference elements as duplicates

2005-08-22 Thread Keith Visco
Steve, It sounds like the generated classes have the JDO friendly getters which return an actual reference to the internal collections instead of a copy. Which would explain why AsReference appears in the getter names of the generated sources. Though I'm not sure why the AsReference methods

Re: [castor-user] xsi:schemaLocation Attribute

2005-08-22 Thread Keith Visco
Jitesh, When you declare the namespace as such: myMarshaller.setNamespaceMapping(, http://www.ne.jp/method/;); You get the below output? If so then it may be a bug, as it shouldn't try and use ns1 in that case. Also, I agree that if the xsi prefix is used anywhere that it should declare the

Re: [castor-user] xsi:schemaLocation Attribute

2005-08-23 Thread Keith Visco
updated by user. So in such cases deafult namespace is very useful. Thanks And Regards, Jitesh - Original Message - From: Keith Visco [EMAIL PROTECTED] To: user@castor.codehaus.org Sent: Tuesday, August 23, 2005 1:43 PM Subject: Re: [castor-user] xsi:schemaLocation Attribute Jitesh, When

Re: [castor-user] [XML] AsReference elements as duplicates

2005-08-23 Thread Keith Visco
Steve, Did you regenerate your classes + descriptors and recompile both after making the changes to the properties file? What does your binding file look like? The binding file takes a higher precendence than what's in the properties file, so sometimes a configuration setting in the binding

Re: [castor-user] how to avoid empty elements ?

2005-08-23 Thread Keith Visco
One solution is to write a custom FieldHandler that can check to see if your field is empty. If so simply return null from the getValue() method in the FieldHandler. For more on writing FieldHandler's please see: http://castor.codehaus.org/xml-fieldhandlers.html Hope that helps, --Keith

Re: [castor-user] setting package element in binding file questions

2005-09-12 Thread Keith Visco
Michael, I've actually never used the binding file for that, but try setting the namespace to package mapping in the /org/exolab/castor/builder/castorbuilder.properties file, that's where I normally do it. There is an example in the properties file. Look for the following and simply

Re: [castor-user] SchemaLocation

2005-09-12 Thread Keith Visco
Jitesh, You'd most likely have to use a ContentHandler that forwards events along to Castor's unmarshaller and then intercept all the Attributes. --Keith Kalyani Jitesh wrote: Hi There, Is there any way in Castor to get the value of xsi:schemaLocation attribute from XML as it during

Re: [castor-user] setting package element in binding file questions

2005-09-14 Thread Keith Visco
Michael Greene wrote: Keith, I think that what I am trying to do is different. I have a schema, You should be able to do it with using the castorbuilder.properties file, but you'll need to switch from xs:include to xs:import (see my comments below) Schema1.xsd with the following:

Re: [castor-user] SourceGenerator

2005-09-26 Thread Keith Visco
Danny, This may provide you with code that looks more like what you want: http://castor.codehaus.org/xml-faq.html#How-can-I-make-the-generated-source-code-more-JDO-friendly? --Keith Danny Collins wrote: Hello, I have just started working with Castor and the source generator. I am trying to

Re: [castor-user] Re: elementFormDefault is not working in unqualified mode

2005-09-26 Thread Keith Visco
As far as I understand it, qualified and unqualified indicate which namespace an element belongs to, not whether or not it should have a prefix. So you can have an unprefixed element which is still qualified with the default namespace declaration. You can also have a prefixed element which

Re: [castor-user] Re: elementFormDefault is not working in unqualified mode

2005-09-27 Thread Keith Visco
My comments inline... Mesut Celik wrote: Hi Keith, answers below... On 9/27/05, Keith Visco [EMAIL PROTECTED] wrote: As far as I understand it, qualified and unqualified indicate which namespace an element belongs to, not whether or not it should have a prefix. that's not completely

Re: [castor-user] reference ignored in mapping.xml when marshalling

2005-09-27 Thread Keith Visco
Damian, Can you send me a simple test case which I can run locally here to see the problem. Thanks, --Keith [EMAIL PROTECTED] wrote: I have double-checked and can confirm I am using the only non-static marshall method: marshaller.marshal(instance); I can also confirm the mapping file

Re: [castor-user] [XML] Marshalling - losing element names when marshalling to DOM Node

2005-09-27 Thread Keith Visco
Neville, What type of node is your parentNode? I just ran a simple test using a Document object as the parent and everything appears to be working fine for me. code-snippet Document document = docBuilder.newDocument(); Marshaller.marshal(foo, document); Source source = new

Re: [castor-user] SourceGenerator

2005-09-27 Thread Keith Visco
the SourceGenerator to generate java bean compliant code. Thanks Danny On 9/26/05, Keith Visco [EMAIL PROTECTED] wrote: Danny, This may provide you with code that looks more like what you want: http://castor.codehaus.org/xml-faq.html#How-can-I-make-the-generated-source-code-more-JDO-friendly? --Keith

Re: [castor-user] Suggestions for using Castor for web services?

2005-09-27 Thread Keith Visco
Hi Allen, Have you seen the following: http://www-128.ibm.com/developerworks/webservices/library/ws-castor/ --Keith Allen Cronce wrote: Hi all, We're looking to extend an existing WebObjects-based services application to support additional SOAP methods. I had a good experience with Castor

Re: [castor-user] easiest way to include arbitrary xml

2005-09-27 Thread Keith Visco
Jez, You can use solution 3 with a SAX ContentHandler instead of DocumentHandler to get rid of the deprecation warnings. Should be as easier as changing the XMLSerializer#asDocumentHandler call to XMLSerializer#asContentHandler. Another possibility is to either use a different SAX based

Re: [castor-user] Marshalling/Unmarshalling collections

2005-09-27 Thread Keith Visco
Matías, This is fairly easy using a mapping file, but with introspection it's a bit more difficult. Try configuring the Introspector to wrap collections by default: import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.util.ClassDescriptorResolverImpl;

Re: [castor-user] reference ignored in mapping.xml when marshalling

2005-09-29 Thread Keith Visco
Hi Damian, I tried to look into this, but the classes in your zip file won't compile as the zip is missing some required files. --Keith [EMAIL PROTECTED] wrote: Keith, The castor properties file, the mapping.xml and the test case class are included in the attached zip file. Most of the

Re: [castor-user] WSDL with multiple schema?

2005-09-29 Thread Keith Visco
Actually, there is. At Intalio we used to do exactly what Mark is trying to do. You need to implement your own URIResolver (org.exolab.castor.net) and pass it into the SchemaReader (or SchemaUnmarshaller which ever you are using) (both in package org.exolab.castor.xml.schema.reader). If

Re: [castor-user] set/getContent not generated in castor 0.9.9 using the Code Generator

2005-10-07 Thread Keith Visco
Hi John, Thanks for the e-mail. I'm able to reproduce this issue locally and I'll try and have it patched up this weekend. This appears to be affecting a number of users so I'll do my best to have a patch in before monday. --Keith John Shott wrote: Castor Users and Experts: We have also

Re: [castor-user] set/getContent not generated in castor 0.9.9 using the Code Generator

2005-10-07 Thread Keith Visco
FYI: I've tracked down where the problem is stemming from. Now I have to come up with a fix. --Keith Keith Visco wrote: Hi John, Thanks for the e-mail. I'm able to reproduce this issue locally and I'll try and have it patched up this weekend. This appears to be affecting a number

Re: [castor-user] JDOM/DOM Node as Field?

2005-10-07 Thread Keith Visco
in the upcoming 1.0? thanks Bill Keith Visco wrote: Castor has an AnyNode object which you can make use of. Basically just mark any field as a java.lang.Object. Castor will unmarshal the field as an org.exolab.castor.types.AnyNode instance. --Keith Alex Milowski wrote: -Original

Re: [castor-user] set/getContent not generated in castor 0.9.9 using the Code Generator

2005-10-09 Thread Keith Visco
I've checked a patch into CVS. For anyone waiting on this issue, please give the CVS version a try and report any issues. Thanks, --Keith Keith Visco wrote: FYI: I've tracked down where the problem is stemming from. Now I have to come up with a fix. --Keith Keith Visco wrote: Hi John

Re: [castor-user] [XML] Easiest way of serailizing boolean as 0/1 pair

2005-10-11 Thread Keith Visco
On 10/10/05, Mesut Celik [EMAIL PROTECTED] wrote: On 10/8/05, Keith Visco [EMAIL PROTECTED] wrote: Mesut Celik wrote: hi keith, what about the mapping.xml file? Actually I had written an GeneralizedFieldHandler without handlerFactory and then assigned the handler to some fields

Re: [castor-user] JDOM/DOM Node as Field?

2005-10-11 Thread Keith Visco
files and I will try to figured what is wrong in my environment. thanks Bill Keith Visco wrote: Hi Bill, If it's the same as 1153 then hopefully it'll be fixed. I'm working on the fix as we speak. --Keith Bill Leng wrote: Hi Keith, I entered the bug to the source generator (CASTOR

Re: [castor-user] Finding source of NPE with anonymous-simple-type

2005-10-11 Thread Keith Visco
Hi Sean, If you don't find any matches in the JIRA can you please open up a bug report and attach your test schema to that report. Thanks for your help! --Keith Sean LeBlanc wrote: On 10-08 15:39, Keith Visco wrote: Hi Sean, It might be easier to run the source generator without ant

Re: [castor-user] set/getContent not generated in castor 0.9.9 using the Code Generator

2005-10-11 Thread Keith Visco
Hi John, Thanks for responding John. I'm going to close that bug. --Keith John Shott wrote: Keith: Thanks for your timely attention to this matter. I've checked out the latest from the CVS repository, built castor-0.9.9.jar and can confirm that my files that call the getContent() and

Re: [castor-user] problem loading mapping

2005-10-11 Thread Keith Visco
Seamus, Remove this line in your mapping file: !DOCTYPE mapping PUBLIC -//EXOLAB/Castor Object Mapping DTD Version 1.0//EN http://Castor.exolab.org/mapping.dtd; Or change the http://castor.exolab.org/mapping.dtd; to a dtd stored locally on your server. The XML parser (most likely

Re: [castor-user] JDOM/DOM Node as Field?

2005-10-11 Thread Keith Visco
to figured what is wrong in my environment. thanks Bill Keith Visco wrote: Hi Bill, If it's the same as 1153 then hopefully it'll be fixed. I'm working on the fix as we speak. --Keith Bill Leng wrote: Hi Keith, I entered the bug to the source generator (CASTOR-1216). I am wondering if you

Re: [castor-user] Adding XML without having filds

2005-10-12 Thread Keith Visco
Merino, You can do this with a custom FieldHandler: field name=anything type=string handler=MyHandler/ Please see the online documentation for creating FieldHandler(s): http://castor.codehaus.org/xml-fieldhandlers.html --Keith merino silva wrote: Hi all, I want to add some XML tags

Re: [castor-user] [XML] \r\n is not escaped during marshalling

2005-11-04 Thread Keith Visco
Castor uses the Xerces Serializer so the escaping problem would be coming from Xerces not Castor. However you can use an element with xml:space=preserve as such: foo endofline xml:space=preserve /endofline /foo The following trick works for me: ?xml version=1.0? mapping class

Re: TR: [castor-user] Problem while unmarshalling

2005-11-08 Thread Keith Visco
Does your getListeComptes() method return the actual ArrayList or a copy of it? Unfortunately, Castor will actually attempt to incrementally add the items to the ArrayList returned from the getter. If it returns a copy then that explains why the list is empty after unmarshalling. There are

Re: [castor-user] bad character encoding

2005-11-09 Thread Keith Visco
Alain, Please see the FAQ: http://castor.codehaus.org/xml-faq.html#How-do-I-set-the-encoding? --Keith Alain Baucant wrote: I'm marshalling data with accentuated characters: ch.setDescription(Mon premier channel créé avec Castor); ... Marshaller.marshal(ch, writer); The xml content is not

Re: [castor-user] [JDO] Creating O/R-mapping with the SourceGenerator

2005-11-09 Thread Keith Visco
There is an experimental option for the source generator that you could try: java org.exolab.castor.builder.SourceGenerator -i my.xsd -gen-mapping mapping.xml It won't add the DB table mappings, but it should provide something you can work from. --Keith Werner Guttmann wrote: Not to my

Re: [castor-user] [JDO] Creating O/R-mapping with the SourceGenerator

2005-11-09 Thread Keith Visco
Just thinking to myself here, you might need to use the -nodesc option also when using the -gen-mapping option. --Keith Keith Visco wrote: There is an experimental option for the source generator that you could try: java org.exolab.castor.builder.SourceGenerator -i my.xsd -gen-mapping

Re: [castor-user] How to add comment in XML output ?

2005-11-10 Thread Keith Visco
-Original Message- From: Keith Visco [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 10 de Novembro de 2005 4:34 To: user@castor.codehaus.org Subject: Re: [castor-user] How to add comment in XML output ? Stephane, You could do the following: writer.write(?xml version=\1.0\ encoding=\UTF-8\?\n

Re: Ant: RE: [castor-user] [JDO] Creating O/R-mapping with the SourceGenerator

2005-11-10 Thread Keith Visco
Stefan, It is the intended effect. The MappingTool maps the given class and all its dependencies. Out of curiousity, did you also try the -gen-mapping -nodesc options from the SourceGenerator? --Keith Stefan Lober wrote: Thanks, this helps me a lot. I still have one follow-up question: I

Re: [castor-user] [XML] Unmarshalling mixed content

2005-11-10 Thread Keith Visco
Hi Martin, Castor is a bit weak when it comes to handling Mixed content. If you can use org.exolab.castor.types.AnyNode that's probably your best bet. --Keith Martin Resch wrote: hi, can anybody help me to unmarshall mixed content? it may be like following: textsimple text/text or

Re: [castor-user] mapping java.util.Set doesn't pull in all items

2005-11-16 Thread Keith Visco
Hi Bryan, Take a look at this thread, it may be a similar issue: http://www.mail-archive.com/user@castor.codehaus.org/msg01623.html --Keith [EMAIL PROTECTED] wrote: Hi, I am getting a curious result with my mapping file. it will only return one TestQuestion and in turn only a single

Re: [castor-user] Mutithreaded environment

2005-11-21 Thread Keith Visco
The static Marshaller#marshal methods are thread safe as they create a new Marshaller instance with each call, but the non-static one is not and care should be taken not to access a single Marshaller instance across multiple threads. Please see the Javadoc:

Re: [castor-user] Question about Unmarshalling with Zero or More Elements

2005-11-22 Thread Keith Visco
Tim, You need to mark your fields that are zero or more with the appropriate collection attribute as such: field name=localTier type=integer collection=arraylist bind-xml name=loc_tier node=element / /field It's a bit outdated, but take a look at the online documentation here:

Re: [castor-user] Castor XML - mapping qualified classes

2005-11-30 Thread Keith Visco
Nigel, See inline below... Nigel Kibble wrote: Hi, I'm trying to use Castor to unmarshall XML purchase orders, via a number of different scemas. One of the complex elements contained within the purchase order is Party, containing name and address information. I'm expecting to receive about

Re: [castor-user] Support for substitution groups (Castor 0.9.9.1)

2005-11-30 Thread Keith Visco
John, The marshalling framework itself supports the notion of subsitution groups and this type of mapping can be done using mapping files, however the source generator doesn't appear smart enough to generate the proper descriptors for substitution groups. I haven't looked at this area of

Re: [castor-user] Custom FieldHandler gives NullPointer in castor code

2005-12-01 Thread Keith Visco
, Nov 30, 2005 at 10:57:36PM -0600, Keith Visco wrote: Hi Jessica, I haven't seen that problem before. Is it possible for you to send me a working (ie compilable and demonstrates the problem) test case which I can run locally? --Keith Jessica Perry Hekman wrote: Hi all. I have a class which

Re: [castor-user] Questions

2005-12-03 Thread Keith Visco
Armin, You need public getters (eg: public String getFoo()) for each field you want saved in the XML. If you don't want to use public getters then you'll need to write a custom FieldHandler that will fetch and return the values as Castor does not support accessing private and protected

Re: [castor-user] marshal creates root element with wrong element name

2005-12-16 Thread Keith Visco
I'm not sure why your root element name is coming out wrong, but you can always change it using the Marshaller#setRootElement() method. --Keith Scott Curry wrote: Hello, I have done my best to search the user mailing list, the documentation, and google to find an answer, but to no avail.

Re: [castor-user] Property references while unmarshalling?

2006-01-05 Thread Keith Visco
You can create a custom field handler to be your GUID generator. And then use the following mapping: class name=...ClientDcl identity=clientGUID map-to xml=ClientDcl/ ... field name=clientGUID handler=MyGUIDHandler/ bind-xml name=ClientGUID/ /field ... /class

Re: [castor-user] Property references while unmarshalling?

2006-01-06 Thread Keith Visco
Sandeep, See inline comments... Sandeep Khanna wrote: Keith, Thanks for your valuable info. A few questions: On Thu, 2006-01-05 at 22:29 -0600, Keith Visco wrote: You can create a custom field handler to be your GUID generator. And then use the following mapping: class name

Re: [castor-user] Castor: too many open files, castor.cdr

2006-01-09 Thread Keith Visco
It sounds like a bug to me. In most cases you can safely delete the castor.cdr files...they are only really needed when element names and class names cannot be derived automatically. However, if you've used a binding file to rename classes instead of using the default ones, then you won't be

Re: [castor-user] [XML] Duplicate XML names in SourceGenerator

2006-01-20 Thread Keith Visco
Richard, et al. As Ralf mentions the reason for the collision is both the ClaimsCost complexType and the ClaimsCost element as Castor, by default, will generate a class for both. If you only want classes generated for the complexType and not the elements, you can configure Castor

Re: [castor-user] [XML] Duplicate XML names in SourceGenerator

2006-01-21 Thread Keith Visco
Another solution would be to use namespaces for your schema and map the namespaces to different Java packages so that your classes get generated in the appropriate packages based on the namespace schema. This would prevent the collisions. --Keith Ralf Joachim wrote: Sandeep, may it be an

Re: [castor-user] XSD generation

2006-02-02 Thread Keith Visco
If you set the targetNamespace in your schema you should see the namespaces in the output. --Keith Shiva P. Kodityala wrote: My sample xml is as below: TryRequest xmlns:api=http://www.fedex.com/fsmapi; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

Re: [castor-user] How to converto big XML files into java object efficiently?

2006-02-20 Thread Keith Visco
members in order to get some help abut that, I have tried to contact with Keith Visco mailto:kvisco-at-intalio.com but the e-mail on the source code is wrong. If I no get any replay about this problem, I am thinking to split my original file into smaller file using split unix command (my original

Re: [castor-user] XSD:any type and Unmarshalling

2006-02-20 Thread Keith Visco
Ashish, What are the errors you are receiving? --Keith Ashish Srivastava wrote: Hi, I have a problem unmarshalling an XML document which complies with a XSD which defines one of the elements as a xsd:any (xsd - namespace). The XML is sent and contains the value of the element as a

Re: [castor-user] How to converto big XML files into java object efficiently?

2006-02-20 Thread Keith Visco
David, Another solution would be to create a Bookstore class with an addBook method...such as: public class Bookstore { public void addBook(Book book) { // add book to database } public Book[] getBooks() { // return array of Book instances } } You can write a very

Re: [castor-user] Removing boolean=false lines from resultant XML file upon marshalling

2006-02-22 Thread Keith Visco
Avi, It might not be the ideal solution, but you could implement a custom FieldHandler that simply returns null from the FieldHandler#getValue() method if the boolean value is false. It would be nice if Castor had a simple property that can be set to indicate that default values should be

Re: [castor-user] set-method

2006-03-09 Thread Keith Visco
Stephen is pretty much correct here. The set-method attribute is used on the first item, if the getter returns null. Castor will instantiate a new collection and add it using the set-method. It will then use the getter on subsequent items. The set-method attribute can also be used to specify a

Re: [castor-user] Binding nested elements?

2006-03-13 Thread Keith Visco
Michael, Try adding a forward slash (/) in front of the a/b, such as: name=/a/b If I recall correctly there is a bug in the binding file that requires the extra forward slash. Hopefully that solves the issue for you. --Keith Michael Thome wrote: The second example works, but from reading

Re: [castor-user] when to use sourcecode generator ?

2006-03-13 Thread Keith Visco
Since you already have the classes, you don't need to use the source generator. All you need is the mapping file. Since you generated your mapping file with a tool, you may need to tweak it manually to provide the proper XML output. As you mentioned, it might be a good idea to have an XSD

Re: [castor-user] need to wrap all values in CDATA

2006-03-22 Thread Keith Visco
A custom field handler won't work as Marc has found out the serializer will encode the ''. The serializer believes that you are trying to output a string value of ![CDATA[...]] and that you'll want that same string value to be read back in exactly during xml parsing, so it encodes the

Re: [castor-user] When unmarshalling, need Castor to validate entire document against schema instead of quitting after first validation error

2006-03-23 Thread Keith Visco
Hi guys, Take a look at ValidationContext and ValidationException. I already started the groundwork for this. You'll see that ValidationException already supports chaining and ValidationContext has a fail-fast flag. Unfortunately, disabling fail-fast has not yet been implemented, but it was

Re: [castor-user] problem while doing Schema.cacheIncludedSchema() twice

2006-03-23 Thread Keith Visco
Thomas, Including a schema is like doing inline replacement. Trying doing import instead. --Keith Xu Zheng wrote: Hi, I got a big problem while trying to do Schema.cacheIncludedSchema() ... The senario is basically like this: I create a blank schema H, then cache schema A, at this point

Re: [castor-user] When unmarshalling, need Castor to validate entire document against schema instead of quitting after first validation error

2006-03-23 Thread Keith Visco
. My apologies to the female audience. --Keith Keith Visco wrote: Hi guys, Take a look at ValidationContext and ValidationException. I already started the groundwork for this. You'll see that ValidationException already supports chaining and ValidationContext has a fail-fast flag

Re: [castor-user] Trying to map section of xml structure into a string

2006-03-30 Thread Keith Visco
I know it's not ideal, but for Marshalling you'll most likely have to convert your String value back into an AnyNode instance which can be done using the Unmarshaller. :-) So something like: public Object convertUponGet(Object value) { if (value == null) return null;\

Re: [castor-user] Complex Mapping Examples?

2006-03-30 Thread Keith Visco
Stephen Bash wrote: Steven- You've got the right ideas, there's just something wrong with the implementation (which we'll try to figure out). First question is what version of Castor are you using? Next, what method are you calling to unmarshal the XML? If you use one of the static unmarshal

Re: [castor-user] Filtering while unmarshalling collections

2006-03-30 Thread Keith Visco
I think the ContentHandler suggestion will be the most efficient since the XML will only get parsed once. But if you really don't want to use that approach, another approach similar to Stephen's XQuery suggestion would be to use an XSLT stylesheet to pre-process your XML. It won't be as

Re: [castor-user] Complex Mapping Examples?

2006-03-30 Thread Keith Visco
Steven, Steven J. Owens wrote: or you can use the container attribute (goes in the field element in the mapping file). I'm assuming your Java class has an array or List of Item objects that turn into the individual items in the XML. If you set container=false (and provide the correct bind-xml

Re: [castor-user] [JDO] ClassNotPersistenceCapableException loading independent objects

2006-03-31 Thread Keith Visco
Hey Werner, The class ...Person$$EnhancerByCGLIB$$7166e6b7 is not persistence capable: no mapping was defined for the class Looks like another CGLib proxy class problem. The mapping api maps classes based on class name. The proxy is creating a modified version of the class which in turn

Re: [castor-user] Complex Mapping Examples?

2006-04-03 Thread Keith Visco
Both attributes have been around for quite a while, so no need to worry about being version friendly in the docs. :-) --Keith Ralf Joachim wrote: Thank you in advance Steven As far as I know, there had been only small changes or bug fixes on the XML side since 0.9.5. I don't know myself when

Re: [castor-user] Problem using Date FieldHandler while unmarshalling

2006-04-03 Thread Keith Visco
Swati, Which version of Castor are you using? --Keith Swati Singhal wrote: Hi, I have an XML file which we will be unmarshalling using Castor. If I write a CustomHandler, it works just fine. However, we have the dates all over the XML, so I decided to write a GeneralizedFieldHandler. Now,

Re: [castor-user] Trying to map section of xml structure into a string

2006-04-03 Thread Keith Visco
come to as well, but have not had time to try that (tried just about everything else I could think of). I will try to get that done sometime shortly. Thanks! - Matt On 3/30/06, *Keith Visco* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I know it's not ideal

Re: [castor-user] New to Castor, need help with XSD Imclude/imports

2006-04-03 Thread Keith Visco
. Could you possible shoot me a quick example of how to do the namespace stuff so it'll work and an example of a castorbuilder.properties that matches? I'd appreciate it. Thanks! --Mike Keith Visco wrote: Hi Mike, This can be done. And yes it does matter if you use include instead

Re: [castor-user] Standalone attribute in ?xml ?

2006-04-10 Thread Keith Visco
Something like: myWriter.write(?xml version=\1.0\ encoding=\UTF-8\ standalone=\no\?\n); myWriter.write(!DOCTYPE GatewayRequest SYSTEM \http://gateway.dtd\;\n); Marshaller m = new Marshaller(myWriter); m.setMarshalAsDocument(false); m.marshal(myObject); Should do the trick, --Keith

Re: [castor-user] [XML] Binding file schema issue

2006-04-12 Thread Keith Visco
Patty, Download a copy of binding.xsd and change the schemaLocation to point to your local copy. You definately don't want to depend on an external server to be up and running in order to use your binding file. The same goes for mapping files and any runtime dependencies. --Keith Ralf

Re: [castor-user] Serializing of double results in scientific expression in XML-output

2006-04-18 Thread Keith Visco
Daniel, If you search the archives a bit you'll find out that you can set a FieldHandler globally programmatically by implementing a FieldHandlerFactory and specifying this on the ClassDescriptorResolverImpl's Introspector instance. --Keith Daniel Nilsson wrote: Hi! I have a problem with

Re: [castor-user] XML Getter discovery

2006-04-19 Thread Keith Visco
Hi Chris, Can you open up a JIRA report on this issue? Please see our issue reporting page here: http://castor.codehaus.org/cvs.html#Issue-Reporting-and-Tracking---JIRA Thanks, --Keith ELVART, CHRISTOPHER (SBCSI) wrote: I have a class with a boolean field and if I let the mapper discover

Re: [castor-user] FieldHandler with parameters?

2006-04-19 Thread Keith Visco
Steven, It's probably not the best solution, but you can use the getFieldDescriptor() method of AbstractFieldHandler (GeneralizedFieldHandler) to find out about the which field is being processed and you can do the proper padding as necessary. --Keith [EMAIL PROTECTED] wrote: Hi folks,

Re: [castor-user] XML: ClassCastException while unmarshaling an extension field

2006-04-19 Thread Keith Visco
Hi Gilad, Does the same problem occur when you generate the source using the type-centric approach? http://castor.codehaus.org/sourcegen.html#The-'type'-method --Keith Gilad Haimov wrote: Hi all, We use Castor to bind XML configuration data to our Java app. Our XML data contains an

Re: [castor-user] Automatically discovered mapping files?

2006-04-24 Thread Keith Visco
Hi Chris, You should be able to drop a mapping file with the name .castor.xml into your Java package and Castor should discover it. Hope that helps! --Keith ELVART, CHRISTOPHER (SBCSI) wrote: Before I got to Castor I evaluated several other XML Binding tools and I have found this one to

Re: [castor-user] [XML] Problem with mapping file

2006-04-25 Thread Keith Visco
Christian, I'm not sure what the problem would be in resolving the included mapping, however you could try the following as a work-around: Mapping mapping = new Mapping(); mapping.loadMapping(commonMappingURL); mapping.loadMapping(mashalBindingURL); If I recall correctly, that should load

Re: [castor-user] URIResolver!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2006-04-25 Thread Keith Visco
Deepak, You need to implement URIResolver. The InputStream and Reader arguments allow you to provide the URILocationImpl with the way in which to read the URI. So for example, in your URIResolver class you can do something like the following: public URILocation resolve(String href,

Re: [castor-user] XML mapping question

2006-04-25 Thread Keith Visco
Alex, Not without some work. You might be able to get it to marshal the way you want it to by writing an XMLClassDescriptor for your object that maps to relationships. However you'll probably end up having a hard time getting it to work, and it would be difficult during the unmarshalling

Re: [castor-user] Automatically discovered mapping files?

2006-04-29 Thread Keith Visco
as well ? Werner -Original Message- From: Keith Visco [mailto:[EMAIL PROTECTED] Sent: Dienstag, 25. April 2006 03:09 To: user@castor.codehaus.org Subject: Re: [castor-user] Automatically discovered mapping files? Hi Chris, You should be able to drop a mapping file with the name

Re: [castor-user] Is public static {Type} valueOf(String) not working with 1.0.4?

2006-10-25 Thread Keith Visco
I don't remember exactly, but the comment I added to the code gives us a clue: //-- mapping loader now supports a basic EnumFieldHandler //-- for xml we simply need to make sure the toString() //-- method is called during getValue() //FieldHandler handler = xmlDesc.getHandler(); //handler = new

Re: [castor-user] SchemaReader - schemaLocation

2007-03-27 Thread Keith Visco
Mitch, You could also provide an EntityResolver implementation that resolves the namespace of the soap schema that you are trying to import. --Keith Martin Gainty wrote: mitch- you are speaking of an include scenario http://www.xfront.com/ZeroOneOrManyNamespaces.html this comment When you

Re: [castor-user] Supress Namespaces

2007-03-27 Thread Keith Visco
That's most likely what's happening. If an element doesn't belong to the default namespace, in this case the http://apps.pdc.org/wls/server/api; namespace, Castor will undeclare the default namespace for that element. So the xmlns= is basically undeclaring a default namespace for the element

Re: [castor-user] Directly Insert XML Into Marshalled Object

2007-03-27 Thread Keith Visco
If you build your custom XML as an org.exolab.castor.types.AnyNode instance, then you can just pass the root level AnyNode to the setMyXmlObj method. http://www.castor.org/javadoc/org/exolab/castor/types/AnyNode.html --Keith Zach Calvert wrote: I'm curious if there is a way to insert XML into

  1   2   >