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)?

@sergey,
I think this will be straightforward and we can include this option.

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.

Reply via email to