来自PHP DOM的单元格中的Excel XML换行符 [英] Excel XML Line Breaks within Cell from PHP DOM

查看:57
本文介绍了来自PHP DOM的单元格中的Excel XML换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Excel XML文档中插入新行.我需要插入的实体是
 ,但是每当我将其插入PHP DOM时,它只会将其转换为正常的换行符.

I am trying to insert new lines into an Excel XML document. The entity that I need to insert is 
 but whenever I insert that into PHP DOM, it just converts it to a normal line break.

这就是我得到的:

<Cell><Data>text
text2
</Data></Cell>

这就是我想要的:

<Cell><Data>text&#10;text2&#10;</Data></Cell>

我无法弄清楚如何插入新行并以这种方式对其进行编码,或者添加没有该字符的字符,要么对其进行双重编码,要么将其转换为新行.

I cannot figure out how to insert a new line and get it to encode that way, or add that character without it either double encoding it, or converting it to a new line.

感谢您的帮助!

推荐答案

使用CDATA部分...

Use a CDATA section...

这篇关于来自PHP DOM的单元格中的Excel XML换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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