我讀過你寫的關於一個帖子:蓖麻編組抑制XSI
Marshaller marshaller = new Marshaller(w);
marshaller.setSuppressXSIType(true);
的問題是,我使用的方法,但結果並沒有改變。
我的代碼是:
Marshaller m = new Marshaller();
m.setSuppressXSIType(true);
m.setSuppressNamespaces(true);
m.setSupressXMLDeclaration(true);
m.setMarshalExtendedType(false);
m.marshal(obj, file);
但我得到了什麼仍是xmlns:xsi=..
和xsi:type=..
XML標記內。
我做錯了什麼?我正在使用castor xml 1.3.2。