Analyse xml-files in PHP
- Supports large xml-files (stream-base PHP XML Reader)
- Check XML well-formed
- XML validation
- Generate large XML-file for test
- Add errors to XML for test
- Check XML well-formed & validate on enlarged XML-file
Sections below:
- PHP framework
- PHP console howto
- Transform definition
- Transform implementation
- Tools (PHP-editor, Running PHP from console window)
Using a PHP procedural framework with standard generic functionality for code name/version/date, PHP-parameters, INI-setup, XML-setup, log-file, error-file, source-file, transform-implementation section and target-file.
Open Source PHP framework "KDRS-SA/php-procedural-framework":
https://github.com/KDRS-SA/php-procedural-framework
ToDo:
- Coherent overall parameter-definitions from PHP-parameters, INI-setup, XML-setup.
- Implement resulting run-parameters into the PHP-code (read into variables for execution).
Sections
- Check xml well-formed
- Check xml validate
Not implemented yet
3. Add x-repetitions of "mappe" to input file in setup.ini
4. Add y-errors to input file in setup.ini
5. Check xml well-formed on added xml file
6. Check xml validate on added xml file
Only single file implemented in this first version.
Using stream-based XML Reader so large xml-files are supported.
ToDo:
- Implement section 3,4,5,6
- Implement directory (and subdirectories) xml-parsing (to check for well-formed and validation).
- Implement error-traps on all levels.
- Implement isset on all array-elements to be read as parameters from PHP-parameter, INI-setup & XML-setup.
- Implement parameter for paramaeter logging console and/or file (extent from log/nolog as is).
- Complete setup.xml to array XML-setup.
- Implement RunParameter selection from PHP-parameter, setup.ini and setup.xml (uses setup.ini as is).
PHP-editor
Running PHP from console window
geany is a PHP-editor (IDE - Integrated Developer Environment):
https://download.geany.org/geany-1.23_setup.exe
PHP documentation (syntax, functions and parameters):
http://php.net
PHP-client has to be installed our your local computer to be to run PHP from console window.
Setup instructions in Norwegian (to be translated into English).
https://github.com/KDRS-KURS/PHP-eArkivar/blob/master/doc/Programvare%20for%20kurset.pdf
Test if a PHP-cliemt is running correctly on your computer:
-
Push and hold the Windows-button and push button "R" simultaniously.
-
Enter "cmd" i dialog-window and click "OK".
-
The console window is now opened.
-
Enter "php -v" to test the PHP-client running and display version installed (result for ex: [PHP 5.6.5 (cli)...])
-
Navigate in conolse window to directory with the PHP-script to be executed:.
-
Microsoft Windows example: -- Select harddisk C: [cd c:]
-- Move to top-level root-directory: [cd ]
-- Move to desired subdirectory (relative to your location at the moment), ex: "php-test": [cd php-test]
-- List directory content: [dir] -
Run a local PHP-file inside your selected directory, ex. "test.php": [php test.php]
-
That is, "php" folowed by blank space and the name of the PHP-feil to be runned including ".php" at end.
-
Tip: All commands in windows console has as automatically select
the remaining text based on existing files and folders in selected directory.
-- Repeat pushing to scroll through the available options for your so far entered text.
-- Enter "php" and empty space first, and then repeat pushing to loop through the files.
-- You don't have to enter precicely long filenames etc.