Hi Jon,

private  IMarshallingContext mctx;
this.mctx = factory.createMarshallingContext();
mctx.setIndent(6);

use an appropriate value for indent (based on your perception/appeal of 
prettiness)

Hope this helps.

Regards,
Chetan




Jon Little <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
06/18/2008 08:54 AM
Please respond to
JiBX users <[email protected]>


To
JiBX users <[email protected]>
cc

Subject
[jibx-users] Making XML output "pretty"






Hi

Is there a way/flag to make the produced XML "pretty" / more 
human-readable?

E.g:

from

<binding><format type="int[]" 
serializer="example20.Conversion.serializeIntArray"deserializer="example20.Conversion.deserializeIntArray"/><mapping
 

name="customer" class="example20.Customer"><structure 
name="person"><value name="cust-num"style="attribute" 
field="customerNumber"/><value name="first-name" 
field="firstName"/><value name="last-name" 
field="lastName"/></structure><value name="street" 
field="street"/><value name="city"field="city"/><value name="state" 
field="state"/><value name="zip" field="zip"/><value name="total" 
field="total"serializer="example20.Conversion.serializeDollarsCents"deserializer="example20.Conversion.deserializeDollarsCents"/><value
 

name="orders" field="orders"/></mapping></binding>

to:

<binding>
  <format type="int[]" serializer="example20.Conversion.serializeIntArray"
    deserializer="example20.Conversion.deserializeIntArray"/>
  <mapping name="customer" class="example20.Customer">
    <structure name="person">
      <value name="cust-num" style="attribute" field="customerNumber"/>
      <value name="first-name" field="firstName"/>
      <value name="last-name" field="lastName"/>
    </structure>
    <value name="street" field="street"/>
    <value name="city" field="city"/>
    <value name="state" field="state"/>
    <value name="zip" field="zip"/>
    <value name="total" field="total"
      serializer="example20.Conversion.serializeDollarsCents"
      deserializer="example20.Conversion.deserializeDollarsCents"/>
    <value name="orders" field="orders"/>
  </mapping>
</binding>

Thanks

Jon

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users



-----------------------------------------
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to