{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
List<String> inclusiveNamespaces = new ArrayList<String>();
inclusiveNamespaces.add("#default");
inclusiveNamespaces.add("xsi");
Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
Map<String, Object> transformerProperties = new HashMap<String, Object>();
transformerProperties.put(Canonicalizer20010315_Excl.INCLUSIVE_NAMESPACES_PREFIX_LIST, inclusiveNamespaces);
c.setProperties(transformerProperties);
c.setOutputStream(baos);
canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));
assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
}
{
//exactly the same outcome is expected if #default is not set:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
List<String> inclusiveNamespaces = new ArrayList<String>();
inclusiveNamespaces.add("xsi");
Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
Map<String, Object> transformerProperties = new HashMap<String, Object>();
transformerProperties.put(Canonicalizer20010315_Excl.INCLUSIVE_NAMESPACES_PREFIX_LIST, inclusiveNamespaces);
c.setProperties(transformerProperties);
c.setOutputStream(baos);
canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));
assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
}
}