XML:格式不正确(无效的令牌)

时间:2019-02-07 16:13:35

标签: xml w3c

为什么这段代码给我错误?

 <clients>
    <client>
     <name!> </name!>
     <cif ></cif>
    </client>
 </clients>

为什么我不能在XML元素名称中使用!字符?有没有反对的规则?

1 个答案:

答案 0 :(得分:5)

W3C XML BNF for XML names不允许 为感叹号( double[] array1 = {2, 4, 6} double[] array2 = {2, 2, 0} public static double[] divide(double[] operand1, double[] operand2) { double[] divArray = new double[operand1.length]; for(int i = 0; i < operand1.length; i++) { if (operand2[i] == 0) { divArray[i] = Double.NaN; } else { divArray[i] = operand1[i] / operand2[i]; } } return divArray; }

!
相关问题