私のxmlファイルには、件名に表示される「特殊」文字を含む属性「containsValue」のタグがあります。
<original_msg_body id="msgBodySpecialCharsRule" containsValue=";ìè+òàù-<^èç°§_>!£$%&/()=?~`'#;" />
私のxmlスキーマでは、属性にxs:stringがあります。
<xs:attribute name="containsValue" type="xs:string" />
この値が別の文字列内に含まれているかどうかをチェックするJavaソフトウェア内でこの値を使用します。
しかし、私は常にこの例外を取得します:
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException: The value of attribute "containsValue" associated with an element type "original_msg_body" must not contain the '<' character.]
どうすれば解決できますか?属性タイプをxs:NMTOKENに変更しようとしましたが、同じ例外が発生します。他にタイプはありますか?
たとえば、<のようなHTML表現を使用して文字エンコードを変更できると思いますが、文字列の比較には注意が必要です...