PHP Classes
elePHPant
Icontem

PHP XML Remove Spaces: Trim spaces from XML tag values

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-03-20 (3 years ago) RSS 2.0 feedNot enough user ratingsTotal: 179 All time: 8,447 This week: 362Up
Version License PHP version Categories
nospace 1.0.0MIT/X Consortium ...5XML, PHP 5, Text processing
Description Author

This is a very simple class that can remove spaces from XML tag values.

It takes a XML document as a SimpleXMLElement returned for instance by simplexml_load_file and traverses all the document tags.

The class trims the spaces around XML tag values and saves them back to the document.

Innovation Award
PHP Programming Innovation award nominee
November 2015
Number 13
Sometimes you need to process XML files that contain undesired spaces around the tag values.

This class can cleanup a XML document by trimming spaces around XML tag values.

Manuel Lemos
  Performance   Level  
Name: Thiago Augustus Oliveira <contact>
Classes: 1 package by
Country: Brazil Brazil
Age: 36
All time rank: 4059336 in Brazil Brazil
Week rank: 747 Up48 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 1x

 

Details

php-xml-nospace

Scrutinizer Code Quality Build Status Code Climate Build Status

Innovation Award

Remove both side spaces between words in a .xml file

Example

$xml = simplexml_load_file( $xml_file );
var_dump( '<pre>', NoXMLSpace::noSpace($xml) );
  Files folder image Files  
File Role Description
Accessible without login Plain text file LICENSE Data Auxiliary data
Plain text file NoXMLSpace.class.php Class Class source
Accessible without login Plain text file README.md Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:179
This week:0
All time:8,447
This week:362Up