I'm trying to use the ContentBasedRouter from the ServiceMix EIP component. 

<eip:content-based-router 
        service="test:egovrouter" endpoint="endpoint">
  <eip:rules>
    <eip:routing-rule>
      <eip:predicate>
        <eip:xpath-predicate 
                xpath="count(/BPKAbfrage) = 1" />
      </eip:predicate>
      <eip:target>
        <eip:exchange-target service="test:szrVerarbeitung" />
      </eip:target>
    </eip:routing-rule>
    <eip:routing-rule>
      <eip:predicate>
        <eip:xpath-predicate 
                xpath="count(/Personenabfrage) = 1" />
      </eip:predicate>
      <eip:target>
        <eip:exchange-target service="test:zmrVerarbeitung" />
      </eip:target>
    </eip:routing-rule>
  </eip:rules>
</eip:content-based-router>

The input message looks like:

<?xml version="1.0" encoding="UTF-8"?>
<zmr:BPKAbfrage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
        xmlns:zmr="http://www.sozialversicherung.at/schema/egov/zmr/1_0";>

  <zmr:Abfrageparameter>
    <zmr:Bearbeitung>
        <zmr:Benutzer>
                <zmr:Bearbeiter>99mustermann</zmr:Bearbeiter>
                <zmr:Name>Mustermann Max</zmr:Name>
                
<zmr:GlobaleIdentifizierung>99mustermann</zmr:GlobaleIdentifizierung>
        </zmr:Benutzer>
        <zmr:Bearbeitungsgrund>ZPV Test</zmr:Bearbeitungsgrund>
        <zmr:System>STP ZPV</zmr:System>
    </zmr:Bearbeitung>
    <zmr:PersonenSuchkriterien>
      <zmr:Familienname>Mayrbäurl</zmr:Familienname>
      <zmr:Vorname>Jürgen</zmr:Vorname>
      <zmr:Geburtsdatum>1966-01-05</zmr:Geburtsdatum>
    </zmr:PersonenSuchkriterien>
  </zmr:Abfrageparameter>
</zmr:BPKAbfrage>

The ContentBasedRouter tells me that it can't find a matching rule for the
exchange. Maybe the reason for this is the missing namespace in the xpath
expression. 

Any idea? And how can I specify the namespace in the xpath expression?

Greetings
Juergen

BTW: The message content will cause exceptions in the traceMessages() method
of the DeliveryChannelImpl, when tracing is on.
--
View this message in context: 
http://www.nabble.com/NamespaceContext-in-XPath-based-content-router-t1512305.html#a4103093
Sent from the ServiceMix - User forum at Nabble.com.

Reply via email to