You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2014/02/06 15:34:24 UTC

[jira] [Commented] (CAMEL-7125) tokenizeXml fails when attributes have a / in them

    [ https://issues.apache.org/jira/browse/CAMEL-7125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13893383#comment-13893383 ] 

Claus Ibsen commented on CAMEL-7125:
------------------------------------

The regular expression used by the parser may need to take this into account. To deal with skipping / in quoted strings.

> tokenizeXml fails when attributes have a / in them
> --------------------------------------------------
>
>                 Key: CAMEL-7125
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7125
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.12.2
>            Reporter: Matt Nathan
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.12.4, 2.13.0
>
>
> {{tokenizeXml}} does not work or produce value xml output when attributes contain a {{/}}.
> The test below will fail under 2.12.2
> {code:java}
> import org.apache.camel.EndpointInject;
> import org.apache.camel.Produce;
> import org.apache.camel.ProducerTemplate;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.component.mock.MockEndpoint;
> import org.apache.camel.test.junit4.CamelTestSupport;
> import org.junit.Test;
> public class CamelTokenizeXmlTest extends CamelTestSupport {
>   @EndpointInject(uri = "mock:result")
>   protected MockEndpoint resultEndpoint;
>   @Produce(uri = "direct:start")
>   protected ProducerTemplate template;
>   @Test
>   public void testXmlWithSlash() throws Exception {
>     String message = "<parent><child attr='/' /></parent>";
>     resultEndpoint.expectedBodiesReceived("<child attr='/' />");
>     template.sendBody(message);
>     resultEndpoint.assertIsSatisfied();
>   }
>   @Override
>   protected RouteBuilder createRouteBuilder() {
>     return new RouteBuilder() {
>       @Override
>       public void configure() {
>         from("direct:start").split().tokenizeXML("child").to("mock:result");
>       }
>     };
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)