简体   繁体   English

Docx4j识别表格结束标签

[英]Docx4j identify Table end Tag

Is there a way from Java using docx4j to identify that the table ended (identify table end tag)? Java是否可以使用docx4j来标识表已结束(标识表结束标记)?

I'm looking everywhere and I can't seem to find a way for the code to identify any end tag let alone the table end tag. 我到处都在寻找,似乎无法找到一种方法来标识任何结束标记,更不用说表结束标记了。

In docx4j, a table is represented by a org.docx4j.wml.Tbl object. 在docx4j中,表由org.docx4j.wml.Tbl对象表示。

There is no representation of its end tag at the object level. 在对象级别没有结束标记的表示。

But you can add something before the end tag, as it were, by adding it to the Tbl object. 但是,您可以通过将其添加到Tbl对象中来在end标签之前添加某些内容。

Or you can add something after it, by adding to the content list containing the Tbl object. 或者,您可以在其后添加一些内容,方法是将其添加到包含Tbl对象的内容列表中。

If you need want to work at the level of the actual XML, you can marshall the content to a String, DOM or whatever, manipulate it, then unmarshall. 如果需要在实际XML级别上工作,则可以将内容编组为String,DOM或其​​他内容,对其进行处理,然后再进行编组。 But in practise this isn't usually necessary. 但是实际上,这通常不是必需的。 (Though marshalling to a string is often handy for debugging) (尽管编组为字符串通常很方便进行调试)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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