我在java中使用SAX解析器来读取一些XML。我给它的XML有问题并导致解析失败。以下是错误消息:XML非法属性值
11-18 10:25:37.290: W/System.err(3712): org.xml.sax.SAXParseException: Illegal: "<" inside attribute value (position:START_TAG <question text='null'>@1:23 in [email protected])
我有一种感觉,它不喜欢的事实,我在XML字符串内的一些HTML标签。从语法的角度来看,我认为引号内的任何内容都会被忽略。另外,这里使用单引号是否有效?这里有一个例子:
<quiz>
<question text="<img src='//files/alex/hilltf.PNG' alt='hill' style='max-width:400px' /> is represented on map by cut. ">
<answer text="1"/>
<answer text="2" correct="true"/>
</question>
</quiz>
你的问题到底是什么?如果XML有问题,难道你不希望解析器告诉你它们吗? –