Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有任何 XML 到对象转换器可以再次转换回来,以确保文件完全重复?我在 CPAN 上找不到任何可以确保文件可以完全按照制作的方式进出的内容。
这在任何语言中都是不可能的,因为 XML 有不同的方式来表示相同的数据。
包含 xml 实体的文本数据可以通过转义实体或将内容包装在 CDATA 部分中来表示。
空标签可以表示为<tag/>或<tag></tag>。
<tag/>
<tag></tag>
一些空白是微不足道的,可能会被改变。
由于多个文本 xml 表示可以表示相同的 DOM 结构,因此无法保证将 xml 文本读取到 DOM 中,再次将其写出来并获得完全相同的结果。