XML托架返回编码

发布于 2025-02-08 05:19:53 字数 165 浏览 1 评论 0原文

我打算代表XML节点中的马车返回。
我尝试了一个没有运气和\ n的六角实体。通过浏览器查看。

例子

<Quote>
Alas, poor Yorick!
I knew him
</Quote>

谢谢。

I was looking to represent a carriage return within an xml node.
I have tried a whitespace preserve, hex entity with no luck- and a \n. viewing via a browser.

Example

<Quote>
Alas, poor Yorick!
I knew him
</Quote>

Thanks.

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

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

发布评论

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

评论(3

余生一个溪 2025-02-15 05:19:54

要将CR插入XML中,您需要使用其字符实体&amp;#13;

这是因为在解析之前,必须将符合性的XML解析器转换为CRLF,而不会将LF随后的CR转换为单个LF。此行为是在

To insert a CR into XML, you need to use its character entity .

This is because compliant XML parsers must, before parsing, translate CRLF and any CR not followed by a LF to a single LF. This behavior is defined in the End-of-Line handling section of the XML 1.0 specification.

┼── 2025-02-15 05:19:54

XML:Space =“ Preserve”必须为所有合规的XML解析器工作。

但是,请注意,在html中,线路断开只是空格而不是线路休息(这是用&lt; br /&gt; < /code>(x)HTML标签表示的,也许这是您存在的问题 。

面对

xml:space="preserve" has to work for all compliant XML parsers.

However, note that in HTML the line break is just whitespace and NOT a line break (this is represented with the <br /> (X)HTML tag, maybe this is the problem which you are facing.

You can also add and/or to insert CR/LF characters.

土豪我们做朋友吧 2025-02-15 05:19:54

浏览器不会可靠地向您显示空白。我建议Linux“ OD”命令查看实际上的内容。合并XML解析器将尊重您列出的所有方法。

A browser isn't going to show you white space reliably. I recommend the Linux 'od' command to see what's really in there. Comforming XML parsers will respect all of the methods you listed.

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