简体   繁体   中英

How to Generate DataXML in OpenXML for powerpoint in 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.

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>

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 ie of 2 step ^ and update the src and destination ID and step 1 GUID.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM