1 Reply Latest reply on Jan 21, 2009 5:04 AM by beve

    Prefix in XPath Expression in drl

    poyge394

      Hello,
      Is it possible to have prefix in xpath expression, i can't get it work.

      xml:

      
      <a:h xmlns:a="http://www.sami.com/kirekoloft">
       <a:b>kkk</a:b>
      </a:h>
      

      xpath:
      
      rule "xpath"
       when
      xpathEquals "/a:h/a:b", "kkk"
       then
       Destination : "dir";
      end
      
      


      do i miss anything ??






        • 1. Re: Prefix in XPath Expression in drl
          beve

          Hey Poyan,

          you mean a namespace prefixes right?

          You need to use something like the fun_cbr quickstart does:

          rule "Blue Routing Rule using XPATH"
          when
          xpathEquals expr "/order:Order/@statusCode", "0" use namespaces "order=http://org.jboss.soa.esb/Order"
          then
          Log : "Blue Team";
          Destination : "blue";
          end


          You can have multiple namespace prefixes using the form "prefix=uri,prefix=uri" .

          regards,

          /Daniel