Search code examples
javamarklogichtmltidy

Accessing HTML Tidy with MarkLogic's Java API


I'm refactoring a Java EE project to use MarkLogic, and would like to take advantage of MarkLogic's built-in HTML Tidy functionality. Is it possible to make use of HTML Tidy from the MarkLogic Java API? Or am I going to need to use a third-party API that lets me run XQuery commands directly?

Or is this a fool's errand, and I should just use HTML Tidy in my code?


Solution

  • Please see the com.marklogic.client.example.cookbook.DocumentWriteTransform example distributed with the Java API, which uses a server-side XQuery transform on document write to invoke xdmp:tidy().