Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

how do you specify a content viewer in Apache NiFi

avatar

The analyze traffic patterns with NiFi tutorial creates files with content type html/xml. When I click on the EvaluateXPath processor and select Data Provenance. Then click on info icon of a provenance entry. Then click on the Content tab and click the View button. The content type is text/html and the view pane says "No viewer registered for this content type."

How can I register a viewer for html/xml or specify a different content type such as text/xml or application/xml?

1 ACCEPTED SOLUTION
5 REPLIES 5

avatar
Expert Contributor

The easiest "hack" is to give it a filename ending in .xml it could be update attribute Filename | ${Filename}.xml

avatar
Master Guru

avatar

I added an UpdateAttribute processor and set the mime.type Property to application/xml. The viewer was not able to render text/xml:

9273-screen-shot-2016-11-09-at-82310-am.png

9272-screen-shot-2016-11-09-at-82158-am.png

avatar
Rising Star

Was the HTML content actually valid XML?

Did the content viewer open? If so, is the content viewer unable to show the content in it's 'formatted' form? What about the 'original' or 'hex' forms?

avatar
Rising Star

As was previously mentioned, the content type is specified in the flowfile attribute mime.type. Some Processors will automatically set this value. However, UpdateAttribute can be used to explicitly set it.

There is no content viewer for HTML bundled with Apache NiFi currently. This is an extension point so one could be developed and dropped into your instance. Alternatively, you could just use application/xml or text/plain.