How to Generate DataXML in OpenXML for powerpoint in java

心已入冬 提交于 2019-12-14 02:49:42

问题


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.

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.

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>


回答1:


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.

  1. Create node in pointer list [ ptlst ] with unique GUID and after that node create parent and sibling node
  2. Change those parent sibling nodes connection ID to new GUiD but same.
  3. Create new connection node in list [ cxnlst ] with new GUID i-e of 2 step ^ and update the src and destination ID and step 1 GUID.



来源:https://stackoverflow.com/questions/30704532/how-to-generate-dataxml-in-openxml-for-powerpoint-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!