【问题标题】:"&" in XML validation using Xerces使用 Xerces 进行 XML 验证中的“&”
【发布时间】:2012-08-24 00:01:00
【问题描述】:

我使用 Xerces 来验证 XML,但是对于枚举为 {Profit & Loss} 的标签

当我以Profit & Loss 给出值时,Xerces 给出错误:

The entity name must immediately follow the '&' in the entity reference.
<in-ab:TypeOfReport>Profit &amp; Loss</in-ab:TypeOfReport>

【问题讨论】:

    标签: xml html-entities xerces


    【解决方案1】:

    你应该使用一个 CDATA 来避免尝试解析 & 符号

    【讨论】:

    • 如何使用 CDATA??请帮忙
    • like this 将字符串括在
    • 它不工作.. 再次显示错误。
    • 我依赖这个标签。如果标签值为“利润和损失”,那么我必须进行一些计算
    • 你知道大写锁定在网络上被看到并不是很高兴,当你与其他人“交谈”时,这意味着不好
    猜你喜欢
    • 2014-03-27
    • 2013-09-02
    • 2014-01-16
    • 2011-05-31
    • 2019-02-15
    • 1970-01-01
    • 1970-01-01
    • 2018-04-10
    • 2012-04-17
    相关资源
    最近更新 更多