Replies: 3   Views: 1899
Clone heading
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by Nurlybek  · 06-02-2019 - 10:46


How i can clone heading with content? I try use cloneWordConten, but what type should i use?

Posted by admin  · 06-02-2019 - 12:28


Headings are paragraphs with an extra tag:

<w:outlineLvl val="{heading level}">

You can query a heading as a paragraph content, this is by its content, position... If the heading level is not set as an external style, you can query by the outlineLvl tag using the attributes option or a custom query with DOCXPath.


Posted by Nurlybek  · 07-02-2019 - 07:27

Are there any examples?

Posted by admin  · 07-02-2019 - 07:34


Yes, in the examples/DocxPath folder you can find a lot samples.

For example, DocxPath/insertWordFragment/sample_3.php sets a paragraph with an outlineLvl attribute value as reference node.