It's a bit of a hack, but if you add empty text content to the element
you're trying to marshal out, you can achieve this effect.  For
instance:

<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 a
null) 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'll
take 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: 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