Details
Description
XMLBeans used with Axis2 generates lot of namespaces declaration.
Is it a bug or is there a way to reduce it ?
With this code:
GetLocatedProductsDocument document = GetLocatedProductsDocument.Factory
.newInstance(new XmlOptions().setSaveAggressiveNamespaces());
GetLocatedProductsDocument.GetLocatedProducts getLocatedProducts = document
.addNewGetLocatedProducts();
for (int i = 0; i < 10; i++)
XmlOptions xmlOptions = new XmlOptions();
xmlOptions.setSaveNamespacesFirst();
xmlOptions.setSaveAggressiveNamespaces();
org.apache.axiom.om.impl.builder.StAXOMBuilder builder = new org.apache.axiom.om.impl.builder.StAXOMBuilder(
OMAbstractFactory.getOMFactory(),
new org.apache.axis2.util.StreamWrapper(document.newXMLStreamReader(xmlOptions)));
org.apache.axiom.om.OMElement documentElement = builder
.getDocumentElement();
((org.apache.axiom.om.impl.OMNodeEx)documentElement).setParent(null);
documentElement.serialize(System.out, new OMOutputFormat());
Here is an example:
<getLocatedProducts xmlns="http://v1.product.ws.store.kingfisher.com"><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0><param0><callType xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</callType><familyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</familyCode><moduleCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</moduleCode><subFamilyCode xmlns="http://data.v1.product.ws.store.kingfisher.com/xsd">1</subFamilyCode></param0></getLocatedProducts>
Thank you
Attachments
Attachments
Issue Links
- duplicates
-
AXIOM-235 Namespace High verbosity combined with XMLBeans
- Closed
- relates to
-
XMLBEANS-398 XmlTokenSource#newXMLStreamReader(XmlOptions) should take into account the XmlOptions#setSaveAggressiveNamespaces()
- Closed