在 XML 中显示 HTML 标签

发布于 2024-12-03 00:08:00 字数 128 浏览 3 评论 0原文

如果我想

<html xmlns="http://www.w3.org/1999/xhtml">

在 HTML 中显示:标签,如何将其注册为数据而不是 HTML?

If I want to show:

<html xmlns="http://www.w3.org/1999/xhtml">

tags in HTML, how can I register this as Data instead of HTML?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

黑凤梨 2024-12-10 00:08:00

将它们包装在 CDATA 部分中:

<some_xml_element>
    <![CDATA[
        <p>Where is<br/>pancakes house?</p>
    ]]>
</some_xml_element>

Wrap them in a CDATA section:

<some_xml_element>
    <![CDATA[
        <p>Where is<br/>pancakes house?</p>
    ]]>
</some_xml_element>
一枫情书 2024-12-10 00:08:00

...或转义特殊字符:

<html xmlns="http://www.w3.org/1999/xhtml">

... or escaping special characters:

<html xmlns="http://www.w3.org/1999/xhtml">
絕版丫頭 2024-12-10 00:08:00

您可以为 HTML 标记或 XML 标记指定不同的命名空间。您必须编写类似 ......... 的内容。

如果您不需要解析 HTML 标记,您可以将整个内容放入

You can give either HTML tags or your XML markup a differrent namespace. You'll have to write something like <foo>...<h:html>...</h:html>...</foo>.

If you don't need to parse the HTML tags, you can just put the whole thing inside a <![CDATA[...]]>.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文