有没有办法在 XML 文件中包含大于或小于符号? [英] Is there a way to include greater than or less than signs in an XML file?

查看:32
本文介绍了有没有办法在 XML 文件中包含大于或小于符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个来自客户端的 XML 文件,其中包含大于 > 且小于 < 的符号,但它未通过 XML 格式检查.有没有办法在不要求客户修复文件的情况下解决这个问题?

I have an XML file from a client that has greater than > and less than < signs in it and it fails an XML format check. Is there a way to get around this without asking the client to fix the file?

例如

<?xml version="1.0" encoding="UTF-8"?>

<note Name="PrintPgmInfo <> VDD">
 <to>Tove</to>
 <from>Jani</from>
 <heading>Reminder</heading>
 <body>Don't forget me this weekend!</body>
</note>

推荐答案

你可以尝试这样使用它:

You may try to use it like this:

< = &lt;

> = &gt;

这些被称为字符实体引用

这篇关于有没有办法在 XML 文件中包含大于或小于符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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