How to validate XML data against DTD
Issue
I am trying to validate xml data against dtd file and tried using like below and it is throwing error as "Failed to resolve endpoint: validator://file:dtd/pce_security.dtd due to: The markup in the document preceding the root element must be well-formed."
<doTry>
<to uri="validator:file:dtd/pce_security.dtd"></to>
<to uri="mock:valid"></to>
<doCatch>
<exception>org.apache.camel.ValidationException</exception>
<to uri="mock:invalid"></to>
<log message="Catch: Error in parsing ${body}"></log>
</doCatch>
<doFinally>
<to uri="mock:finally"></to>
<log message="Finally: Error in parsing ${body}"></log>
</doFinally>
</doTry>
By looking at web it seems camel validator does not support dtd. Could you please check and let us know how to validate xml data against dtd.
Environment
- Red Hat JBoss Fuse 6.1.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
