Hi Aki On 12/03/12 09:43, Aki Yoshida wrote:
hi cogitate, so, basically you want to remove all the namspaces and assign a new one in a general way (i.e., without knowing the namespaces used in the original document)?
I'm not sure yet what specific case it would help with, do we have a scenario where an outgoing element has 2/3 active namespaces and the receiver is expecting a single namespace only ?
Is it more an optimization enhancement (why type {bar}*: {foo}*) rather than anything else ?
@sergey, I think this will be straightforward and we can include this option.
Agreed Cheers, Sergey
regards, aki 2012/3/11 cogitate<[email protected]>:hi sergey : any chance of the following test case for in transform reader? the problem is there are two vendors who don't care about the contract of namespaces. maybe {*}* can do "matches" instead of "equals"? [ i am using cxf-2.5.2 ] it seems the namespaces the vendors generate may not even be specific.. from vendor - <ns0:Echo_PayloadResponse xmlns:ns0="tns"><ns1:Payload xmlns:ns1="None">Y</ns1:Payload></ns0:Echo_PayloadResponse> what we need - something like : <ps1:Echo_PayloadResponse xmlns:ps1="http://schemas.w3c.org/W3C"><ps1:Payload>Y</ps1:Payload></ps1:Echo_PayloadResponse> thanks in advance, -cogitate @Test public void testSpecificNS() throws Exception { String input = "<ns0:Echo_PayloadResponse xmlns:ns0=\"tns\"></ns0:Echo_PayloadResponse>"; InputStream is = new ByteArrayInputStream(input.getBytes()); XMLStreamReader reader = StaxUtils.createXMLStreamReader(is); reader = new InTransformReader(reader, Collections.singletonMap("{*}*","{http://schemas.w3c.org/W3C}*"), null, false); ByteArrayOutputStream bos = new ByteArrayOutputStream(); StaxUtils.copy(reader,bos); String value = bos.toString(); System.out.println("[input="+input+" output="+value+"]"); //expect: [input=<ns0:Echo_PayloadResponse xmlns:ns0="tns"></ns0:Echo_PayloadResponse> output=<ps1:Echo_PayloadResponse xmlns:ps1="http://schemas.w3c.org/W3C"/>] assertTrue("<ps1:Echo_PayloadResponse xmlns:ps1=\"http://schemas.w3c.org/W3C\"/>".equals(value)); } -- View this message in context: http://cxf.547215.n5.nabble.com/InTransformReader-Test-possible-enhancement-tp5554151p5554151.html Sent from the cxf-user mailing list archive at Nabble.com.
