Skip to content

Question: only paragraphs that are not part of a table? #95

Open

Description

@sixtyfive

Hello! Since OpenOffice XML distinguishes into paragraphs and tables, but every table cell also appears as a paragraph: is there any way to access only those paragraphs that are not inside of a table (MWE where table cells are also appearing in the list of paragraphs)?

Activity

  1. WaKeMaTTa commented on Nov 13, 2020

    @WaKeMaTTa
    Contributor

    Here you have your answers: https://github.com/ruby-docx/docx#reading-tables (# Iterate through tables)

  2. sixtyfive commented on Nov 13, 2020

    @sixtyfive
    Author

    Sorry, misunderstanding, I should have phrased less ambiguously - iterating through (those, or any) tables works just fine.

    My problem is, that they are also ("also" being the operative word!) accessible as paragraphs. What if I want to only iterate through paragraphs which are not inside of a table?

  3. WaKeMaTTa commented on Nov 13, 2020

    @WaKeMaTTa
    Contributor

    @sixtyfive I'm sorry, I'm not understanding the problem that you have.

    Can you create 2 simple files:

    1. The template file.
    2. Result expected file.
  4. sixtyfive commented on Nov 13, 2020

    @sixtyfive
    Author

    Yes, can do. By template file you mean the docx to be read?

  5. WaKeMaTTa commented on Nov 13, 2020

    @WaKeMaTTa
    Contributor

    By template file you mean the docx to be read?

    Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions