nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hong Li <hong...@centricconsulting.com>
Subject Re: EvaluateXPath and xml namespace
Date Tue, 31 May 2016 19:57:36 GMT
Thanks, Matt.  We upgraded to 0.6.1.  Things have been fine so far.





*Hong Li*

*Centric Consulting*

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

On Sun, May 22, 2016 at 12:53 PM, Matt Burgess <mattyb149@gmail.com> wrote:

> This looks like https://issues.apache.org/jira/browse/NIFI-1752, which
> was fixed in 0.6.1 via https://issues.apache.org/jira/browse/NIFI-1697.
> Is it possible for you to upgrade to 0.6.1?
>
> Regards,
> Matt
>
> On Sun, May 22, 2016 at 12:05 PM, Hong Li <hong.li@centricconsulting.com>
> wrote:
>
>> 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 <mattyb149@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.li@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
>>>
>>
>>
>

Mime
View raw message