PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Timothy Edwards   PHP DOCX to XML   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP DOCX to XML
Extract XML files from Microsoft Word DOCX files
Author: By
Last change: Update README.md

Updated for php 8
Date: 1 year ago
Size: 1,392 bytes
 

Contents

Class file image Download

A php class to extract all the XML files from a Word DOCX document and save them as separate XML files

Description

This php class will take a DOCX type Word document and extract all the XML files in it. They will be then all be saved in a directory with the same name as the original DOCX file. This directory will be automatically created if it does not exist. In the normal mode this class will not provide any output to screen. A php demonstration file (xmltest.php) is included.

New in v1.0.1 - Will now save the footnote and endnote relationship XML files if they exist. Note that the Class name has been changed to WordXML - which is what it should have been originally.

New in v1.0.2 - Updated to work in php 8.

USAGE

Include the class in your php script

require_once('wordxml.php');

Normal mode to save all the XML files (no output to screen) - (note the change for v1.0.1)

$rt = new WordXML(false); or $rt = new WordXML();

Display on screen the contents of all XML files found after saving them (note the change for v1.0.1)

$rt = new WordXML(true);

Set the encoding - Only needed when displaying the XML files on screen to ensure that the displayed coding matches that of the calling php script

$rt = new WordXML(true, 'encoding');

Read docx file and save all the XML Files found

$rt->readDocument('FILENAME');