Hi Joshua,

I haven't tried it, but it should also work if you use <value 
style="text" constant=""/> in place of <value style="text" field="text" 
/>. That way you don't need to modify the actual Java class at all.

  - 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



Joshua Davies wrote:
> It's a bit of a hack, but if you add empty text content to the elementyou're 
> trying to marshal out, you can achieve this effect.  Forinstance:
> <binding direction="output">  <mapping name="top" class="Top">    <structure 
> field="container" name="something">      <value style="attribute" 
> name="attribute" field="attribute" />      <value style="text" field="text" 
> />    </structure>  </mapping></binding>
> Will generate this output:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?><top><something 
> attribute="true"></something></top>
> You just have to add a dummy text field with an empty string (not anull) into 
> the "container" object.
> I'm not sure how the customer writer might interact with this hack,though - 
> if it doesn't work, post the custom writer code here and I'lltake a look.
> On Thu, 2008-01-17 at 00:09 -0600, Ryan Bartlett wrote:> Hello-> >  > > I 
> have seen several posts on this subject, but I haven’t found a> solution yet. 
> I am trying to get <something> attribute=”true”><./something> instead of 
> <something> attribute=”true”/>. I am using a custom writer (it extends> 
> XMLWriterNamespaceBase and creates a W3C Document object). It works> well 
> except for the empty xml element. > >  > > Thanks in advance,> > Ryan. > > > 
> -------------------------------------------------------------------------> 
> This SF.net email is sponsored by: Microsoft> Defy all challenges. 
> Microsoft(R) Visual Studio 2008.> 
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> 
> _______________________________________________ jibx-users mailing list 
> jibx-users@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/jibx-users
> -------------------------------------------------------------------------This 
> SF.net email is sponsored by: MicrosoftDefy all challenges. Microsoft(R) 
> Visual Studio 
> 2008.http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________jibx-users
>  mailing [EMAIL PROTECTED]://lists.sourceforge.net/lists/listinfo/jibx-users
>
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to