Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Nifi XPATH for attributes with Namespaces


Nifi XPATH for attributes with Namespaces


Hello, I'm trying to pull the attribute out of an xml node, but it has a namespace. I've had success getting a node using the [local-name="myField"] syntax, but no such luck with an attribute. My xml looks like this....


<Books xlmns:tech="urn:mstp:tech:gov">
    <unit:Unit xmlns:ns1="urn:us:edu:ic:ian" ns1:myAtt="BINGO">


 I'm trying to get the value of myAtt=BINGO.


I've been able to get the value Rickie from the name field using //*[local-name()='Name']. I've tried things like //@*[local-name()='myAtt'] and a million other things I've tried online and nothing seems to work.  Any other ideas?




Re: Nifi XPATH for attributes with Namespaces


In the meantime, I was able to accomplish this using ExtractText along with some Substring statements in UpdateAttribute. It's a bit messy, but it gets me by.

Don't have an account?
Coming from Hortonworks? Activate your account here