[
https://issues.apache.org/jira/browse/CAMEL-6004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13561417#comment-13561417
]
Willem Jiang commented on CAMEL-6004:
-------------------------------------
Hi,
I just checked the code of Tokenize, it only works after setting the startToken
and endToken. So it is not strange that it doesn't support the self-closing
XML. As it doesn't has the pair startToken and endToken.
If you want to make your route support the those XML at the same time, you make
consider to use the xpath expression like this
{code}
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("direct:start").split().xpath("//child").to("mock:result");
}
};
}
{code}
You will get the result like this in you two test case, as you can see the
result is unified.
{code}
<child anotherAttr="" some_attr=""/>
{code}
> Tokenize XML does not support self-closing XML tokens
> -----------------------------------------------------
>
> Key: CAMEL-6004
> URL: https://issues.apache.org/jira/browse/CAMEL-6004
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 2.10.2
> Reporter: Greg Heidorn
> Priority: Minor
> Attachments: GenericTokenizeTest.java
>
>
> Tokenize creates non-well-formed XML when handling self-closing XML tokens.
> Tokenize should support parsing tokens that are either have a closing tag or
> are self-closing.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira