如何在 OpenXML 中为 Java 中的 powerpoint 生成 DataXML [英] How to Generate DataXML in OpenXML for powerpoint in java
问题描述
我在 Microsoft PowerPoint 演示文稿幻灯片中添加了一种智能艺术形状.我已经使用 apache POI 在 Java 中检索了该图表的数据.
I have added one smart art shape in the Microsoft power point presentation slide. I have retrieved the data of that diagram in Java using apache POI.
我想使用 apache poi 或任何其他免费的 Java API 从头开始为该演示文稿生成我自己的 DataXML.我如何生成该 DataXML.
I want to generate my Own DataXML for that presentation from scratch using apache poi or any other free java API. How i can generate that DataXML.
演示文稿仅包含层次智能艺术对象.以下是 XML, 我想从中生成数据 XML.
Presentation consists of hierarchy smart art object only. Following is the XML from which i want to generate the Data XML.
<cds>
<parent name="Hierarchy Parent">
<child id="1" name="Child 1"/>
<child id="2" name="Child 2"/>
</parent>
<parent name="Hierarchy Parent 2">
<child id="1" name="Child 1"/>
<child id="2" name="Child 2"/>
</parent>
推荐答案
我在 apache poi 中找不到任何解决方案.我使用 java 来手动生成 XML.层次结构应该是这样的.
I couldn't find any solution in apache poi. I used java in order to generate manually XML. the hierarchy should be a such a way.
- 在具有唯一 GUID 的指针列表 [ ptlst ] 中创建节点,然后在该节点之后创建父节点和兄弟节点
- 将这些父兄弟节点的连接 ID 更改为新的 GUID 但相同.
- 在列表 [ cxnlst ] 中使用新的 GUID i-e 2 step ^ 创建新的连接节点,并更新 src 和目标 ID 以及 step 1 GUID.
这篇关于如何在 OpenXML 中为 Java 中的 powerpoint 生成 DataXML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!