特殊字符是不允许在XML文件中的Andr​​oid资源文件夹 [英] special characters is not allow in xml file in asset folder in Android

查看:125
本文介绍了特殊字符是不允许在XML文件中的Andr​​oid资源文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何形成良好的XML文件中的资源文件夹中Android.org.apache.harmony.xml.ExpatParser $ ParseException的:在第19行,列24:没有良好的(标记无效) 在org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:520) 在org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:479)

How to well formed in xml file in Asset folder in Android.org.apache.harmony.xml.ExpatParser$ParseException: At line 19, column 24:not well-formed (invalid token) at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:520) at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:479)

下面是XML文件

<?xml version="1.0" encoding="UTF-8"?>
<menu>
   <item>
        <QNO>50</QNO>    
        <QUESTIONS>Which declaration of the main method below would allow a class to be started as a standalone program. Select the one correct answer.</QUESTIONS>
        <ANSWER>35,35</ANSWER>
        <OPTIONA>35,35</OPTIONA>
        <OPTIONB>35,40</OPTIONB>
        <OPTIONC>36,32</OPTIONC>
        <OPTIOND>None of these</OPTIOND>
        <EXPLAINATION>NONE</EXPLAINATION>       
        <QUESTIONTYPE>JAVA</QUESTIONTYPE>
    </item>
<item>
        <QNO>49</QNO>    
        <QUESTIONS>What all gets printed when the following code is compiled and run? Select the three correct answers.
 public class xyz {
   public static void main(String args[]) {
      for(int i = 0; i < 2; i++) {
         for(int j = 2; j>= 0; j--) {
            if(i == j) break;
            System.out.println("i=" + i + " j="+j);
         }
      }
   }
}</QUESTIONS>
        <ANSWER>35,35</ANSWER>
        <OPTIONA>35,35</OPTIONA>
        <OPTIONB>35,40</OPTIONB>
        <OPTIONC>36,32</OPTIONC>
        <OPTIOND>None of these</OPTIOND>
        <EXPLAINATION>NONE</EXPLAINATION>       
        <QUESTIONTYPE>JAVA</QUESTIONTYPE>
    </item>
<item>
<menu>

在第19行,列24 =公共静态无效的主要(字符串的args []){的for(int i = 0;我2;我++){

At line 19, column 24 =public static void main(String args[]) {for(int i = 0; i < 2; i++) {

推荐答案

在code片段包含&LT; 这也是XML元字符开始的标签。

The code snippet contains < which is also the XML metacharacter for starting a tag.

请更换&LT; &放大器; LT; 或包裹code在未解析CDATA块:

Either replace < with &lt; or wrap the code in unparsed CDATA block:

<![CDATA[ ... ]]>

这篇关于特殊字符是不允许在XML文件中的Andr​​oid资源文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆