Author: Timothy Edwards
Viewers: 493
Last month viewers: 27
Package: PHP DOCX to XML
Read this short article to learn how to process DOCX document files to extract relevant XML documents that they contain.
In this article you will learn:
Why Would You Want to Use the PHP DOCX to XML Class
How You Can Use the PHP DOCX to XML Class
Download or Install the PHP DOCX to XML Package Using PHP Composer
Why Would You Want to Use the PHP DOCX to XML Class
As a result of me recently producing the PHP Parse DOCX to HTML with images class, I thought that some sections of the code would be useful as standalone classes.
I therefore created this class which will extract all the XML files from a Word DOCX file and then save them as separate XML files in a directory with the same name as the original Word file.
These XML files can then be accessed and process as desired by your own applications, like for instance extracting parts of a document such as tables that have useful financial information.
How You Can Use the PHP DOCX to XML Class
Normal usage of this class is very simple as can be seen from the Readme file and the provided demonstration file xmltest.php that you may see below.<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php
require_once('wordxml.php');
$rt = new WordXML(false);
$rt->readDocument('sample.docx');
?>
</body>
Download or Install the PHP DOCX to XML Package Using PHP Composer
You can download or install the PHP DOCX to XML package using PHP Composer tool by going to this download page to get the package code. That page also contains instructions on how to install package using PHP Composer from the PHP Classes site.
You need to be a registered user or login to post a comment
1,616,107 PHP developers registered to the PHP Classes site.
Be One of Us!
Login Immediately with your account on:
Comments:
No comments were submitted yet.