376.5. XML 구성 사용
Spring XML 파일에서 경로를 구성하는 경우 다음과 같이 8601 식을 사용할 수 있습니다.If you prefer to configure your routes in your Spring XML file then you can use DAX expressions as follows:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:foo="http://example.com/person"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="activemq:MyQueue"/>
<filter>
<xquery>/foo:person[@name='James']</xquery>
<to uri="mqseries:SomeOtherQueue"/>
</filter>
</route>
</camelContext>
</beans>이 경우 네임스페이스 접두사, foo 를 재사용하여 더 쉬운 네임 스페이스 기반 XQuery 표현식을 위해 XPath 표현식에서 사용할 수 있는 방법을 확인하십시오!
XQuery 식에서 함수를 사용하는 경우 @type 특성을 통해 xml 구성에서 수행되는 명시적 형식 변환이 필요합니다.When you use functions in your XQuery expression you need an explicit type conversion which is done in the xml configuration via the @type attribute:
<xquery type="java.lang.String">concat('mock:foo.', /person/@city)</xquery>