Re: Antw: [jibx-users] Problem with namespace declaration
Hi Kai, Thanks for the hint; unfortunately it does not work because we have already a ns defined on the mapping level and we can't use prefixes. What we probably need, would be that we could put namespace in the context of a structure, instead of an element. Currently, if we try that option, JiBX complains with error. But it could be a nice feature IMO. Stefano Kai Peter Nacke wrote: Hi, I think namespace uri=syncml:metinf default=none / mapping name=Meta class=sync4j.framework.core.Meta ordered=false value name=Format ns=syncml:metinf field=format usage=optional/ value name=Type ns=syncml:metinf field=type usage=optional/ /mapping should work. Kai [EMAIL PROTECTED] 01.07.2004 11:07 Hi, I have this mapping mapping name=Meta class=sync4j.framework.core.Meta ordered=false value name=Format field=format usage=optional/ value name=Type field=type usage=optional/ /mapping How can I add namespace declaration to get the following result when I marshalling? Meta Format xmlns=syncml:metinfformat/Format Typexmlns=syncml:metinftype/Type /Meta If I write mapping name=Meta class=sync4j.framework.core.Meta ordered=false namespace uri=syncml:metinf default=elements / value name=Format field=format usage=optional/ value name=Type field=type usage=optional/ /mapping then I get this result that is not correct for me Meta xmlns=syncml:metinf Formatformat/Format Typetype/Type /Meta Thanks in advanced Bye Luigia --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users -- Stefano Fornari [EMAIL PROTECTED] Funambol CTO www.funambol.com 6472 Camden Ave #106 Via dei Valtorta 21 San Jose, CA 95120 (USA) 20127 Milano (Italy) Tel.: +1 408 705 2044 Tel.: +39 02 2614 5383 Fax: +1 408 705 2044 Fax: +39 02 7005 60230 Your Synchronization Company --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
Re: [jibx-users] JibX XBIS
Not at present. To make this work there'd need to be an XMLPull adapter for XBIS input, then an org.jibx.runtime.IXMLWriter implementation to generate XBIS output from JiBX. It wouldn't be that hard to do, but it's very high on my priority list right now. I suspect it'd outperform Sun's Fast Web Services implementation, though, which might make it fun at some point. Faster Web Services? - Dennis ??? ??? wrote: Is there a way to use XBIS with JiBX ? --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
Re: [jibx-users] How to marshall in memory (in a DOM document for example)
Thomas Jones-Low wrote: Jean-Christophe Garnier wrote: Hello, I wish to obtain a DOM or string representation of an object marshaling. Currently I have seen only explanations to generate a file. Is this possible without generate a file ? Thanks by advance, Use a java.io.StringReader or java.io.StringWriter class as your IO class. For example: public void write () { try { IBindingFactory bfact = BindingDirectory.getFactory(Base Class.class); IMarshallingContext mctx = bfact.createMarshallingContext(); mctx.setIndent(4); StringWriter outputString = new StringWriter(); mctx.marshalDocument(data, UTF-8, null, outputString); } catch (Exception ex) { ex.printStackTrace(); } } public void read(String inputString) { try { IBindingFactory bfact = BindingDirectory.getFactory(Base Class.class); IUnmarshallingContext uctx = bfact.createUnmarshallingContext(); StringReader readString = new StringReader (inputString); data = (Class) uctx.unmarshalDocument (readString, null); } catch (Exception ex) {ex.printStackTrace(); } } I'll add this to the wiki. Thomas' response is correct, and thanks for volunteering to add it to the wiki. I'll add that if someone wants to do this more efficiently they'd just need to implement an org.jibx.runtime.IXMLWriter that outputs to DOM (or SAX event stream, or whatever). This shouldn't be too difficult to do, and would give considerably better performance than outputting to a string that then gets parsed. - Dennis --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
Re: Antw: [jibx-users] Problem with namespace declaration
This *is* a real limitation of the current binding definition structure. The problem is that I didn't foresee needing to add namespace definitions at the structure level. Right now the only way to handle what you want through the binding definition is by using mapping instead of structure. For beta 4 I should be able to support namespace declarations at the structure level. If you enter this as a Jira issue it'll make sure I don't forget about it. - Dennis Stefano Fornari wrote: Hi Kai, Thanks for the hint; unfortunately it does not work because we have already a ns defined on the mapping level and we can't use prefixes. What we probably need, would be that we could put namespace in the context of a structure, instead of an element. Currently, if we try that option, JiBX complains with error. But it could be a nice feature IMO. Stefano Kai Peter Nacke wrote: Hi, I think namespace uri=syncml:metinf default=none / mapping name=Meta class=sync4j.framework.core.Meta ordered=false value name=Format ns=syncml:metinf field=format usage=optional/ value name=Type ns=syncml:metinf field=type usage=optional/ /mapping should work. Kai [EMAIL PROTECTED] 01.07.2004 11:07 Hi, I have this mapping mapping name=Meta class=sync4j.framework.core.Meta ordered=false value name=Format field=format usage=optional/ value name=Type field=type usage=optional/ /mapping How can I add namespace declaration to get the following result when I marshalling? Meta Format xmlns=syncml:metinfformat/Format Typexmlns=syncml:metinftype/Type /Meta If I write mapping name=Meta class=sync4j.framework.core.Meta ordered=false namespace uri=syncml:metinf default=elements / value name=Format field=format usage=optional/ value name=Type field=type usage=optional/ /mapping then I get this result that is not correct for me Meta xmlns=syncml:metinf Formatformat/Format Typetype/Type /Meta Thanks in advanced Bye Luigia --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
Re: Antw: [jibx-users] Problem with namespace declaration
I'm doing some similar things in the JibxSoap WSDL generation. I'm trying right now to get JiBX beta 3c ready, and when that's done I'll also release JibxSoap. - Dennis Stefano Fornari wrote: Hi All, We would like to follow the suggestion of writing a marshaller to work around our namespace problem. However, from the docs, it is not very clear how to do it. We would like an output like: Type xmlns=syncml:metinfsomething/Type without specifying the ns in the mapping. We figured out the skeleton of the marshaller should look like the following: public class MetInfTypeMarshaller implements IMarshaller { public boolean isExtension(int index) { return false; } public void marshal(Object obj, IMarshallingContext ictx) throws JiBXException { if (obj == null) { return; } MarshallingContext ctx = (MarshallingContext)ictx; IXMLWriter writer = ctx.getXmlWriter(); writer.pushExtensionNamespaces(new String[] {syncml:metinf}); writer.startTagNamespaces(*, Type, *, *); // what should we put here instead of * writer.closeStartTag(); writer.writeTextContent(obj.toString()); writer.endTag(*, Type); // what should we put here instead of * writer.popExtensionNamespaces(); } } Is it correct? What should we put instead of the * bookmarks? Any hint is very much appreciated. Thanks in advance. Stefano Luigia --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users -- Dennis M. Sosnoski Enterprise Java, XML, and Web Services Training and Consulting http://www.sosnoski.com Redmond, WA 425.885.7197 --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
[jibx-users] JiBX_MungeAdapter and class accessiblity
Hi, I have 2 packages that contains JiBX-handled classes. However, the classes in package A are public but the classes in package B are package-private. I execute jibx compiler with 2 binding files (one for each package). If the working directory during compilation was that of B, everything works fine at runtime. If the working directory was that of package B, then I see an IllegalAccessError when classes in B are accessed by JiBX_MungeAdapter. The reason being that only one JiBX_MungeAdapter class is generated and it happens to be generated in the compilation directory. Can I generate JiBX_MungeAdapter in each package that contains a JiBX-handled class during one compilation? If so, how? Also, how do I accomplish this from within Ant? If not, it would be great to provide such a switch in the compiler. This way the access specifiers of the class need not altered just for the purpose of using JiBX. In case, any or all of my analysis is wrong, please do correct me. waiting for reply, -- Venkatesh Prasad Ranganath, Dept. Computing and Information Science, Kansas State University, US. web: http://www.cis.ksu.edu/~rvprasad --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users