Re: [jibx-users] Recommended JIBX issue policy

2024-05-09 Thread Archie Cobbs
Hi Daniel,

On Wed, May 8, 2024 at 10:35 AM Daniel Krügler via jibx-users <
jibx-users@lists.sourceforge.net> wrote:

> Is this the right approach?
>

That is the right approach - and the same one I used to fix the same
problem with plain text (my apologies for missing the attribute version of
the same problem).

The maintenance of JiBX has quieted down a lot but PRs do get merged and
new releases do get created every so often, sometimes after a little
prodding.

Maybe Don will pipe in here when he gets a chance...

In the meantime you might consider doing what I did, which is just build
your own custom, patched version of JiBX until a new release comes out.

-Archie

-- 
Archie L. Cobbs
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Jibx 1.3.3 binding compliler with JDK 1.8 generating classes in single package

2022-04-01 Thread Archie Cobbs
Hi Dickson,

On Fri, Apr 1, 2022 at 4:24 PM Dickson Rodrigues <
rodrigues.dick...@gmail.com> wrote:

> However when I introduced a second bindings file with a separate package
> mentioned in both bindings.xml files. The access classes for both bindings
> are generated in the package mentioned in the first bindings.xml.
>

OK - but does that cause a problem?

I'm a little fuzzy on this but I think JiBX generates more than one type of
class. Notice there are "access" classes, "factory" classes, and "munge
adapter" classes.

I'm guessing that when you perform one binding operation with multiple
binding files, JiBX just sticks (some of) the generated classes in the
first package it finds because they are global... or something like that.

-Archie

-- 
Archie L. Cobbs
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Jibx 1.3.3 binding compliler with JDK 1.8 generating classes in single package

2022-04-01 Thread Archie Cobbs
Hi Dickson,

On Fri, Apr 1, 2022 at 1:51 PM Dickson Rodrigues <
rodrigues.dick...@gmail.com> wrote:

> Will you please take a look at the attached project and see why we get the
> access files generated in the billing package? I am using ant 1.9.14 and
> running it on mac.
>

Hang on - the original problem was that JiBX was generating files in the
default package instead of the same package as the model classes.

My suggestion was that by adding a missing "package" attribute to the
 element, that would fix the problem, which - in my test at least
- it did.

I never suggested that the converse was true, i.e., that by removing the
"package" attribute from the  element that you would somehow cause
JiBX to not generate ANY files in the model package.

In my experience JiBX almost always generates classes in the model package,
for reasons having to do with Java package-private accessibility.

-Archie

-- 
Archie L. Cobbs
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Jibx 1.3.3 binding compliler with JDK 1.8 generating classes in single package

2022-04-01 Thread Archie Cobbs
Hi Dickson,

Happy to help. Of course now I'm curious what the key difference is... keep
us posted.

-Archie

On Fri, Apr 1, 2022 at 11:08 AM Dickson Rodrigues <
rodrigues.dick...@gmail.com> wrote:

> Hi Archie,
>
> Thanks a lot for your response and spending time on this.
>
> I created a new sample project just like you did and it worked for me as
> well. However when I try the same configuration in my project it doesn't
> seem to work. I will continue to debug and keep you posted on how it goes.
>
> Thanks again Archie!!
>
> Thanks and Regards,
> Dickson Rodrigues
>
>
> On Thu, Mar 31, 2022 at 4:10 PM Archie Cobbs 
> wrote:
>
>> Not sure why but I was unable to reproduce your issue using a slightly
>> modified version of your files.
>>
>> Here's a shell script trace:
>>
>> $ tree
>> .
>> ├── binding.xml
>> ├── build.xml
>> ├── lib
>> │   ├── jibx-bind-1.3.3.jar
>> │   └── jibx-run-1.3.3.jar
>> └── src
>> └── java
>> └── com
>> └── blahblah
>> └── model
>> └── account
>> ├── Account.java
>> └── AccountResult.java
>>
>> 7 directories, 6 files
>> $ cat build.xml
>> 
>>
>> 
>>
>> 
>> 
>> 
>>
>> 
>> > removeNotFollowedSymlinks="true" includeEmptyDirs="true"/>
>> 
>>
>> 
>> 
>> >compiler="modern"
>>deprecation="true"
>>srcdir="${basedir}/src/java"
>>destdir="${basedir}/build/classes"
>>source="1.8"
>>target="1.8"
>>debug="true">
>> 
>> 
>> 
>>
>> 
>> > classpathref="test.classpath"/>
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> $ cat binding.xml
>> 
>>
>> 
>> > class="com.blahblah.model.account.AccountResult">
>> 
>> > type="com.blahblah.model.account.Account" ordered="false">
>> 
>> > field="accountNumber" usage="optional"/>
>> 
>> 
>> 
>> 
>> $ cat src/java/com/blahblah/model/account/AccountResult.java
>> package com.blahblah.model.account;
>>
>> import java.util.ArrayList;
>> import java.util.List;
>>
>> public class AccountResult {
>>
>> private List accounts;
>> }
>> $ cat src/java/com/blahblah/model/account/Account.java
>> package com.blahblah.model.account;
>>
>> public class Account {
>>
>> private String idNumber;
>> private String accountNumber;
>>
>> }
>> $ ant
>> Buildfile: /Users/archie/bugs/jibx/build.xml
>>
>> javac:
>> [mkdir] Created dir: /Users/archie/bugs/jibx/build/classes
>> [javac] Compiling 2 source files to
>> /Users/archie/bugs/jibx/build/classes
>>
>> jibx-bind:
>>
>> BUILD SUCCESSFUL
>> Total time: 0 seconds
>> $ tree build
>> build
>> └── classes
>> └── com
>> └── blahblah
>> └── model
>> └── account
>> ├── Account.class
>> ├── AccountResult.class
>> ├── JiBX_accountBindingAccountResult_access.class
>> ├── JiBX_accountBindingFactory.class
>> └── JiBX_accountBindingMungeAdapter.class
>>
>> 5 directories, 5 files
>> $
>>
>> -Archie
>>
>>
>>
>> -Archie
>>
>> On Thu, Mar 31, 2022 at 1:53 PM Dickson Rodrigues <
>> rodrigues.dick...@gmail.com> wrote:
>>
>>>
>>> Hi Archie,
>>>
>>> Thanks for responding.
>>>
>>> Please see the details below,
>>>
>>> Build.xml
>>>
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>> Jars includ

Re: [jibx-users] Jibx 1.3.3 binding compliler with JDK 1.8 generating classes in single package

2022-03-31 Thread Archie Cobbs
Not sure why but I was unable to reproduce your issue using a slightly
modified version of your files.

Here's a shell script trace:

$ tree
.
├── binding.xml
├── build.xml
├── lib
│   ├── jibx-bind-1.3.3.jar
│   └── jibx-run-1.3.3.jar
└── src
└── java
└── com
└── blahblah
└── model
└── account
├── Account.java
└── AccountResult.java

7 directories, 6 files
$ cat build.xml
































$ cat binding.xml












$ cat src/java/com/blahblah/model/account/AccountResult.java
package com.blahblah.model.account;

import java.util.ArrayList;
import java.util.List;

public class AccountResult {

private List accounts;
}
$ cat src/java/com/blahblah/model/account/Account.java
package com.blahblah.model.account;

public class Account {

private String idNumber;
private String accountNumber;

}
$ ant
Buildfile: /Users/archie/bugs/jibx/build.xml

javac:
[mkdir] Created dir: /Users/archie/bugs/jibx/build/classes
[javac] Compiling 2 source files to
/Users/archie/bugs/jibx/build/classes

jibx-bind:

BUILD SUCCESSFUL
Total time: 0 seconds
$ tree build
build
└── classes
└── com
└── blahblah
└── model
└── account
├── Account.class
├── AccountResult.class
├── JiBX_accountBindingAccountResult_access.class
├── JiBX_accountBindingFactory.class
└── JiBX_accountBindingMungeAdapter.class

5 directories, 5 files
$

-Archie



-Archie

On Thu, Mar 31, 2022 at 1:53 PM Dickson Rodrigues <
rodrigues.dick...@gmail.com> wrote:

>
> Hi Archie,
>
> Thanks for responding.
>
> Please see the details below,
>
> Build.xml
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> Jars included -
>
> ant-1.8.4.jar
> ant-launcher-1.8.4.jar
> bcel-6.4.1.jar
> jibx-bind-1.3.3.jar
> jibx-run-1.3.3.jar
> joda-time-2.10.5.jar
> xpp3-1.1.3.4.O.jar
> jibx-extras-1.3.3.jar
>
>
> Removed the old jibx jars from the lib directory
>
> binding file -
>
> 
>  class="com.blahblah.model.account.AccountResult">
>  factory="com.blahblah.model.account.AccountResult.listFactory">
>  ordered="false">
> 
>  usage="optional"/>
> 
> 
> 
> 
>
>
> JiBX_accountBindingAccountResult_access.class is generated under package
> com.blahblah.model.billing. Infact all the _access files for my bindings
> are generated under the same package. Looks like it take the package name
> from the first binding file.
>
> Please let me know if you need more information.
>
>
> Thanks and Regards,
> Dickson Rodrigues
>
>
> On Thu, Mar 31, 2022 at 12:50 PM Archie Cobbs 
> wrote:
>
>> Can you create and post a *minimal* test case Maven project demonstrating
>> the problem?
>>
>> On Thu, Mar 31, 2022 at 10:35 AM Dickson Rodrigues <
>> rodrigues.dick...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am facing the same issue as few others who have reported those here.
>>> https://sourceforge.net/p/jibx/mailman/message/35070901/ and
>>> https://sourceforge.net/p/jibx/mailman/message/35115289/
>>> I have added the dependency jars, updated the classpath to include those
>>> jars. I have tried giving the package name in the bindings file as well.
>>>
>>> I am running out of ideas. Anyone have any suggestions?
>>>
>>> *To admins* : Will you please post this on the threads mentioned above (
>>> https://sourceforge.net/p/jibx/mailman/message/35070901/ and
>>> https://sourceforge.net/p/jibx/mailman/message/35115289/) to see if
>>> they were able to resolve the issue and can help me.
>>>
>>> Thanks and Regards,
>>> Dickson Rodrigues
>>> ___
>>> jibx-users mailing list
>>> jibx-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jibx-users
>>>
>> --
>> Archie L. Cobbs
>> ___
>> jibx-users mailing list
>> jibx-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jibx-users
>>
> ___
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>


-- 
Archie L. Cobbs
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Jibx 1.3.3 binding compliler with JDK 1.8 generating classes in single package

2022-03-31 Thread Archie Cobbs
Can you create and post a *minimal* test case Maven project demonstrating
the problem?

On Thu, Mar 31, 2022 at 10:35 AM Dickson Rodrigues <
rodrigues.dick...@gmail.com> wrote:

> Hi,
>
> I am facing the same issue as few others who have reported those here.
> https://sourceforge.net/p/jibx/mailman/message/35070901/ and
> https://sourceforge.net/p/jibx/mailman/message/35115289/
> I have added the dependency jars, updated the classpath to include those
> jars. I have tried giving the package name in the bindings file as well.
>
> I am running out of ideas. Anyone have any suggestions?
>
> *To admins* : Will you please post this on the threads mentioned above (
> https://sourceforge.net/p/jibx/mailman/message/35070901/ and
> https://sourceforge.net/p/jibx/mailman/message/35115289/) to see if they
> were able to resolve the issue and can help me.
>
> Thanks and Regards,
> Dickson Rodrigues
> ___
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
-- 
Archie L. Cobbs
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] JiBX 1.3.3

2020-01-27 Thread Archie Cobbs
Hi Don,

Just wanted to say thank you!

I'm still using JiBX in several projects and it continues to work
beautifully for my purposes.

Glad it's going to continue to be usable for a long time.

-Archie

On Mon, Jan 27, 2020 at 10:09 AM Don Corley  wrote:

> JiBX 1.3.3 has been released.
>
> This release includes the following changes:
> 1. Dependencies updated, such as joda-time and BCEL.
> 2. maven-jibx-plugin has been renamed to jibx-maven-plugin to comply with
> plugin naming rules.
> 3. Compatibility with Java 6, 7, 8, 9, 10, 11, 12, and 13+.
>
> You can find the release file here:
> https://sourceforge.net/projects/jibx/files/
>
> Maven artifacts are available in maven central.
> You can find the instructions on the JiBX site:
> http://jibx.sourceforge.net/jibx-maven-plugin/index.html
>
> Enter your issues here:
> https://github.com/jibx -> Issues
>
> Cheers!
>
> Don
> ___
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>


-- 
Archie L. Cobbs
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] JIBX marshalling truncating namespaces intermittently

2018-04-27 Thread Archie Cobbs
I've never encountered any problem like that with JiBX. My guess is that
there is some buffering bug in a lower layer of your I/O pipeline.

-Archie

On Fri, Apr 27, 2018 at 1:46 PM, Vadheraju, Rajeshwar  wrote:

> When we do marshalling of object into XML, the name spaces are being
> truncated intermittently. We could not reproduce the issue consistently all
> the time but it is happening pretty much every day in the production. And
> the issue goes away when we recycle JVMs. We checked code and there is
> nothing we changed recently and we also checked production load which did
> not change much. We have been encountering the issue since 4/6 and very
> consistently every day this week.
>
>
>
> The good marshalled XML looks like below:
>
>
>
> *http://xyz.com/dxModel/bdm/common
> "
> xmlns:cst="http://xyz.com/dxModel/bdm/customer
> "
> xmlns:act="http://xyz.com/dxModel/bdm/account
> "
> xmlns:ast="http://xyz.com/dxModel/bdm/asset
> "
> xmlns:lia="http://xyz.com/dxModel/bdm/liability
> "
> xmlns:rel="http://xyz.com/dxModel/bdm/relationship
> "
> xmlns:col="http://xyz.com/dxModel/bdm/collateral
> "
> xmlns:gua="http://xyz.com/dxModel/bdm/guarantee
> "
> xmlns:ses="http://xyz.com/dxModel/bdm/activity
> "
> xmlns:esg="http://xyz.com/dxModel/bdm/esignature
> "
> xmlns:ath="http://xyz.com/dxModel/bdm/attachment
> ">*
>
>
>
> The bad one looks like below:
>
> *http://xyz.com/dxModel/bdm/common
> "
> xmlns:ses="http://xyz.com/dxModel/bdm/activity
> ">*
>
>
>
> So when we unMarshall bad document/XML, jib is throwing error(which is
> obvious) that
>
>
>
> org.xmlpull.v1.XmlPullParserException: could not determine namespace
> bound to element prefix cst (position: END_TAG seen
> .. @1:19189)
>
>at org.xmlpull.mxp1.MXParser.pars
> eStartTag(MXParser.java:1816)
>
>at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1259)
>
>at org.xmlpull.mxp1.MXParser.nextToken(MXParser.java:1100)
>
>at org.jibx.runtime.impl.XMLPullR
> eaderFactory$XMLPullReader.nextToken(Unknown Source)
>
>at org.jibx.runtime.impl.UnmarshallingContext.advance(Unknown
> Source)
>
>at org.jibx.runtime.impl.Unmarsha
> llingContext.parsePastCurrentEndTag(Unknown Source)
>
>at com.xyz.dxModel.bdm.customer.J
> iBX_bdm_services_binding_2AdtnlPhonesType_access.unmarshal()
>
>at com.xyz.dxModel.bdm.customer.C
> ustomerEntity.JiBX_bdm_services_binding_2_unmarshal_1_1(
> CustomerEntity.java)
>
>at com.xyz.dxModel.bdm.customer.C
> ustomerEntity.JiBX_bdm_services_binding_2_unmarshal_1_2(
> CustomerEntity.java)
>
>at com.xyz.dxModel.bdm.account.Ji
> BX_MungeAdapter.JiBX_bdm_services_binding_2_unmarshal_1_95()
>
>at com.xyz.dxModel.bdm.common.Dat
> aRepositoryModelType.JiBX_bdm_services_binding_2_unmarshal_
> 1_0(DataRepositoryModelType.java)
>
>at com.xyz.dxModel.bdm.common.JiB
> X_bdm_services_binding_2DataRepositoryModelType_access.unmarshal()
>
>at org.jibx.runtime.impl.Unmarsha
> llingContext.unmarshalElement(Unknown Source)
>
>at org.jibx.runtime.impl.Unmarsha
> llingContext.unmarshalDocument(Unknown Source)
>
>
>
>
> *Raj Vadheraju *IT Architect Specialist
> Corporate CIO Office
>
>
>
> T: 414.815.2613
> C: 414.551.6410
> rajeshwar.vadher...@fisglobal.com
>
> *FIS | Empowering the Financial World* [image:
> cid:image001.png@01D112FA.C4A77D90] [image:
> cid:image002.png@01D112FA.C4A77D90] [image:
> cid:image003.png@01D112FA.C4A77D90] 
>
>
>
> [image: cid:image009.jpg@01D1810B.6E815C90]
>
>
> The information contained in this message is proprietary and/or
> confidential. If you are not the intended recipient, please: (i) delete the
> message and all copies; (ii) do not disclose, distribute or use the message
> in any manner; and (iii) notify the sender immediately. In addition, please
> be aware that any message addressed to our domain is subject to archiving
> and review by persons other than the intended recipient. Thank you.
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> jibx-users mailing list
> 

Re: [jibx-users] Jibx 1.2.5 binding compiler with JAVA 7 pushes all generated code in a single package

2016-05-07 Thread Archie Cobbs
I've never seen that problem.

And you are specifying the package in your binding files like this?


   ...

FYI version 1.2.6 is the latest.

-Archie


On Sat, May 7, 2016 at 10:43 AM, Avila, Edgar 
wrote:

> Hi, , I have not been able to find information out there on the web nor
> other means to determine whether there is a fix or work around for an issue
> my team ran into when running JiBX binding compiler version 1.2.5 and Java
> 7. The issue is as follows.
>
>
>
> When JiBX binding compiler is run with JAVA 7, the generated
> JiBX*_access.class files are all pushed to the default package (the package
> of the class in the first mapping element) even if the class and name in
> each mapping are set with the package. This causes to create a very large
> set of classes in a single package.
>
>
>
> When JiBX binding compiler is run with JAVA 6, the generated
> JiBX*_access.class files are correctly put in the corresponding package.
>
>
>
> On the above basis, we have unsuccessfully tried to split the single
> binding file into multiple binding files. But, we still get the same result
> if use JAVA 7.
>
>
> --
> 
> This email message and any attachments may contain confidential,
> proprietary or non-public information. The information is intended solely
> for the designated recipient(s). If an addressing or transmission error has
> misdirected this email, please notify the sender immediately and destroy
> this email. Any review, dissemination, use or reliance upon this
> information by unintended recipients is prohibited. Any opinions expressed
> in this email are those of the author personally.
>
>
> --
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>


-- 
Archie L. Cobbs
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] org.jibx.runtime.JiBXException: Duplicate element "{http://www.pcats.org/schema/naxml/loyalty/v01}Promotion"(line 1, col 1059)

2016-02-10 Thread Archie Cobbs
You have:

 wrapper,
but your XML has them "inline" with no wrapper.

Try removing name="Promotion" from the collection?

-Archie


On Wed, Feb 10, 2016 at 1:12 AM, PS Govind  wrote:

> Could anyone please assist me in resolving the Duplicate element error?
> Any help would be greatly appreciated...
>
> *XML*
> 
> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; xmlns:ns4="
> http://www.pcats.org/schema/core/v01; xmlns:ns3="
> http://www.pcats.org/schema/naxml/loyalty/v01;>
> 
> 
> 
> 1
> 
> 001
> **
> HOSTRefID6085997634
> HOSTRefID6085997634
> 0.00
> loyaltyOffer
> 
> **
> 4K
> 4K
> 0.00
> loyaltyOffer
> 
> 001
> 
> 
> 
> 2
> 
> cash
> Other
> 0.00
> 
> 
> 
> 
> 
> 
>
> *Binding*
>  xmlns:ns3="http://www.pcats.org/schema/naxml/loyalty/v01;
> xmlns:ns2="http://www.naxml.org/POSBO/Vocabulary/2003-10-16;
> xmlns:ns4="http://www.pcats.org/schema/core/v01; trim-whitespace="true">
>
> http://www.pcats.org/schema/naxml/loyalty/v01;
> default="elements" />
> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; />
> http://www.pcats.org/schema/core/v01; />
>
>  name="FinalizeRewardsRequest" ordered="false" flexible="true">
> 
>  type="org.pcats.schema.naxml.loyalty.v01.TransactionDetailGroup"
> set-method="setTransactionDetailGroup" ordered="false" flexible="true"
> usage="optional"/>
> 
>   
>
>class="org.pcats.schema.naxml.loyalty.v01.TransactionDetailGroup"
> ordered="false">
>  item-type="org.pcats.schema.naxml.loyalty.v01.TransactionLine"
> set-method="setTransactionLineList" create-type="java.util.ArrayList"/>
>   
>
>class="org.pcats.schema.naxml.loyalty.v01.TransactionLine" ordered="false"
> flexible="true">
>  type="org.pcats.schema.naxml.loyalty.v01.TransactionLine$TransactionLineStatus"
> enum-value-method="xmlValue"/>
>  
> test-method="ifFuelLine" set-method="setFuelLine" usage="optional"/>
>   usage="optional"/>
>   
>
>name="FuelLine" ordered="false" flexible="true" >
>set-method="setFuelGradeID"ns="
> http://www.naxml.org/POSBO/Vocabulary/2003-10-16; />
>create-type="java.util.ArrayList" usage="optional">
>  ordered="false" flexible="true" usage="optional">
>  set-method="setPromotionID"   usage="optional" />
>  set-method="setPromotionAmount"   usage="optional" />
> 
>  
>   
> 
>
> *Exception*
> org.jibx.runtime.JiBXException: Duplicate element "{
> http://www.pcats.org/schema/naxml/loyalty/v01}Promotion;(line 1, col 1059)
> at
> org.jibx.runtime.impl.UnmarshallingContext.throwNameException(UnmarshallingContext.java:249)
> ~[jibx-run.jar:1.2.5]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_16()
> ~[app1.jar:na]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestFuelLine_access.unmarshal()
> ~[app1.jar:na]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_13()
> ~[app1.jar:na]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestTransactionLine_access.unmarshal()
> ~[app1.jar:na]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_11()
> ~[app1.jar:na]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_12()
> ~[app1.jar:na]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestTransactionDetailGroup_access.unmarshal()
> ~[app1.jar:na]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_9()
> ~[app1.jar:na]
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestFinalizeRewardsRequest_access.unmarshal()
> ~[app1.jar:na]
> at
> org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
> ~[jibx-run.jar:1.2.5]
> at
> org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2948)
> ~[jibx-run.jar:1.2.5]
> org.jibx.runtime.JiBXException: Duplicate element "{
> http://www.pcats.org/schema/naxml/loyalty/v01}Promotion;(line 1, col 1059)
> at
> org.jibx.runtime.impl.UnmarshallingContext.throwNameException(UnmarshallingContext.java:249)
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_16()
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestFuelLine_access.unmarshal()
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_CancelTransactionRequestMungeAdapter.JiBX_FinalizeRewardsRequest_unmarshal_1_13()
> at
> org.pcats.schema.naxml.loyalty.v01.JiBX_FinalizeRewardsRequestTransactionLine_access.unmarshal()
> at
> 

Re: [jibx-users] JiBX and Java 8

2015-11-11 Thread Archie Cobbs
Hi Don,

Understood.

In the meantime, we've been using JiBX 1.2.6 successfully with BCEL
6.0-20150726.24-123. Presumably once BCEL 6.0 is actually released it
will work also.

Here's the Ivy RoundUp details:


http://archiecobbs.github.io/ivyroundup/repo/modules/net.sourceforge.jibx/jibx/1.2.6/ivy.xml

-Archie


On Wed, Nov 11, 2015 at 8:35 AM, Don Corley  wrote:

> Archie,
>
> We're ready to go with the Java 8 compatible version of JiBX.
>
> I'll we need is the BCEL 6.0 release. We can't release a version of JiBX
> that has a dependency on a RC version.
>
> Thanks,
>
> Don
>
>>
>> FYI,
>>
>> A co-worker has tried JiBX with the latest BCEL release (BCEL_6_0_RC4) and
>> claims that this combination works on Java 8.
>>
>> I have not tried this myself yet. I'd be interested to hear others'
>> experiences if you do.
>>
>> -Archie
>>
>
>
> --
>
> ___
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>


-- 
Archie L. Cobbs
--
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] JiBX 1.2.6 released

2015-09-03 Thread Archie Cobbs
FYI,

A co-worker has tried JiBX with the latest BCEL release (BCEL_6_0_RC4) and
claims that this combination works on Java 8.

I have not tried this myself yet. I'd be interested to hear others'
experiences if you do.

-Archie

On Fri, Mar 27, 2015 at 9:40 AM, Archie Cobbs <arc...@dellroad.org> wrote:

> Thanks Don.
>
> From that patch, it appears that no changes to JiBX 1.2.6 are needed. In
> other words, simply swapping in the newer BCEL 6.0 snapshot JAR makes it
> work with JDK 8.
>
> Is that correct? That seems to contradict the original poster's complaint:
>
> Using 1.2.6 + BCEL 6-SNAPSHOT, I was unable to run the binding tools.
>> When I built with JDK 7 and ran with 8, I still got the "Expected stackmap
>> frame at this location." error.
>>
>
> Or am I missing something here...
>
> Thanks,
> -Archie
>
> --
> Archie L. Cobbs
>



-- 
Archie L. Cobbs
--
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991=/4140___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] JiBX 1.2.6 released

2015-03-27 Thread Archie Cobbs
Thanks Don.

From that patch, it appears that no changes to JiBX 1.2.6 are needed. In
other words, simply swapping in the newer BCEL 6.0 snapshot JAR makes it
work with JDK 8.

Is that correct? That seems to contradict the original poster's complaint:

Using 1.2.6 + BCEL 6-SNAPSHOT, I was unable to run the binding tools.
 When I built with JDK 7 and ran with 8, I still got the Expected stackmap
 frame at this location. error.


Or am I missing something here...

Thanks,
-Archie

-- 
Archie L. Cobbs
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Multiple value elements pointing to the same field

2013-12-12 Thread Archie Cobbs
I think that's just the way JiBX works.

You might consider a workaround of creating a new setter method
setValueIfNull() that does nothing if the value is already set.

-Archie


On Thu, Dec 12, 2013 at 10:49 AM, Vincent Fumo vfumo.w...@gmail.com wrote:

  I've got 2 xml files to unmarshall using jibx. They have identical
 structure with one exception : one of the elements has a different
 attribute name for the same property. I'd like to use the same binding but
 I'm getting behavior that I don't understand. Can anyone help?

 A Generalization of the files:

 File 1

 AB name=foo//A

 File 2

 AB key=foo//A

 My binding looks something like this :

 structure name=A ordered=false flexible=true usage=optional
   structure name=B ordered=false flexible=true usage=optional
 value style=attribute name=name set-method=setValue 
 get-method=getValue usage=optional/
 value style=attribute name=key set-method=setValue 
 get-method=getValue usage=optional/
   /structure
 /structure

 Note that I've used 2 value elements calling the same accessors and set
 them both to optional.

 The issue is that when I run for file 1 my property is set to null, when I
 run for file 2 my property is set correctly (foo).

 My guess is that jibx is calling both of these value elements even though
 the attributes are set at optional. Is this a bug in jibx? Am I doing
 something wrong?

 Any ideas would be greatly appreciated. Thanks.


 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics
 Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Getting expected start tag error when unmarshalling unformatted xml

2013-08-27 Thread Archie Cobbs
I have no idea what is wrong, but that is weird.

Just out of curiosity, I wonder if it has to do with the fact that Ogz is a
prefix of OgzNr ?

Try the same test with OgzNr replaced with Foo...

-Archie


On Tue, Aug 27, 2013 at 7:58 PM, njmuni . limow...@gmail.com wrote:

 I'm getting this error:

 Exception in thread main org.jibx.runtime.JiBXException: Expected
 Ogz start tag, found OgzNr start tag (line 1, col 38)
 at
 org.jibx.runtime.impl.UnmarshallingContext.throwStartTagNameError(UnmarshallingContext.java:220)
 at
 org.jibx.runtime.impl.UnmarshallingContext.matchStart(UnmarshallingContext.java:644)
 at
 org.jibx.runtime.impl.UnmarshallingContext.parsePastStartTag(UnmarshallingContext.java:680)
 at
 com.ups.ops.gio.vo.GioOgzVo.JiBX_binding_unmarshal_1_0(GioOgzVo.java)
 at com.ups.ops.gio.vo.JiBX_bindingGioOgzVo_access.unmarshal()
 at
 com.ups.ops.gio.vo.GioCurLocGrpVo.JiBX_binding_unmarshal_1_0(GioCurLocGrpVo.java)
 at
 com.ups.ops.gio.vo.GioShuCompositeVo.JiBX_binding_unmarshal_1_0(GioShuCompositeVo.java)
 at
 com.ups.ops.gio.vo.JiBX_bindingGioShuCompositeVo_access.unmarshal()
 at
 org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
 at
 org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2914)

 When I try to unmarshal this XML (all one line):


 UpsBasDbCurLocGrpLocOgzOgzNr3229/OgzNrCnyCnyCdUS/CnyCd/Cny/Ogz/LocTs2012-09-28T00:20:32.000-04:00/Ts/CurLocGrp/UpsBasDb

 However, if I pass the same XML formatted with newlines, it works!

 UpsBasDb
CurLocGrp
   Loc
  Ogz
 OgzNr3229/OgzNr
 Cny
CnyCdUS/CnyCd
 /Cny
  /Ogz
   /Loc
   Ts2012-09-28T00:20:32.000-04:00/Ts
/CurLocGrp
 /UpsBasDb

 Here is the binding.xml file:

 binding package=com.ups.ops.gio.vo
   mapping name=UpsBasDb class=com.ups.ops.gio.vo.GioShuCompositeVo

 structure field=orgLocGrp usage=optional/

 structure name=CurLocGrp field=curLocGrp usage=optional
   structure name=Loc
 structure field=ogz type=com.ups.ops.gio.vo.GioOgzVo /
   /structure
   value name=Ts field=udtTs/
 /structure

   /mapping

   mapping name=OrgLocGrp class=com.ups.ops.gio.vo.GioOrgLocGrpVo
 extends=com.ups.ops.gio.vo.GioOgzVo
 structure map-as=com.ups.ops.gio.vo.GioOgzVo/
 structure name=TptDtTm
   value name=DtTmVlu field=shuPuDt usage=optional/
 /structure
 value name=Ts field=udtTs/
   /mapping

   mapping class=com.ups.ops.gio.vo.GioOgzVo abstract=true
 structure name=Ogz
   value name=OgzNr field=ogzNr/
   structure name=Cny
 value name=CnyCd field=cnyCd/
   /structure
   structure name=Fac usage=optional
 structure name=FacCny usage=optional
   structure name=CnyCd usage=optional/
 /structure
 value name=FacMnm field=facMnm usage=optional/
 value name=FacLocNr field=facLocNr usage=optional/
 value name=InBdgLocNr field=inBdgLocNr usage=optional/
   /structure
 /structure
 structure name=Srt usage=optional
   structure name=SrtCgy usage=optional
 value name=Cd field=srtTypCd usage=optional/
   /structure
 /structure
   /mapping
 /binding


 --
 Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
 Discover the easy way to master current and previous Microsoft technologies
 and advance your career. Get an incredible 1,500+ hours of step-by-step
 tutorial videos with LearnDevNow. Subscribe today and save!
 http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Maps

2013-07-22 Thread Archie Cobbs
You can't use put as an add method because the add method must take only
one argument.

But the larger issue is that JiBX doesn't support Maps out of the box.

FYI I wrote a helper class to facilitate solving this problem... see
MapEntry.javahttp://dellroad-stuff.googlecode.com/svn/trunk/publish/reports/javadoc/index.html?org/dellroad/stuff/jibx/MapEntry.html.
Basically you trick JiBX into thinking each key-value pair is an element in
a collection.

-Archie

On Mon, Jul 22, 2013 at 11:43 AM, Furst, Carl carl.fu...@mlb.com wrote:

 So I'm trying to marshal/unmarshal a HashMap and I get the following error
 when I compile the jibx xml:

 Error: add-method put not found in class java.util.Map; on collection
 element at (line 12, col 283, in DepthChart.xml)


 Which we know it is. If I take out the add-method declaration, it throws
 another error saying I need an add-method or store-method.

 Any ideas as to what I'm doing wrong?

 I'm using Jibx 1.1 and I'm guessing that Jibx doesn't support the use of
 Maps? I noticed that you needed extra jars for this.

 Is that correct? If so, I suggest you put something explicit in your docs.
 For there is nothing that says Jibx does not support Maps. Only that it
 does support Collections (which I think a Map would be such a thing).

 Many thanks,
 Carl Furst






 **

 MLB.com: Where Baseball is Always On



 --
 See everything from the browser to the database with AppDynamics
 Get end-to-end visibility with application monitoring from AppDynamics
 Isolate bottlenecks and diagnose root cause in seconds.
 Start your free trial of AppDynamics Pro today!
 http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Mutually exclusive tags

2013-05-17 Thread Archie Cobbs
On Thu, May 16, 2013 at 8:50 AM, John Smith java.dev@gmail.com wrote:

 In the XML I can either have only SomeCCCard1 or SomeCCCard2 but Jibx
 throws...


Try removing name=details.


 Also is there a way to simplify the binding for this case I have up to 20
 different mutually exclusive cards so SomeCCCard3, SomeCCCard4,
 SomeCCCard5. So the whole xml is the same except for that unfortunate tag.
 Beats me why it's not an attribute. Would have been so much simpler.


Putting all the various tags inside a single structure with each having
usage=optional like you were doing ought to work.


 You said I should do an XSl transform? Would that not be slow? And
 pointless of putting before Jibx?


It's just another option. It's up to you to evaluate it for your particular
circumstances.

-Archie

-- 
Archie L. Cobbs
--
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Parent Node that changes but only require read of child nodes.

2013-05-14 Thread Archie Cobbs
You could create a bunch of fake bean properties with corresponding names
that all set the underlying real property accordingly.

Alternately, insert an XSL transform in the pipeline that would get applied
prior to JiBX seeing the XML.

-Archie

On Tue, May 14, 2013 at 12:00 PM, John Smith java.dev@gmail.com wrote:

 This is the DTD I'm trying to accommodate

 !ELEMENT someNode  ( (ABC | DEF | GHI | JKL | MNO | - There's about
 twenty of these which represent pretty much the same object. No clue why
 this was done, but I'm stuck with it. I wish I could just ignore but I need
 to remember this value.

  (cardNumber, expiryDate, cardHolderName,
  (cvc | issueNumber | startDate)?,
  ?) |

  (, ?)
 ), ?, ?, ? )


 On Tue, May 14, 2013 at 9:44 AM, John Smith java.dev@gmail.comwrote:

 So I'm in the process of painfully taking one XML format
 and basically flatening it to have one main root node and all the elements
 under it.

 I have the following fragment


 parent-mc
 cardNumber1234567890/cardNumber
 /parent-mc

 parent-vi
 cardNumber1234567890/cardNumber
 /parent-vi



 What this tells us is that the cardNumber is of type mc or of type vi

 The resulting model would

 root
 typecredit card/type
 acctNumber12354567890/acctNumber
 /root

 I suspect more unmarshaller stuff right? :P

 How would the binding for this look? I mean I know how to declare the
 unmarshaller based on your example. But how would I deal with declaring the
 different parent tags?

 I also realized that I need to keep parent-mc and parent-vi in a separate
 field so when I return back to the client I return back the right tag.




 --
 AlienVault Unified Security Management (USM) platform delivers complete
 security visibility with the essential security capabilities. Easily and
 efficiently configure, manage, and operate all of your security controls
 from a single console and one unified framework. Download a free trial.
 http://p.sf.net/sfu/alienvault_d2d
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] DomElementMapper deleting comments?

2012-09-06 Thread Archie Cobbs
For anyone interested...

I figured out the problem. This is not a JiBX bug but rather a bug in
Spring's JibxMarshaller adapter class.

See https://jira.springsource.org/browse/SPR-9768 for details.

-Archie

On Sat, Aug 4, 2012 at 8:56 AM, Archie Cobbs arc...@dellroad.org wrote:

 I'm using the DomElementMapper to read/write a nested XSLT document
 contained in a larger XML document.

 This works OK, except that the DomElementMapper is deleting all the
 comments. That is, if I unmarshall and then marshall an XML document, all
 the comments that were in the nested XSL are gone.

 Is there some easy way to work around this problem?

 Thanks,
 -Archie

 --
 Archie L. Cobbs




-- 
Archie L. Cobbs
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Binding files are input or output?

2012-08-09 Thread Archie Cobbs
On Thu, Aug 9, 2012 at 11:35 AM, Alan Evangelista ala...@linux.vnet.ibm.com
 wrote:

 In the documentation, I read that codegen generates a binding file and a
 Java source file from a schema (xsd) file. If the binding file is used
 to define the mapping between xsd attributes and elements to Java
 classes, shouldn't it be created manually by the user and used as input
 in the process?


If you want to generate the binding file manually, then don't use an
automated tool :)


 Also, why would I want the binding file as output? I just want the
 output Java source file and put it together with my manually written
 Java source files. I know Jibx uses bytecode enhancement; are the output
 binding files used somehow during compilation / runtime to perform this
 bytecode enhancement? Could I discard these binding files?


The binding files tell JiBX how to map between Java and XML. They are
required for binding but not at runtime.

JiBX is essentially a black box that takes a binding file and Java class
files and outputs modified Java class files that support the JiBX API for
marshalling/unmarshalling.

The other stuff like schemagen, etc. are just additional tools used at
build time. But the ultimate and most important event is the binding
process.

-Archie

-- 
Archie L. Cobbs
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[jibx-users] DomElementMapper deleting comments?

2012-08-04 Thread Archie Cobbs
I'm using the DomElementMapper to read/write a nested XSLT document
contained in a larger XML document.

This works OK, except that the DomElementMapper is deleting all the
comments. That is, if I unmarshall and then marshall an XML document, all
the comments that were in the nested XSL are gone.

Is there some easy way to work around this problem?

Thanks,
-Archie

-- 
Archie L. Cobbs
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] How to unmarshall using JiBX and not use XSD?

2012-06-08 Thread Archie Cobbs
In my opinion XSDs are useless. 99% of the time validation must be
performed in Java anyway, so why bother?

For Java validation, JSR 303 validation works just fine.

By the way JiBX has a bug and/or feature where it ignores unknown
attributes, and there's no way to turn it off. In your case, this sounds
like a feature :)

-Archie

On Fri, Jun 8, 2012 at 4:28 AM, Po Mario mr.poma...@gmail.com wrote:

 I want to use JiBX to unmarshall huge XML files, but I don't want it to
 validate against the XSD. How do I do this?

 Proof of concept (jUnit snippet that works for XMLs compliant against the
 XSD):

 IBindingFactory bfact = BindingDirectory.getFactory(Customer.class);
 IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
 Customer customer = (Customer) uctx.unmarshalDocument(new
 FileInputStream(fileLocation), null);

 Why do I need this? I have a RESTful service that allows users to upload
 humongous XML files. Castor proved to be too slow for the job and I am now
 in the process of re-writing things in JiBX. Though, I know from experience
 that users will sometimes upload files that are 99.9% processable, but one
 extra XML attribute in an element will render the whole XML incorrect
 instead of just that element. I would still like to unmarshall all that I
 can in memory and do my validations manually.

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Where to report Errors in Jibx

2012-05-08 Thread Archie Cobbs
Smells like JIBX-465 http://jira.codehaus.org/browse/JIBX-465...

-Archie

On Tue, May 8, 2012 at 7:04 AM, Rajesh Khan rajeshkhan...@gmail.com wrote:

 So i am convinced that there is an error in jibx no matter what i do I get
 the following error

 C:\jibx\tutorial\example26java -cp
 c:\jibx\lib\jibx-run.jar;C:\jibx\tutorial; o
 rg.jibx.sampleschema.person.Test
 Start
 Exception in thread main java.lang.VerifyError: Expecting a stackmap
 frame at
 branch target 12 in method
 org.jibx.sampleschema.person.Person.JiBX_binding_newi

 nstance_1_0(Lorg/jibx/sampleschema/person/Person;Lorg/jibx/runtime/impl/Unmarsha
 llingContext;)Lorg/jibx/sampleschema/person/Person; at offset 1
 at java.lang.Class.getDeclaredFields0(Native Method)
 at java.lang.Class.privateGetDeclaredFields(Unknown Source)
 at java.lang.Class.getDeclaredField(Unknown Source)
 at
 org.jibx.runtime.BindingDirectory.getBindingList(BindingDirectory.jav
 a:68)
 at
 org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:21
 1)
 at org.jibx.sampleschema.person.Test.main(Test.java:27)



 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Simple Container (nested) tag requirement

2012-02-02 Thread Archie Cobbs
On Thu, Feb 2, 2012 at 11:36 AM, Syd Davenport findme...@gmail.com wrote:

 Here is my sample XML file

  person

 nameJohn/name

 address

streetEl Camino/street

citySan Jose/city

 /address

 /person



 My class:

 public class Peson {

 String name;

 String street;

 String city;

 }


Try something like this:

mapping name=person class=com.model.Person ordered=false
value name=name field=name/
structure name=Address
   value name=street field=street/
   value name=city field=city/
/structure
/mapping

-Archie
-- 
Archie L. Cobbs
--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] How to: abstract mappings with interface implementations?

2012-02-01 Thread Archie Cobbs
The terminology is confusing.

A JiBX abstract mapping is just like a macro that declares a bunch of
structure fields without declaring the name of the containing XML element.
Give it a type-name and then dereference it elsewhere with map-as.

The JiBX extends keywords simply means member of a substitution group,
i.e., anywhere the thing you extend can appear, the extending thing may
appear. Extending can only be done with concrete mappings however because
the XML element name is used to determine which of the possible choices to
apply when unmarshalling.

So you don't really need abstract mappings unless you want to save
keystrokes in your binding file. Try something like this:

mapping abstract=true class=my.pack.I/

mapping name=Bbb class=my.pack.B extends=my.pack.I
value name=LdapName field=s1 /
/mapping

mapping name=Ccc class=my.pack.C extends=my.pack.I
value name=IdentPart1 field=s2 /
value name=IdentPart2 field=s3 /
/mapping

mapping name=Aaaa type=my.pack.A
  structure get-method=getOne set-method=setOne/
/mapping

-Archie

On Wed, Feb 1, 2012 at 3:46 AM, Dave Schoorl dscho...@bkwi.nl wrote:

 Hello group,

 I am new to JiBX and I have a set of given schemas and a given domain
 model. I am writing binding files by hand. I am running into the situation
 that I have an interface I with two implementations, class B and class C.
 The bindings for B and C need to be abstract, because they are types.
 Imagine class A that has multiple fields of type I. I have created the
 following binding file:

 binding
 mapping abstract=true class=my.pack.I /

 mapping abstract=true class=my.pack.B extends=my.pack.I
 value name=LdapName field=s1 /
 /mapping

 mapping abstract=true class=my.pack.C extends=my.pack.I
 value name=IdentPart1 field=s2 /
 value name=IdentPart2 field=s3 /
 /mapping

 mapping name=Aaaa class=my.pack.A
 structure name=Identifier1 get-method=getOne set-method=
 setOne /
 structure name=Identifier2 get-method=getTwo set-method=
 setTwo usage=optional/
 /mapping
 /binding

 but compiling the binding into the Java classes first results in the
 following warning for mapping of class B and C:
  Warning: Only concrete mappings should be 'leaf' mappings for
 extensions; you should either remove 'extends' attribute or add concrete
 extension mappings for this abstract mapping;

 followed by the following error for each structure mapping in class A:
  Error: name attribute not allowed on reference to mapping with
 extensions;


 When I change the above binding file and remove the mapping of I and the
 'extends'-attribute on the mapping of classes B and C, then the binding
 gets compiled without errors, but when I want to unmarshall an xml file, I
 get the following exception:

 org.jibx.runtime.JiBXException: Cannot create instance of interface or
 abstract class my.pack.I
 at
 my.pack.JiBX_binding_AInterfaceMungeAdapter.JiBX_binding_multiple_I_newinstance_1_0()
  at my.pack.A.JiBX_binding_multiple_I_unmarshal_1_0(A.java)
 at my.pack.JiBX_binding_multiple_IA_access.unmarshal()
  at
 org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
 at
 org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2900)
  at
 my.pack.ADatabindingTest.testUnmarshallAInterface(ADatabindingTest.java:24)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
 at
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
  at
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
  at
 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
 at
 org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
  at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
 at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
  at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
 at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  at
 

Re: [jibx-users] Splitting JIBX compile across two classes CORRECTION - two Projects

2012-02-01 Thread Archie Cobbs
One idea...

Try defining abstract bindings for everything in the library, and then
including the abstract binding files (Foo.xml, Bar.xml, etc.) in your
library JAR file. Then don't do any JiBX binding when building the library.
Only do it during the WAR build. You'll have to extract the Foo.xml files
out of the library JAR, so you can then include them during your WAR build
from your WAR build binding files that define your concrete mappings.

-Archie

On Wed, Feb 1, 2012 at 4:27 PM, Alan Chaney a...@mechnicality.com wrote:

 Sorry, just noticed that the topic is wrong - it should be Splitting
 JIBX compile across two projects


 Hi

 I've been working until recently with one project which had a set of
 sources and a jibx binding file. This project was a web application and
 when preparing the war for distribution on my CI server I was simply
 running the jibx compiler with Ant and making sure that the resulting
 class files were put into the WEB-INF/classes folder.

 Recently, I moved some classes which are referenced in the jibx compile
 to another project which is a library project for the first project.

 When I'm in Eclipse its fine, but when I try and build a jar on the CI
 server from the library project to be used by the web app project of
 course it fails because the generated classes aren't in the library jar
 and I can't generate them because the binding file is in the web app
 project. This works in Eclipse because the file structure is not wrapped
 into the jar.

 Any suggestions on how I can split my projects such that some of the
 classes to be processed by JIBX are in a jar of one project and the
 others in a war of another project?

 I should add that the reason why I've split them is that other projects
 are needing to use my library classes and including the web app war as
 part of the classpath of those other projects would be a horrible hack.

 Thanks

 Alan Chaney



 --
 Keep Your Developer Skills Current with LearnDevNow!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-d2d
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Splitting JIBX compile across two classes CORRECTION - two Projects

2012-02-01 Thread Archie Cobbs
See also http://jibx.sourceforge.net/binding/precompiled.html

I've never used pre-compiled bindings but it sounds like it might be useful.

-AC

On Wed, Feb 1, 2012 at 5:09 PM, Alan Chaney a...@mechnicality.com wrote:

  Thanks Archie,

 I'll think about that one...

 I'm also considering the obvious solution of moving all the files which
 are relevant to a given jibx binding file into the same project - still its
 a pity that there isn't some kind of deferred binding solution. Just
 wondered how other people had handled this problem.


 Regards

 Alan



 On 2/1/2012 2:57 PM, Archie Cobbs wrote:

 One idea...

 Try defining abstract bindings for everything in the library, and then
 including the abstract binding files (Foo.xml, Bar.xml, etc.) in your
 library JAR file. Then don't do any JiBX binding when building the library.
 Only do it during the WAR build. You'll have to extract the Foo.xml files
 out of the library JAR, so you can then include them during your WAR build
 from your WAR build binding files that define your concrete mappings.

 -Archie

 On Wed, Feb 1, 2012 at 4:27 PM, Alan Chaney a...@mechnicality.com wrote:

 Sorry, just noticed that the topic is wrong - it should be Splitting
 JIBX compile across two projects


 Hi

 I've been working until recently with one project which had a set of
 sources and a jibx binding file. This project was a web application and
 when preparing the war for distribution on my CI server I was simply
 running the jibx compiler with Ant and making sure that the resulting
 class files were put into the WEB-INF/classes folder.

 Recently, I moved some classes which are referenced in the jibx compile
 to another project which is a library project for the first project.

 When I'm in Eclipse its fine, but when I try and build a jar on the CI
 server from the library project to be used by the web app project of
 course it fails because the generated classes aren't in the library jar
 and I can't generate them because the binding file is in the web app
 project. This works in Eclipse because the file structure is not wrapped
 into the jar.

 Any suggestions on how I can split my projects such that some of the
 classes to be processed by JIBX are in a jar of one project and the
 others in a war of another project?

 I should add that the reason why I've split them is that other projects
 are needing to use my library classes and including the web app war as
 part of the classpath of those other projects would be a horrible hack.

 Thanks

 Alan Chaney



 --
 Keep Your Developer Skills Current with LearnDevNow!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-d2d
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




 --
 Archie L. Cobbs



 --
 Keep Your Developer Skills Current with LearnDevNow!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe 
 now!http://p.sf.net/sfu/learndevnow-d2d



 ___
 jibx-users mailing 
 listjibx-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/jibx-users




 --
 Keep Your Developer Skills Current with LearnDevNow!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-d2d
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[jibx-users] JiBX allowing random attributes?

2011-08-24 Thread Archie Cobbs
I just noticed that JiBX is allowing arbitrary attributes in the input that
I'm using. This is surprising because I've been using JiBX for years and
never noticed this...

For example, with this binding:

binding name=binding
mapping name=test class=Test
value name=name field=name/
collection name=strings field=strings
create-type=java.util.ArrayList
value name=string type=java.lang.String/
/collection
/mapping
/binding

JiBX is allowing this input:

test
name *blah=blah*fred/name
strings
stringstring1/string
string *foobar=asdf*string2/string
stringstring3/string
/strings
/test

I must be missing something... how do I prevent JiBX from allowing arbitrary
attributes like *blah* and *foobar* above?

This happens with JiBX 1.2.2 and 1.2.3.

Thanks,
-Archie

-- 
Archie L. Cobbs
--
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Mapping help

2011-08-16 Thread Archie Cobbs
Sounds like a run-of-the-mill parse error, but impossible to tell without
seeing your binding.xml.

Does your binding allow the individualName tag (in the correct namespace -
easy mistake to make) to nest inside responsibleParty?

-Archie

On Tue, Aug 16, 2011 at 8:50 PM, Nathan Wilhelmi wilhe...@ucar.edu wrote:

 Hello,

 We are trying to see if we can use JIBX to simply our XML parsing and
 running into a few problems. JIBX fails to process our xsd so we are
 trying to write the mapping files by hand.

 I am running into the following exception when trying to unmarshall the
 XML:

 org.jibx.runtime.JiBXException: Expected
 {http://www.purl.org/org/esmetadata/cim/1.5/schemas}responsibleParty;
 end tag, found {http://www.isotc211.org/2005/gmd}individualName; start
 tag (line 13672, col 27)
at

 org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(UnmarshallingContext.java:731)
at

 sgf.cim.repository.impl.jibx.model.SimulationRun.JiBX_cim_new_unmarshal_1_1(SimulationRun.java)
at

 Any suggestions if this is possible and what I need to change in the
 mapping file?

 Thank you for your time!

 -Nate


 XML

 CIMDocumentSet xmlns:gml=http://www.opengis.net/gml/3.2;
xmlns:xlink=http://www.w3.org/1999/xlink;
xmlns:gco=http://www.isotc211.org/2005/gco;
xmlns:gmd=http://www.isotc211.org/2005/gmd;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns=http://www.purl.org/org/esmetadata/cim/1.5/schemas;
xsi:schemaLocation=
 http://www.purl.org/org/esmetadata/cim/1.5/schemas/cim.xsd;

   simulationRun
 responsibleParty
   gmd:individualName
 gco:CharacterStringSomeones name/gco:CharacterString
   /gmd:individualName

 /responsibleParty
 shortNameshortName/shortName
 longNameReally long name/longName
 descriptionA nice description of the simulation/description
   /simulationRun
 /CIMDocumentSet

 Java Class Structure

 public class SimulationRun {

public String shortName;
public String longName;

public ArrayListResponsibleParty resposibleParties;
 }

 public class ResponsibleParty {

public String indName;
 }
 JIBX mapping file

 binding trim-whitespace=true

namespace uri=http://www.purl.org/org/esmetadata/cim/1.5/schemas;
 default=all prefix= /
namespace uri=http://www.isotc211.org/2005/gmd; prefix=gmd /
namespace uri=http://www.isotc211.org/2005/gco; prefix=gco /

   mapping name=CIMDocumentSet
 class=sgf.cim.repository.impl.jibx.model.DocumentSet ordered=false
 flexible=true 

structure name=simulationRun
 class=sgf.cim.repository.impl.jibx.model.SimulationRun
 field=simulationRun ordered=false flexible=true 
value name=shortName field=shortName /
value name=longName field=longName /

collection name=responsibleParty
 field=resposibleParties 
  structure name=responsibleParty
 type=sgf.cim.repository.impl.jibx.model.ResponsibleParty
 ordered=false flexible=true 
structure name=gmd:individualName ordered=false
 flexible=true 
value name=gco:CharacterString
 field=indName  /
/structure
 /structure
/collection

/structure

   /mapping
 /binding





 --
 Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
 user administration capabilities and model configuration. Take
 the hassle out of deploying and managing Subversion and the
 tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Cloning JiBX git repository fails

2011-06-05 Thread Archie Cobbs
FWIW, I did a couple of quick tests and was able to successfully git clone
from that URL on both Linux and Mac OS X.

-Archie

On Sun, Jun 5, 2011 at 6:47 AM, Stevo Slavić ssla...@gmail.com wrote:

 Hello JiBX users,

 Cloning JiBX repo ( git://jibx.git.sourceforge.net/gitroot/jibx/jibx )
 fails with error [1]. I'm using egit 0.12.1, eclipse 3.6 SR2 (build
 20110218-0911), Sun/Oracle JDK 1.6 update 25 x64, Windows 7 x64.

 Can anybody reproduce this?

 Not sure if I'm doing something wrong, is repo invalid, or a bug in
 egit/jgit is causing this. There seems to be related issue with git 
 dropbox ( http://forums.dropbox.com/topic.php?id=12246 ) - some
 committer using dropbox to host local repo?

 Regards,
 Stevo.


 [1] Jibx repo clone error.
 !ENTRY org.eclipse.egit.ui 4 0 2011-06-05 13:27:41.172
 !MESSAGE Could not delete file C:\Users\s.slavic\jibx\.git\index.lock
 !STACK 0
 java.io.IOException: Could not delete file
 C:\Users\s.slavic\jibx\.git\index.lock
at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:134)
at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:119)
at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:119)
at
 org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:150)
at
 org.eclipse.egit.ui.internal.clone.GitCloneWizard.executeCloneOperation(GitCloneWizard.java:291)
at
 org.eclipse.egit.ui.internal.clone.GitCloneWizard.access$3(GitCloneWizard.java:284)
at
 org.eclipse.egit.ui.internal.clone.GitCloneWizard$5.run(GitCloneWizard.java:265)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


 --
 Simplify data backup and recovery for your virtual environment with
 vRanger.
 Installation's a snap, and flexible recovery options mean your data is
 safe,
 secure and there when you need it. Discover what all the cheering's about.
 Get your free trial download today.
 http://p.sf.net/sfu/quest-dev2dev2
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 ___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Restrictions on multiple mappings

2011-05-19 Thread Archie Cobbs
But the object types are not the same:

   1. com.myapp.mtpersister.domain.RouterMessage
   2. com.air2web.mtpersister.domain.RouterMessage

-Archie

On Thu, May 19, 2011 at 8:58 AM, Mark Grizzaffi
mark.grizza...@air2web.comwrote:

  I'm looking at an existing binding.xml that I did not originally write.
 There are multiple mappings with the same class name. For
 example


 mapping abstract=true type-name=md:routerMessage class=com.myapp
 .mtpersister.domain.RouterMessage

 .

 .

 .

 /mapping

 mapping class=com.air2web.mtpersister.domain.RouterMessage name=router-
 *api*

 structure map-as=md:routerMessage /

 /mapping
 The documentation states...

 *mapping* elements are subject to the restriction that multiple mappings
 with the same object type cannot be defined in the same context.

 Does the above example violate this rule and if so what error message(s)
 should I expect, if any?

 Thanks



 --
 What Every C/C++ and Fortran developer Should Know!
 Read this article and learn how Intel has extended the reach of its
 next-generation tools to help Windows* and Linux* C/C++ and Fortran
 developers boost performance applications - including clusters.
 http://p.sf.net/sfu/intel-dev2devmay
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Binding direction problem

2011-04-01 Thread Archie Cobbs
On Fri, Apr 1, 2011 at 7:32 AM, Voß, Marko marko.v...@fiz-karlsruhe.dewrote:

  So I guess JiBX will overwrite the values for the BindingFactory for a
 specific binding name.



 I would have expected JiBX to add the input bindings of binding name
 FORMAT_1 to the already compiled output bindings of binding name FORMAT_1
 but that is not happening.



 Does anyone has any clue, how to create a workaround for this? Is this a
 known issue?


I think bindings are compiled all at once, i.e., you can't do incremental
binding like you are trying to do.

So you can either combine your input and output bindings into a single
binding (if possible), or just give them different names.

-Archie

-- 
Archie L. Cobbs
--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[jibx-users] Optional elements always being set to zero/null ?

2011-03-29 Thread Archie Cobbs
I have a JiBX mapping for a serial port that looks like this:

mapping abstract=true class=com.exampleSerialConfig
value name=baudRate get-method=getBaudRate
set-method=setBaudRate usage=optional/
...
 /mapping

The getBaudRate()/setBaudRate() methods take a value of type int.

I would expect that if the XML contained no baudRate element, then
setBaudRate() would not be invoked. The underlying Java class initializes
this property to 9600, so I would expect that to be the default value if not
specified.

However, event when there's no baudRate element JiBX is invoking
setBaudRate() with a value of zero!

Where is this zero coming from??

Similarly, in the case of object properties, JiBX is always setting the
value to null if there's no corresponding XML element.

Is this a bug or am I missing something?

Thanks,
-Archie

-- 
Archie L. Cobbs
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Optional elements always being set to zero/null ?

2011-03-29 Thread Archie Cobbs
Looking more at the docs, I guess this is working as designed.

However, this seems like sub-optimal behavior. I would expect JiBX to apply
a default value only if an explicit default=... attribute was provided.
Otherwise, there's no way to have the same non-zero/null default value apply
in both the Java and XML worlds without having to declare that default value
twice (which is error-prone and redundant).

-Archie

On Tue, Mar 29, 2011 at 2:55 PM, Archie Cobbs arc...@dellroad.org wrote:

 I have a JiBX mapping for a serial port that looks like this:

 mapping abstract=true class=com.exampleSerialConfig
 value name=baudRate get-method=getBaudRate
 set-method=setBaudRate usage=optional/
 ...
  /mapping

 The getBaudRate()/setBaudRate() methods take a value of type int.

 I would expect that if the XML contained no baudRate element, then
 setBaudRate() would not be invoked. The underlying Java class initializes
 this property to 9600, so I would expect that to be the default value if not
 specified.

 However, event when there's no baudRate element JiBX is invoking
 setBaudRate() with a value of zero!

 Where is this zero coming from??

 Similarly, in the case of object properties, JiBX is always setting the
 value to null if there's no corresponding XML element.

 Is this a bug or am I missing something?

 Thanks,
 -Archie

 --
 Archie L. Cobbs




-- 
Archie L. Cobbs
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Optional elements always being set to zero/null ?

2011-03-29 Thread Archie Cobbs
FYI, I filed a bug: http://jira.codehaus.org/browse/JIBX-433

-Archie

On Tue, Mar 29, 2011 at 3:10 PM, Archie Cobbs arc...@dellroad.org wrote:

 Looking more at the docs, I guess this is working as designed.

 However, this seems like sub-optimal behavior. I would expect JiBX to apply
 a default value only if an explicit default=... attribute was provided.
 Otherwise, there's no way to have the same non-zero/null default value apply
 in both the Java and XML worlds without having to declare that default value
 twice (which is error-prone and redundant).

 -Archie


 On Tue, Mar 29, 2011 at 2:55 PM, Archie Cobbs arc...@dellroad.org wrote:

 I have a JiBX mapping for a serial port that looks like this:

 mapping abstract=true class=com.exampleSerialConfig
 value name=baudRate get-method=getBaudRate
 set-method=setBaudRate usage=optional/
 ...
  /mapping

 The getBaudRate()/setBaudRate() methods take a value of type int.

 I would expect that if the XML contained no baudRate element, then
 setBaudRate() would not be invoked. The underlying Java class initializes
 this property to 9600, so I would expect that to be the default value if not
 specified.

 However, event when there's no baudRate element JiBX is invoking
 setBaudRate() with a value of zero!

 Where is this zero coming from??

 Similarly, in the case of object properties, JiBX is always setting the
 value to null if there's no corresponding XML element.

 Is this a bug or am I missing something?

 Thanks,
 -Archie

 --
 Archie L. Cobbs




 --
 Archie L. Cobbs




-- 
Archie L. Cobbs
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] extends=type-name ?

2011-03-16 Thread Archie Cobbs
On Tue, Mar 15, 2011 at 10:28 PM, Dennis Sosnoski d...@sosnoski.com wrote:

  First, there doesn't seem to be any reason why you can't use type-names
 with substitution groups (i.e., extends=typename). This seems like a
 relatively simple limitation that could be fixed in the JiBX parsing engine.
 In other words, you should be able to do this:

 mapping abstract=true class=com.example.Vehicle type-name=vehicle
 mapping class=com.example.Car name=Car extends=vehicle
  mapping class=com.example.Truck name=Truck extends=vehicle


 True in principle, but if you're modeling substitution groups you still
 need a name attached to the base mapping.


I don't understand what you're saying... isn't vehicle just as good a name
as com.example.Vehicle? Obviously I'm still missing something.




 Next issue: requiring concrete mappings with substitution groups. With
 substitution groups, somewhere you have to specify the set of valid XML tags
 (and corresponding Java classes) that are allowed for the group. Call this
 the group specification'. With the current JiBX, the concrete mappings
 implicitly provide the group specification -- and I'm guessing that's
 probably the main reason why they are required.

 But it might be simpler and more modular if the group specification was
 declared explicitly at the point of use. This would then allow us to relax
 the requirement for concrete mappings. For example:

  mapping abstract=true class=com.example.Vehicle type-name=vehicle
 mapping abstract=true class=com.example.Car type-name=car
 extends=vehicle
 mapping abstract=true class=com.example.Truck type-name=truck
 extends=vehicle
 ...
 mapping abstract=true class=com.example.FooBar type-name=fooBar
 structure field=vehicle
 mapping-option name=Car map-as=Car/
 mapping-option name=Truck map-as=Trunk/
 /structure
 ...

 What I like about this is that it's much clearer from looking at the
 mapping file what can happen. This also could even be implemented so that it
 was backward compatible with existing mapping files.


 Here again, if you're modeling substitution groups each element in the
 group must be declared as a global element in the schema definition. So
 although it would be possible to have a binding definition separately
 declare the element names you'd still need a global mapping for each one.
 There's also the issue that substitution groups may involve multiple levels
 of definitions. But the biggest objection I'd have to this approach is that
 you'd need to duplicate the whole structure anywhere you used a Vehicle
 reference. Given these issues, I'm not convinced it'd be worth the effort
 the change from the current approach where the names and the substitution
 group relationship are both declared in the mapping.


I agree about the duplication problem...

But I think the desire to synchronize JiBX mapping files with XSD structure
is in fact what adds complexity (and confusion), at least in the current
incarnation. I suppose it's a good goal overall, but if so then there is
probably a clearer way to do it. For example, why not define the
substitution group explicitly, all in one place using a substitution-gropu
element, and then reference it by name when needed, instead having it
implicitly defined by the individual mapping elements.

But more generally, requiring that anything expressible using a JiBX mapping
be also expressible via XSD seems like an unfortunate limitation. E.g., you
could instead just have a rule of the form if you want to generate an XSD
file, you are limited to these rules/constructs in your JiBX mapping file.
In other words the fact that XSD requires substitution groups to be
top-level is just kindof dumb, but if I'm not generating an XSD file, it
shouldn't cause me to have to make all my mapping's global, etc.

-Archie

-- 
Archie L. Cobbs
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] extends=type-name ?

2011-03-12 Thread Archie Cobbs
Thanks Dennis. That all makes sense... however I still am confused about the
right approach is for doing what I want to do.

In my particular application I have a Java class hierarchy and am modeling
it in XML pretty much directly using JiBX. Classes correspond pretty much to
XML elements. For each class, for example FooBar.java I create an abstract
mapping

 include path=janFoo.xml/
mapping abstract=true type-name=fooBar class=com.example.FooBar

value name=color field=color/
structure name=JanFoo field=janFoo map-as=janFoo/
...
/mapping

 in a separate file fooBar.xml.

The problem comes in a situation where FooBar has a Vehicle property where
Vehicle is abstract .. e.g. I have these classes:

abstract class Vehicle
class Car extends Vehicle
class Truck extends Vehicle

So the vehicle property is always a Car or a Truck and in XML should appear
as either a Car or Truck element.

I want to do something like this but can't figure out exactly how:

include path=vehicle.xml/
 mapping abstract=true type-name=fooBar class=com.example.FooBar

value name=color field=color/
structure field=vehicle map-as=vehicle/   !-- name=Car or
name=Truck ?? --
...
/mapping

How would I model this property like the example above in without using
extends and yet still use type-names to reference all my mappings instead of
class names?

What I end up having to do is making special cases for all these cases where

   - Must define concrete mappings, whereas all other structures (except the
   topmost one) can have abstract mappings
   - Can't use type-name, have to use class name and extends

This messes up the nice modularity of the abstract-mapping-per-Java-class
approach.

Thanks,
-Archie


On Fri, Mar 11, 2011 at 8:49 PM, Dennis Sosnoski d...@sosnoski.com wrote:

  Hi Archie,

 The extends attribute is mostly just a left-over from the earlier days of
 JiBX. The only time it's important is when you're using substitution groups
 in your XML documents (which allow you to substitute an extension element
 for a base element in a document - such as vehicle for the base element,
 automobile for the extension) - and since substitution groups are made of
 elements it makes sense to require a class with a concrete mapping as the
 base.

 I personally think substitution groups are the best way of handling
 polymorphism in XML documents, since the element name tells you the
 structure. The alternative of type substitution, where you keep the same
 element name and just add an xsi:type attribute to say what you're really
 doing, seems kludgy to me.

 In terms of the mappings, just using structure map-as=.../ gives you
 the equivalent of type extension. Though it's not a direct equivalent of
 schema type extension, since it allows you to reference the base type
 anywhere within the structure of the extension (so really a combination of
 schema type extension, group references, and attributeGroup references).

   - Dennis

 Dennis M. Sosnoski
 Java SOA and Web Services Consultinghttp://www.sosnoski.com/consult.html
 Axis2/CXF/Metro SOA and Web Services 
 Traininghttp://www.sosnoski.com/training.html
 Web Services Jump-Start http://www.sosnoski.com/jumpstart.html

 On 03/11/2011 07:56 AM, Archie Cobbs wrote:

 I always get confused when trying to use the extends attribute...

 Here's a simple question: whereas map-as allows either a class name or a
 type name, extends only allows a class name. Why?

 As it stands now, there's no way to extend a mapping that has a type-name.

 Thanks,
 -Archie

 --
 Archie L. Cobbs


 --
 Colocation vs. Managed Hosting
 A question and answer guide to determining the best fit
 for your organization - today and in the 
 future.http://p.sf.net/sfu/internap-sfd2d


 ___
 jibx-users mailing 
 listjibx-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[jibx-users] extends=type-name ?

2011-03-10 Thread Archie Cobbs
I always get confused when trying to use the extends attribute...

Here's a simple question: whereas map-as allows either a class name or a
type name, extends only allows a class name. Why?

As it stands now, there's no way to extend a mapping that has a type-name.

Thanks,
-Archie

-- 
Archie L. Cobbs
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Anyone have a solution for JSR-303 validation?

2011-01-18 Thread Archie Cobbs
On Fri, Dec 31, 2010 at 10:54 AM, jcaristi jcari...@whisolutions.comwrote:

 We are using JiBX CodeGen to go from XML schema to Java for Axis2 web
 services. We code our XSD files with the appropriate constraints on each
 field. However, we are doing all of our request validation on the server
 side in Java. We want our validation logic to be executed in the business
 tier so we can provide precise, contextual, localized error coding and
 error
 messages on the response. For this we are using the Spring Validator
 framework, which really simplifies the task.

 One problem with this approach is that we have to code the constraints
 twice, once in the XSD and once in Java. This means that we also have to
 keep them in sync, which is hard.  Now that Spring supports JSR-303, we
 could eliminate the Java coding of basic validation by using annotations on
 our entity classes (example below). If these could be derived from our XML
 schema, it would be great!


I have a somewhat contrarian view, but IMHO this is a good example of why
XSD documents are basically useless. Invariably XML documents require
programmatic, runtime validation beyond what XSD provides. As I understand
things SOAP requires them; for me, that's a good reason to avoid SOAP (not
to mention most other products of Microsoft).

The pattern I end up following is: start with Java classes with JSR 303
annotations (including custom validators as necessary), create the
corresponding JiBX bindings, and validate at runtime simply by (a)
processing through JiBX and (b) running the result through the validator. If
it passes (a) and (b), you've got something that will work. Moreover,
there's no validation that can't be verified by some combination of (a) and
(b).

-Archie

-- 
Archie L. Cobbs
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Anyone have a solution for JSR-303 validation?

2011-01-18 Thread Archie Cobbs
On Mon, Jan 17, 2011 at 3:24 AM, Dennis Sosnoski d...@sosnoski.com wrote:

  I'd planned to support annotations for schema constraints at some point,
 and it shouldn't be a huge job to add them in. It would involve changes to
 the actual code generation, though, and could not be handled by simple
 extensions.

 I'm not sure that JSR-303 is my preferred implementation, either. As I
 understand it, it's based on using a Validator to check for constraint
 violations. That seems fundamentally flawed to me, I'd much rather see
 constraints enforced at the time values are set (immediate fail). If a value
 is supposed to be non-null, why should a set method support setting a null
 value? So although it would be nice to support generating JSR-303
 annotations, I'd prefer to generate smart set methods that forbid violating
 a constraint.


I think these are two different problems. The first thing you mention is
some kind of Java annotations which would translate into additional XSD
information during the JiBX Java - XSD generation step. This makes sense as
a nice feature to have in JiBX that would allow the developer to tighten up
the generated XSD.

However, JSR 303 annotations are solving a different, much more general
problem and are not really an appropriate technology to adopt for that
purpose. JSR 303 annotations can check things that are not expressible in
XSD. If you tried this, you would be stuck with only being able to translate
those few, simple annotations that can be directly translated.

-Archie

-- 
Archie L. Cobbs
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Q: Replacing with gt; automatically?

2011-01-06 Thread Archie Cobbs
On Wed, Jan 5, 2011 at 7:51 PM, jamie.t...@oneamerica.com wrote:

 What I expected was that the LAST_NAME tag would have the special
 character's escaped - that the character value would be
 'specialamp;characterlt;testgt;here'.  However, that is not what I see
 when I generated the XML.  Instead, this is what I received:

 ?xml version=1.0?
 ROOT
 TEST_INFO ID=attributeId
 NAME
 FIRST_NAMETest First Name/FIRST_NAME
 LAST_NAMEspecialamp;characterlt;testhere/LAST_NAME
 /NAME
 DATE01-05-11/DATE
 REQUEST_NUMBER1/REQUEST_NUMBER
 /TEST_INFO
 /ROOT

 Specifically, I expected the escaped value of 'gt;' to have replaced the
 '' in my test string value.  Is there something built into jibx that does
 this conversion automatically - perhaps an option that I'm neglecting to set
 in my binding file?


That is valid XML... a  character is allowed between tags, though perhaps
not entirely prudent.

Here's the relevant
referencehttp://www.w3.org/TR/2006/REC-xml-20060816/#syntax
.

-Archie

-- 
Archie L. Cobbs
--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[jibx-users] Open source JiBX bindings library

2010-12-02 Thread Archie Cobbs
Hi,

While starting down the road of creating Java classes and a JiBX binding for
an RFC-specified XML format, it occurred to me that there ought to be an
open source library of pre-compiled JiBX bindings for some of the common
standardized XML formats out there.

Since I couldn't find one, I started a new project
jibx-bindingshttp://code.google.com/p/jibx-bindings/on Google Code.
Right now it only contains bindings for PIDF-LO (RFC 4119)
that I was playing with recently. But there are zillions of other XML
standards out there, and they all need JiBX bindings :-) Seems like a clear
opportunity for a shared, open source tool set.

If anyone is interested in joining this effort, let me know. If not, my
feelings won't be hurt as I've already accomplished what I needed for now.

Cheers,
-Archie

-- 
Archie L. Cobbs
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Cannot use flexible=true with collection

2010-11-19 Thread Archie Cobbs
On Fri, Nov 19, 2010 at 1:04 PM, Dennis Sosnoski d...@sosnoski.com wrote:

 What makes flexible='true' combined with ordered='true' more complex is the
 need to support optional elements. At any point in the parse, the next
 element in the input may be the next element in your schema sequence, or
 *any following element up to and including the first required element*, or
 any other element (which should be ignored). Probably the best way to handle
 this in code is to use a state index for the elements in the sequence (state
 'n' meaning we've parsed the first 'n' elements in the sequence), and again
 use a switch statement on the element name but this time combine it with
 some state logic (to assure that the known elements are in order, and that
 required ones aren't skipped). But then what do you do with the same element
 name used more than once at different points in the sequence?


Thanks, now it makes sense... I wasn't thinking of the impact of optional
elements.

This comment is totally blue sky but this complexity makes me wonder if it
would make more sense to implement JiBX with the assistance of a
context-free grammar parsing tool like Antlr (the Java equivalent of
bison/yacc). The terminals in your language would be XML parse events and
the input document would be the streamed XML parse. Then the JiBX compiler's
job would be to generate the grammar file (including semantic actions)
appropriate for the parse.

Anyway thanks for the explanation.

-Archie

-- 
Archie L. Cobbs
--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2  L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Cannot use flexible=true with collection

2010-10-19 Thread Archie Cobbs
Ironically, things get very inflexible when you specify flexible=true.
Here are some other issues I've found:

JIBX-402 http://jira.codehaus.org/browse/JIBX-402: JiBX fails when
abstract type is used with flexible=true
JIBX-397 http://jira.codehaus.org/browse/JIBX-397: Allow setting
flexible=true and ordered=false at the same time

I don't really understand why though. It seems like there should be a flag
in the code somewhere that says whether to reject or ignore unknown tags,
and why simply changing that flag causes all these other problems.

-Archie

On Tue, Oct 19, 2010 at 7:53 AM, Bob Smith ob_tr...@yahoo.fr wrote:

 Hello,

 I have been using JiBX for a couple months on basic XML files and I am
 really pleased especially by the performance.

 I am now trying to bind an RSS format.
 My issue is that, in RSS, the list of items is not embedded in an items
 tag.
 Example:
 rss
  channel
item /
item /
item /
  /channel
 /rss

 My binding is as follows:
 ?xml version=1.0 encoding=UTF-8?
 binding name=binding package=my.jibx.rss
  mapping name=rss class=my.jibx.rss.Feed
structure name=channel field=channel map-as=channel /
  /mapping
  mapping abstract=true type-name=channel class=my.jibx.rss.Channel
 ordered=false flexible=true
value style=element name=link field=link usage=optional /
value style=element name=title field=title usage=optional /
value style=element name=description field=description
 usage=optional /
collection field=items create-type=java.util.ArrayList
 ordered=false /
  /mapping
  mapping name=item class=my.jibx.rss.Item ordered=false
 flexible=true
value style=element name=title field=title usage=optional /
value style=element name=description field=description
 usage=optional /
structure name=image field=image type=my.jibx.rss.Image
 usage=optional ordered=false
  value style=element name=url field=url /
/structure
structure name=enclosure field=enclosure
 type=my.jibx.rss.Enclosure usage=optional ordered=false
  value style=attribute name=url field=url /
  value style=attribute name=type field=type usage=optional /
  value style=attribute name=length field=length usage=optional
 /
/structure
  /mapping
 /binding


 Since I do not want to handle some elements that are unnecessary to me and
 that others apps may add with their own namespace, I try to use
 flexible=true on the Channel mapping.
 However, I cannot use flexible=true on the Channel mapping because the
 collection of items has no name. Error:

 Error: All child components must define element names for flexible='true';
 on collection element at (line 10, col 83, in rss-binding.xml)


 And I cannot use a name since there is no eclosing tag in RSS.
 How can this type of collection be handled using JiBX?

 Thank you for your help.
 Bob






 --
 Download new Adobe(R) Flash(R) Builder(TM) 4
 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
 Flex(R) Builder(TM)) enable the development of rich applications that run
 across multiple browsers and platforms. Download your free trials today!
 http://p.sf.net/sfu/adobe-dev2dev
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Access to parent property inside a collection?

2010-09-21 Thread Archie Cobbs
You specify a factory method for creating each player that takes an Object
parameter which you then cast to type Club.

See the description for the factory
attributehttp://jibx.sourceforge.net/binding/binding-attributes.html#objectfor
details.

-Archie

On Tue, Sep 21, 2010 at 6:08 AM, Miguel mig...@almeida.at wrote:

  Hi,

 My issue is best described with an example. The question is: in the
 following code, how can I replace HOWTOGETTOPARENTOBJECT? in the binding so
 that I get parentBindingField.name, knowing that Player doesn't have a Team
 field:

 club
   name Liverpool /name

   squad
 player
   teamLiverpool/team
   nameJoe Cole/name
 /player
 player/player
   /squad
 /club


 Java:
 Club{
 String name;
 List players
 }

 Player{
 String playerName;
 }


 Jibx binding:
 binding
 mapping class=Team
 collection name=squad usage=optional field=players
 create-type=java.util.ArrayList
 value name=squad field=HOWTOGETTOPARENTOBJECT? I want team.namehere!/
 value name=name field=name/
 /collection
 /mapping
 /binding

 Thank you in advance,

 Miguel Almeida


 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[jibx-users] Why not allow flexible=true on ordered structures?

2010-08-19 Thread Archie Cobbs
I have a question about why setting flexible=true on a structure element
is limited to situations in which ordered=false.

First, I don't understand why this restriction is necessary. Why is it any
harder to ignore unknown elements in the ordered case than in the unordered
case? Can't you just ignore them?

Secondly, this makes JiBX useless on some very common and important use
cases: XML schemas that allow arbitrary nested elements from other
namespaces.

For example, any schema that has one or more of these in it:

  xsd:any namespace=##other processContents=lax minOccurs=0
maxOccurs=unbounded/

If you want to write a parser that accepts any valid document adhering to
such a schema, you need to be able to have your parser automatically ignore
the nested stuff from other namespaces that you don't recognize. This is a
common pattern in XML documents to allow independent parties to
independently define extensions that are automatically (a)
backward-compatible and (b) don't conflict. But there doesn't seem to be a
way to accomplish this with JiBX when the namespace=##other element(s)
appear among an ordered set of elements.

What am I missing?

Thanks,
-Archie

-- 
Archie L. Cobbs
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev ___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[jibx-users] Allowing a mapping to override an imported mapping with same type and element name

2010-08-19 Thread Archie Cobbs
Suppose I have an XML structure foo mapped in binding #1 to class A and
this is used in some applications.

Now I have a new application which uses a new extended version of the
previous XML structure foo2 that contains the same stuff as foo but also
allows a some additional elements, and I want to defined a new binding #2
that can include binding #1 to reuse the existing stuff and then add the
additional elements to the foo2 XML structure.

It seems like this can work but only if the names foo and foo2 are
different. This is because two mappings for the same class can't have the
same XML element name (because JiBX wouldn't know which one to use when
unmarshalling).

What would be nice is if this constraint were relaxed as follows: in the
case of any conflict, the importing file wins over the imported file (if
there's no import relationship, binding fails). Or, more generally there
could be an (implicit or explicit) priority parameter associated with each
mapping: for example, consider how XSL import statements automatically
affect template priorities.

This would allow the first application and the second application to both
use foo as the element name, and for binding #1 to be efficiently reused
by include'ing it.

The way it is now you have to separate out an abstract mapping for foo..
which you think would be OK, but it's not when foo is nested deeply inside
a bunch of other XML tags, because then you discover that you have to do
this recursively for all the containing structures as well, basically
duplicating the entire XML hierarchy and forcing abstract definitions for
every structure.

Is this change reasonable and/or feasible?

Thanks,
-Archie

-- 
Archie L. Cobbs
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev ___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] how would i bind this?

2010-08-19 Thread Archie Cobbs
Try:

   value style=text field=value usage=optional/

instead.

-Archie

On Thu, Aug 19, 2010 at 4:12 PM, Steel City Phantom scpha...@gmail.comwrote:

 my xml tag looks like this

 street line=11 compliant/street

 i tried the binding

 mapping name=street class=com.show.comm.ncc.Street 
  value style=attribute name=line field=line usage=optional/
 value style=element field=value usage=optional/
  /mapping

 with the class

 public class Street
 {
 public String line;
  public String value;
 }

 with no luck, what am i doing wrong here?  my error says the required field
 name isn't present on my element, but how would i bind this since there is
 no child element?
 --
 You want it fast, cheap, or right.  Pick two!!


 --
 This SF.net email is sponsored by

 Make an app they can't live without
 Enter the BlackBerry Developer Challenge
 http://p.sf.net/sfu/RIM-dev2dev
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev ___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users