An invalid XML character (Unicode: 0x10) was found in the value of attribute
通過SAX解析document的時候,出現了An invalid XML character (Unicode: 0x10) was found in the value of attribute的異常,找了好久發現是因為文件中有不合法的字元。
這些錯誤的發生是由於一些不可見的特殊字元的存在,而這些字元對於XMl檔案來說又是非法的,所以XML解析器在解析時會發生異常,官方定義了XML的無效字元分為三段:
0x00 - 0x08
0x0b - 0x0c
0x0e - 0x1f
因此我在解析的時候新增上了string.replaceAll(“[\x00-\x08\x0b-\x0c\x0e-\x1f]”, “”); 來處理掉特殊的字元。
參考文章
SAX解析文件
相關文章
- 微信公眾號 報 An invalid XML character (Unicode: 0x1a) was found in the CDATA sectioXMLUnicode
- IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokensExceptionHTTP
- found an invalid color
- SpringBoot升級到3.2.0報錯Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.StringSpring BootBeanObjectJava
- 已解決:Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 問題
- Python 錯誤 SyntaxError: invalid character in identifierPythonErrorIDE
- python: invalid value encountered in divide以及invalid value encountered in double_scalars報錯PythonIDE
- According to TLD or attribute directive in tag file, attribute value does not accept any expressionExpress
- mybatis竟然報"Invalid value for getInt()"MyBatis
- vector android:fillType gradient android:endX attribute not foundAndroid
- get_attribute ('textContent') 和 get_attribute ('value') 有什麼區別
- DataPump Export (EXPDP) Fails With Error LPX-216 Invalid CharacterExportAIError
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)ApacheBATException
- Jsp Unescaped xml character報錯的解決辦法JSXML
- MybatisPlus自帶方法報錯BindingException: Invalid bound statement (not found)MyBatisException
- IDEA+Maven:invalid bound statement (not found)解決辦法IdeaMaven
- 報錯Invalid bound statement (not found): com.thxy.mapper.RoleMapper.insertRleAPP
- IDEA+Maven+Springboot:invalid bound statement (not found) 解決辦法IdeaMavenSpring Boot
- yum安裝軟體報錯:Invalid configuration value: failovermethod=priority...AI
- mysql-timestamp 0000-00-00 00:00:00 Invalid default valueMySql
- 解析XML檔案時,無效的XML 字元 (Unicode: 0x7)異常處理XML字元Unicode
- streamlit run執行報錯,Invalid value: File does not exist: XXX.py
- Java更新資料庫報錯:Data truncation: Cannot create a JSON value from a string with CHARACTER SETJava資料庫JSON
- 查LOB文字內容報錯ORA-06502: numeric or value error: character string buffer..Error
- [Vue warn]: Invalid prop: type check failed for prop "unlinkPanels". Expected Boolean, got String with value "true".VueAIBooleanGo
- MyBatis繫結錯誤:org.apache.ibatis.binding.BindingException:Invalid bound statement (not found)MyBatisApacheException
- mybatis配置時出現org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)MyBatisApacheException
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): yycg.business.dao.mApacheBATException
- ISSAC GYM解決RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)的問題ErrorVRGPU
- 達夢資料庫啟動報code = -803 [Invalid ini config value]錯誤資料庫
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- mybatis-plus自定義mapper報org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)MyBatisAPPApacheException
- Ubuntu 20.04 安裝 php-xml 模組(報錯:Class 'DOMDocument' not found )UbuntuPHPXML
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)的問題處理方式之一ApacheBATException
- unicodeUnicode
- Attribute Checks
- __attribute__
- clang attribute