我有一个类似的用例。ChildListEntryDefinitionParser 工作正常(使用 Mule ESB 3.4 测试)。列表元素将正确设置。
骡子配置.xml
<your:xpath-resolver-transformer>
<your:expression xpath="//order/status" />
<your:expression xpath="//order/type" />
</your:xpath-resolver-transformer>
你的命名空间处理程序
MessageProcessorDefinitionParser xpathResolver = new MessageProcessorDefinitionParser(XPathResolver.class);
xpathResolver.registerPreProcessor(new CheckExclusiveAttributesAndChildren(new String[]
{ "xpath" }, new String[]
{ "expression" }));
registerBeanDefinitionParser("expression", new ChildListEntryDefinitionParser("xpathExpression", "xpath"));
registerBeanDefinitionParser("xpath-resolver-transformer", xpathResolver);
骡子 XSD (mule-your.xsd)
<xsd:element name="xpath-resolver-transformer" type="xpathResolverTransformerType" substitutionGroup="mule:abstract-transformer" />
<xsd:complexType name="xpathResolverTransformerType">
<xsd:complexContent>
<xsd:extension base="mule:abstractTransformerType">
<xsd:sequence>
<xsd:element name="expression" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="xpath" type="xsd:string" use="required"></xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>