How to validate xml against schema such that it does not accept any other encoding except UTF-8 in Apache Camel ?

Solution Unverified - Updated -

Issue

  • We have two Questions regarding encoding.

    • In router, consuming xml message with encoding=Cp1252 and validating this against xsd schema which has encoding as UTF-8 using camel validator component. The validator component is not validating the encoding=UTF-8, its accepting Cp1252, its not throwing any error message like unsupportedencodingformat.
  • How to validate xml against schema such that it should not accept any other encoding except UTF-8?

  • In router,consuming xml message with encoding=UTF-8, and in one of the element we have data as non UTF-8 characters, in this case the non UTF-8 characters are replaced by "?". We am using validator component to validate against schema.

  • How to validate xml against schema so that it should not allow non UTF-8 chacters and throw error message?

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • Camel Validation Component

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content