Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sixtyfive opened this issue Nov 13, 2020 · 5 comments
Open

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

sixtyfive opened this issue Nov 13, 2020 · 5 comments

Comments

@sixtyfive
Copy link

sixtyfive commented Nov 13, 2020

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)?

@WaKeMaTTa
Copy link
Contributor

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

@sixtyfive
Copy link
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?

@WaKeMaTTa
Copy link
Contributor

WaKeMaTTa commented Nov 13, 2020

@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.

@sixtyfive
Copy link
Author

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

@WaKeMaTTa
Copy link
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
Projects
None yet
Development

No branches or pull requests

2 participants