Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1009365 // Parse LibreOffice Draw content.xml for diagrams Spike 2 [dev.]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2164L/15K/52K).

!7

p {
  File odt = loadLibrary(#1009364);
  L<S> tok = htmlTok(loadTextFileFromZip(odt, "content.xml"));
  
  // load styles
  for (L<S> tag : findContainerTag(tok, "style:style")) {
    S style = xml_getArg(tag, "style:name");
    S props = findTag(tag, "style:graphic-properties");
    S start = xml_getArg(props, "draw:marker-start");
    S end = xml_getArg(props, "draw:marker-end");
    print("Style " + style + " arrow? " + start + " - " + end);
  }
  
  for (L<S> tag : findContainerTag(tok, "draw:custom-shape")) {
    S style = xml_getArg(tag, "draw:style-name");
    DoubleRect rect = libreOffice_rect(tag);
    print("\nCustom shape, style=" + style + ", rect: " + rect);
    print("  " + join(tag));
    pnl(libreOffice_textP(tag));
  }
  
  for (L<S> tag : findContainerTag(tok, "draw:line")) {
    S style = xml_getArg(tag, "draw:style-name");
    DoublePt pt1 = libreOffice_pt1(tag);
    DoublePt pt2 = libreOffice_pt2(tag);
    print("\nLine, style=" + style + ", pt1: " + pt1 + ", pt2: " + pt2);
    print("  " + join(tag));
    pnl(libreOffice_textP(tag));
  }
}

Author comment

Began life as a copy of #1009179

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009365
Snippet name: Parse LibreOffice Draw content.xml for diagrams Spike 2 [dev.]
Eternal ID of this version: #1009365/1
Text MD5: 3322bebec54b9cdfd3f9716d389b6743
Transpilation MD5: 4df2121ee6cd4bf62762ad18b823f83e
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-24 23:59:09
Source code size: 1113 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 419 / 469
Referenced in: [show references]