アンマーシャリングを行うために次のコードを使用しています。
@Override
public String marshal(Object document) throws JAXBException {
Class clazz = document.getClass();
JAXBContext context =
JAXBContext.newInstance( clazz.getPackage().getName() );
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
StringWriter sw = new StringWriter();
marshaller.marshal(document, sw);
String xml = sw.toString();
return xml;
}
結果は次のようになります。
<IlpQuoteInput QuoteId="2888284000185" xmlns="http://www.abc.com">
<Common IlpSellerId="0001">
<Quotation QuotationDt="20130711"/>
<Product CurrencyCd="E">
etc etc
それはすべて良いですが、実際には出力にxmlnsを入れたくないのですが、どうすればよいですか? ありがとうPS私はJAXBとJava 6の最新バージョンを使用しています。