[jibx-users] bug in GenericXMLWriter.java

2005-04-21 Thread Jitesh Doshi
I think I might have found a bug in GenericXMLWriter.java.

The following line ...

protected void writePrefix(int index) throws IOException {
try {
String text = m_prefixes[index];

... should instead be ...

protected void writePrefix(int index) throws IOException {
try {
String text = getNamespacePrefix(index);

... that way it takes into account, the extension namespaces as well. I am
using JiBX bound XML beans with a lot of DOM-based elements embedded in (using
DOMElementMapper). In those case, I get ArrayIndexOutOfBoundsException.

Dennis, what do you think?

--Jitesh


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


---
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


RE: [jibx-users] How to compile and run simple jibx

2005-04-21 Thread Mocky Habeeb
Title: Message



I 
believe you also need jibx-run.jar and bcel.jar in your classpath at bind time. 
The binding compiler seems to pick up these jars automatically if they are in 
the same directory as jibx-bind.jar, but I just put them into my classpath 
directly.

Mocky

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of divya 
  reddySent: Thursday, April 21, 2005 12:47 AMTo: 
  jibx-users@lists.sourceforge.netSubject: [jibx-users] How to 
  compile and run simple jibx
  Hi,
  I am just learning jibx and got some material from jibx.org 
  I have my binding definition ready and also the class files.As 
  given in the jibx.org I tried to compile by following command
  
  java -cp .:/jibx/lib/jibx-bind.jar org.jibx.binding.Compile binding.xmlbut I am getting an errorException in thread "main" java.lang.NoClassDefFoundError: org/jibx/binding/Compile If this method is wrong please tell me how to compile and run.Thanks,Divya
  Yahoo! India Matrimony: Find your life partner online.


RE: [jibx-users] How to compile and run simple jibx

2005-04-21 Thread Davies, Joshua








Thats correct for a Unix system 
maybe youre running windows? If so, then you need to change the
colon to a semi-colon (technically, the slashes ought to be backslashes, but
evidently the JRE can translate that). For example:



C:\workjava -cp .:tools/lib/jibx-bind.jar
org.jibx.binding.Compile

Exception in thread main
java.lang.NoClassDefFoundError: org/jibx/binding/Comp

ile



C:\workjava -cp .;tools/lib/jibx-bind.jar
org.jibx.binding.Compile



Usage: java org.jibx.binding.Compile [-b]
[-l] [-v] binding1 binding2 ...

where:

-b turns on BCEL verification
(debug option),

-l turns on test loading of
modified or generated classes for validation, and

-v turns on verbose output

The bindingn files are different bindings
to be compiled.



If you are on Unix or Linux the trailing
slash in the the second element of your classpath is probably the problem 
change the command to:



java -cp .:jibx/lib/jibx-bind.jar org.jibx.binding.Compile binding.xmlAnd, of course, ensure that the file jibx/lib/jibx-bind.jar is resolvable from your CWD.











From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of divya reddy
Sent: Wednesday, April 20, 2005
11:47 PM
To:
jibx-users@lists.sourceforge.net
Subject: [jibx-users] How to
compile and run simple jibx







Hi,





I am just learning jibx and got some material from jibx.org 





I have my binding definition ready and also the class files.As
given in the jibx.org I tried to compile by following command









java -cp .:/jibx/lib/jibx-bind.jar org.jibx.binding.Compile binding.xmlbut I am getting an errorException in thread main java.lang.NoClassDefFoundError: org/jibx/binding/Compile If this method is wrong please tell me how to compile and run.Thanks,Divya

Yahoo! India Matrimony: Find your life partner online.








Re: [jibx-users] OT: End user tools for editing xml

2005-04-21 Thread Henri Dupre
Just tried microsoft infopath and that's a fantastic tool!
I just had to add namespace info to my schema, create a form in
infopath (5 min) and voila. End users will be able to edit and modify
the xml files using the schema! If we deploy more ms stuff I guess they
will be able to also do that on the web.

Henri.On 4/20/05, Mocky Habeeb [EMAIL PROTECTED] wrote:







On the 
commercial side, I have seen something in the Altova XML Spy Suite that seems to 
do just that. But I'm not sure if each user would need a license to run it and I 
haven't wanted to spend the money. I also would be interested to find out what 
else is out there to let users edit xml files without exposing them to 
xml.

Mocky



  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]] On Behalf Of Henri 
  DupreSent: Wednesday, April 20, 2005 3:08 PMTo: 
  jibx-users@lists.sourceforge.netSubject: [jibx-users] OT: End user 
  tools for editing xmlWith all the new jibx tools 
  (bindings to schema and java to bindings), I'm planning to use much more XML 
  features in our IT system.The last step will be to enable our people to 
  edit and create the xml files. Would someone have recommendation on end-user 
  tools that would generate forms using schemas and allow to save the results to 
  xml files?Thanks,Henri.



[jibx-users] Problems using default with deserializer to an enum

2005-04-21 Thread Steffan Westcott
I am able to use a Java 1.5 style enum for unmarshalling, like this:
value name=language field=language 
deserializer=Test.Language.valueOf/


package Test;
public enum Language
{
English, French, German
}

However, I get an binding compiler error when attempting to specify a 
default value for the enum:

value name=language field=language usage=optional 
default=English deserializer=Test.Language.valueOf/

[bind] Using the following paths:
[bind]   C:\Borland\JBuilder2005\projects\JiBXBugExample\classes
[bind] Using the following binding paths:
[bind]   mapping.xml
[bind] Running binding compiler version jibx-rc0
[bind] Error: Unable to load class Test.Language for converting default 
value of type Test.Language for value element at (line 4, col 118, in 
mapping.xml)
[bind] Error running binding compiler
[bind] org.jibx.runtime.JiBXException: Binding mapping.xml is unusable 
because of validation errors
[bind]at org.jibx.binding.Utility.loadBinding(Utility.java:361)
[bind]at org.jibx.binding.Utility.loadFileBinding(Utility.java:389)
[bind]at org.jibx.binding.Compile.compile(Compile.java:294)
...

It seems to have trouble loading my classes when trying to deal with the 
default value conversion. If I remove the default/deserialize 
properties, everything works correctly. What am I doing wrong?

Thanks,
Steffan
---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Jibx-bind.sh problem with link list

2005-04-21 Thread Dennis Sosnoski
It looks like you're probably using the old alpha version of Xsd2Jibx. 
Try the current Beta 0.2 along with the JiBX RC0 and it should probably 
work. If it doesn't, file a bug in Jira with the original schema attached.

 - Dennis
Jian Fang wrote:
Hi,
I like to implement a benchmark to pass a link list to
a web service using Jibx/Jibxsoap. I use the xsd2jibx
tools and
first create the java code from a schema, compile
them,  and then run jibx-bind.sh, but get the
following error:
Exception in thread main
java.lang.StackOverflowError
The java code is as follows:
package wstest;
echolist.java
public class EchoList {
 protected TestNode list;
 public EchoList() {
 }
 public TestNode getList() {
   return this.list;
 }
 public void setList(TestNode list) {
   this.list = list;
 }
 public EchoList(TestNode list) {
   this.list = list;
 }
}
echolistresponse.java
package wstest;
public class EchoListResponse {
 protected TestNode echoListResult;
 public EchoListResponse() {
 }
 public TestNode getEchoListResult() {
   return this.echoListResult;
 }
 public void setEchoListResult(TestNode
echoListResult) {
   this.echoListResult = echoListResult;
 }
 public EchoListResponse(TestNode echoListResult) {
   this.echoListResult = echoListResult;
 }
}
testnode.java
package wstest;
public class TestNode extends TestStruct {
 protected TestNode next;
 
 public TestNode(int i, float f){
 this.i = i;
 this.f = f;
 }
 
 public TestNode(int i, float f, java.lang.String s){
 this.i = i;
 this.f = f;
 this.s = s;
 }
 
 public TestNode(int i, float f, java.lang.String s,
TestNode next) {
 this.i = i;
 this.f = f;
 this.s = s;
 this.next = next;
 } 
 
 public TestNode getNext() {
   return this.next;
 }

 public void setNext(TestNode next) {
   this.next = next;
 }
 protected TestNode() {
 }
}
The part of the mapping file is as follow:
mapping name=EchoList class=wstest.EchoList
   namespace uri=http://localhost/wstest;
default=elements/
   structure name=list field=list
usage=optional using=wstest.TestNode/structure
 /mapping
 mapping name=wstest.TestNode
class=wstest.TestNode label=wstest.TestNode
   namespace uri=http://localhost/wstest;
default=elements/
   value style=element name=i field=i
usage=required/
   value style=element name=f field=f
usage=required/
   value style=element name=s field=s
usage=optional/
   structure name=Next field=next
usage=optional using=wstest.TestNode/structure
 /mapping
 mapping name=EchoListResponse
class=wstest.EchoListResponse
   namespace uri=http://localhost/wstest;
default=elements/
   structure name=EchoListResult
field=echoListResult usage=optional
using=wstest.TestNode/structure
 /mapping
Could anyone helps me to figure out what the problem
is  with Jibx? Thanks in advance.

		
__ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs

---
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
 


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Binding File question

2005-04-21 Thread Dennis Sosnoski
You might be able to do part of what you want by playing games with 
deserializers, if you're only unmarshalling XML. Try using a custom 
deserializer that always returns true, like:

 public static boolean presenceDeserializer(String value) {
   return true;
 }
and set up the binding to use this deserializer method for the 
required/ element, binding the element to feature1Required. If the 
required/ element is present the deserializer will get called; if the 
element isn't present the boolean will just have the default false 
value. You could also do something similar for the feature1 element - 
say that it contains a value type=text .../ which you bind to the 
feature1Supported flag, using the same presenceDeserializer.

This gets more complicated if you need to marshal as well as unmarshal. 
In theory you should be able to do this with test-methods for the 
values, but it might get messy. This would also mean more changes to 
your code, while for unmarshalling you can do essentially everything in 
the binding definition.

I suppose for 2.0 I could generalize the test-method to also support a 
test-field, or just define some way of associating an element directly 
with a boolean. That gets ugly, though, in that you want it both for 
simple elements (corresponding to value elements in the binding 
definition) and those with substructure (corresponding to structure 
elements). I think this has come up a few times, though, so some easier 
way of handling the situation would be nice.

 - Dennis
Mocky Habeeb wrote:
I don't believe there is a better way to do that than with your own
marshaller since you're not directly mapping a value in the xml to your
java. I think the custom marshaller is the way to go, it seems like you
want to extend what JiBX can do.
Mocky

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris Chen
Sent: Saturday, April 16, 2005 3:28 AM
To: jibx-users@lists.sourceforge.net
Subject: [jibx-users] Binding File question
Hi,
I am wondering if anyone can tell me if it's possible to map the 
following XML to a class:

The XML is something like this:
features
  feature1
 required/
  /feature1
/features
The class is something like this:
class Features {
  boolean feature1Supported;
  boolean feature1Required;
  //additional set/get methods
}
Is it possible with JiBX to define the binding file such that I can set 
a boolean  value when a certain element exists (ie. required/ in this 
case)?  If so, how do I go about handling subelements and mapping them 
to the Features class as shown above?  I've been pondering this for a 
while.  The only way I can currently deal with this is through custom 
marshallers and unmarshallers.

I am wondering if there is a  better way other than writing custom code.
Thank you for your time,
Chris
 


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users