![](/img/trans.png)
[英]org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 61; Attribute “value” must be declared for element type “property”
[英]org.xml.sax.SAXParseException: The value of attribute “id” associated with an element type “Employee” must not contain the '<' character. at
當我嘗試讀取XML解析並且輸入的XML包含一些特殊字符(例如&,<,>和“”)時,出現問題。 使用SAXParse api解析XML時,出現以下異常。
org.xml.sax.SAXParseException: The value of attribute "id" associated with an element type "Employee" must not contain the '<' character. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
請讓我知道如何在XML解析發生之前替換特殊字符。 如果任何人有一段代碼,請分享。
它的巨大幫助! -威斯瓦納特
您需要轉義以下字符 :
" "
' '
< <
> >
& &
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.