The <namespace ... default="elements"/> in your binding tells JiBX you 
want the namespace to be applied to all elements. In your case you just 
want the namespace to apply to the root PCHA_Dataset element of your 
document. Remove the default="elements" attribute from the <namespace/> 
element in your binding, and add 
ns="http://businessobjects.datalayer.fpa"; to the <mapping> element start 
tag. This will apply the namespace only to the root element.

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Carmi wrote:
> I'm using jibx 1.1.3. and unmarshalling an XML.
> I have this binding file (simplified) 
> http://www.nabble.com/file/6134/samplebinding.xml samplebinding.xml 
> and this XML file  http://www.nabble.com/file/6135/sampleTest.XML
> sampleTest.XML 
> at runtime jibx complain about the name space. Basically it wants me to
> qulify the elements . In the real world, this is a big XML, and I don't see
> why jibx insists that I qualify the names. Don't want to qualify all the
> elements.
> When I put this:  
> <PCHA_to_FPA:PCHA_Software_Version>0102042</PCHA_to_FPA:PCHA_Software_Version>
> Jibx is happy.
> Otherwise, it complains with:
> Failed Exception: Failed to parse file /tmp/sampleTest.xml, Expected
> "{http://businessobjects.datalayer.fpa}PCHA_Software_Version"; start tag,
> found "PCHA_Software_Version" start tag (line 4, col 28)
>
> if in the xml I remove the namespace from this:
> xmlns:PCHA_to_FPA="http://businessobjects.datalayer.fpa"; and leave it as 
> xmlns="http://businessobjects.datalayer.fpa"; jibx complains about error in
> the file.
>
> Any pointers/help would be greatly appriciated.
> Thanks
>   

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to