Hi Matt,

I was trying to implement you suggestion with EvaluateXPath, but run into a
pop up error as shown in the screen copy below:


[image: Inline image 1]

I think it has something to do with the processor, not your suggestion.  I
tested separately your XPath expression outside Nifi.  It worked.

How may I handle this error?

By the way, I'm using Nifi 0.6.0

Thanks.
Hong



*Hong Li*

*Centric Consulting*

*In Balance*
(888) 781-7567 office
(614) 296-7644 mobile
www.centricconsulting.com | @Centric <https://twitter.com/centric>

On Sat, May 21, 2016 at 9:08 PM, Matt Burgess <mattyb...@gmail.com> wrote:

> Hong,
>
> The use of a default namespace makes the XPath more tricky, as the
> namespace technically exists as a prefix although it is not visible in
> the document.  As an example, I used this sample content:
>
> <report xmlns="http://cp.com/rules/client";>
>   <entry>Hello</entry>
> </report>
>
> In order to get the value "Hello", I had to use wildcards and/or
> local-name(). The explicit path /report/entry needed to be changed to:
>
> /*[local-name()='report']/*[local-name()='entry']
>
> Also //*[local-name()='entry'] works, and so on. Basically when you
> need to match a particular tag (versus using wildcards), you can use
> *[local-name='<your_tag_name_here>']
>
> Regards,
> Matt
>
>
> On Sat, May 21, 2016 at 5:43 PM, Hong Li <hong...@centricconsulting.com>
> wrote:
> > The xml file I received comes with attribute xmlns such as
> >
> > <report xmlns="http://cp.com/rules/client";>
> >
> >
> > How may I use EvaluateXPath to process the xml file?
> >
> > Thanks.
> > Hong
> >
> > Hong Li
> >
> > Centric Consulting
> >
> > In Balance
> > (888) 781-7567 office
> > (614) 296-7644 mobile
> > www.centricconsulting.com | @Centric
>

Reply via email to