Home » XML » XML_Transformer
XML Transformations in PHP
This package is unmaintained.
Download latest release 1.1.2 (archived versions might be outdated)
License: PHP License
Description
The XML Transformer allows the binding of PHP functionality to XML tags to transform an XML document without the need for and the limitations of XSLT.
Documentation
Maintainers
- Sebastian Bergmann (sebastian) — lead, active
- Kristian Kohntopp (kk) — developer, active
Dependencies
Required
- PHP (>= 4.2.0, <= 5.1, exclude 5.1)
- PEAR Installer (>= 1.4.0b1)
- XML_Util (>= 1.1.0)
- pcre (extension)
- xml (extension)
Releases
- 1.1.2 (stable, 2012-04-07)
Release notes
License: PHP License
Fix dir layout
Bug #14681 Security issue due to seeding random number generator - 1.1.1 (stable, 2008-10-25)
Release notes
License: PHP License
Fix dir layout
Bug #14681 Security issue due to seeding random number generator - 1.1.0 (stable, 2004-11-27)
- 1.0.1 (stable, 2004-03-16)
Release notes
License: PHP License
* The collapsing of empty tags (<foo></foo>) into their
short-tag (<foo />) equivalent has been made optional
and is disabled by default to restore backwards
compatibility with XML_Transformer versions prior to
0.9.0. - 1.0.0 (stable, 2004-03-15)
Release notes
License: PHP License
* No functional changes since XML_Transformer-0.9.1.
- 0.9.1 (stable, 2004-03-02)
Release notes
License: PHP License
* Fixed E_NOTICE in XML/Transformer.php.
- 0.9.0 (stable, 2004-02-06)
Release notes
License: PHP License
* XML fragments are now handled more gracefully.
It is now possible, for instance, to return
"<t1/><t2/>" from a closing tag's callback.
by Azundris (http://www.azundris.com)* Entities are no longer unescaped during recursion.
by Azundris (http://www.azundris.com)* Empty elements like "<br></br>" are now transformed
into "<br/>".
by Azundris (http://www.azundris.com)* Refactored debug message system.
- Replaced XML_Transformer_Util::attributesToString()
with XML_Util::attributesToString().- Replaced XML_Transformer_Util::qualifiedElement()
with XML_Util::splitQualifiedName().! The XML_Util package is now required.
- 0.8.2 (stable, 2003-09-11)
Release notes
License: PHP License
* Performance improvements due to changes in the
debug mode. - 0.8.1 (stable, 2003-05-06)
Release notes
License: PHP License
* Bugfix release.
- 0.8 (stable, 2002-10-07)
Release notes
License: PHP License
+ Added DocBook namespace handler.
+ Added Widget namespace handler.
* Renamed XML_Transformer_Cache and XML_Transformer_OutputBuffer
to XML_Transformer_Driver_Cache and XML_Transformer_Driver_OutputBuffer
respectively.* Significant performance improvement by preventing unnecessary
recursive parsing.By returning
array(
$cdata,
true
)instead of
$cdata
a callback handler for the endElement event can notify the
Transformer not to recurively process its result.* Improved debugging information.
* The target to which error messages and debugging information
are beeing sent can now be configured using setLogTarget().The default target is the error.log.
- 0.7 (stable, 2002-09-22)
Release notes
License: PHP License
+ Added Anchor namespace handler.
The Anchor namespace handler implements a database of
indirect links. These links can be maintained centrally
in a single location, and can be used using<a:iref iref="name">...</a>
<a:random/> selects a single random link from the database.
+ Added Image namespace handler.
+ <img:img/> is a replacement for XHTML's <img/> and
automatically determines the size of the image.For this, the image must be in a format that is
understood by getimagesize().
+ <img:gtext /> is a container that renders its contents
as a PNG graphics using ImageTTFText().For this to work, a cache directory below DocumentRoot
that is writeable by the Webserver owner is necessary.
The default is /cache/gtext.
+ <img:gtextdefault /> understands the same attributes as
<img:gtext /> and supplies these to all subsequent calls
of <img:gtext />.+ Namespace handlers can now use getLock() to disable other
namespace handlers for the time of their transformation.
releaseLock() is used to enable all namespace handlers
again.+ Added a caching version of the XML_Transformer that uses
the Cache_Lite PEAR package to cache the result of XML
transformations.+ Added automatic loading of namespace handlers that are
stored in the XML/Transformer/Namespace directory.+ Added new tags to the PHP Namespace Handler:
+ <php:namespace name="a">
<php:define name="b">
<p>The attribute x is $x and the content is $content.</p>
</php:define>
</php:namespace>This will define a new namespace a with a single tag b in it
(You may put multiple defines into a namespace). If you use
<a:b x="text">sometext</a:b>, the variable $x will be replaced
with the text, and the variable $content will be replaced with
the content.+ <php:cookievariable name=""/> inserts the contents of a given
HTTP Cookie into the output XML tree.+ <php:servervariable name=""/> inserts the contents of a
given server variable into the output XML tree.+ <php:logic/> executes a given block of PHP code and stores
its output into the output XML tree.* Refactored the XML_Transformer class into
* XML_Transformer.
* XML_Transformer_CallbackRegistry.
This class faciliates the registration of new callbacks
on-the-fly inside the transformation's recursion.* XML_Transformer_OutputBuffer.
This class decouples the XML transformation from the output
buffering.* XML_Transformer_Util.
Static utility methods.
* Deprecated overloading of single XML elements.
By overloading a special namespace, &MAIN, the old behaviour can
be achieved.* setDefaultCallback() and unsetDefaultCallback() are deprecated.
By overloading the newly introduced &MAIN namespace with a class
that provides default element handlers the old behaviour can
be achieved. - 0.6 (stable, 2002-09-17)
Release notes
License: PHP License
+ Added methods setDefaultCallback() and unsetDefaultCallback() to
set/unset default callbacks for elements that are not overloaded.+ Added a base class for namespace-handling transformer classes.
+ Removed canonicalName() method in favour of more general
canonicalizeAttributes() method.+ Added PHP namespace handler. Initially the following tags are
supported:+ <php:expr/> evaluates a given PHP expression and stores its
return value into the output XML tree.+ <php:getvariable name=""/> inserts the contents of a given
global variable into the output XML tree.+ <php:setvariable name="">value</php:setvariable sets a given
global variable to a given value.+ <php:getparameter name=""/> inserts the contents of a given
HTTP GET parameter into the output XML tree.+ <php:postparameter name=""/> inserts the contents of a given
HTTP POST parameter into the output XML tree.+ <php:sessionvariable name=""/> inserts the contents of a given
session variable into the output XML tree.* Fixed a bug in overloadNamespace()'s error handling.
* Recursive operation can now be selectively turned off for
overloaded namespaces, too.* Attributes are now canonicalized on-the-fly, rather than at
the time of their serialization which can be too late.As a side-effect, the attributesToString() method can now be
called statically.* Fixed recursive transformation of overloaded namespaces.
* Changed license from PHP License 2.02 to PHP License 3.00.
- 0.5 (stable, 2002-09-08)
Release notes
License: PHP License
* Resolved infinite recursion problem that arose when handlers
do not remove the tags of their assigned element from the input
XML document, but only work on it's sub-tree. - 0.4 (stable, 2002-09-04)
Release notes
License: PHP License
+ Added a filtering mechanism to the debugger that limits
the generated debugging information to a given set of
elements.* Debugging information is now sent using error_log()
instead of syslog().* Fixed a bug in the case-folding handling.
- 0.3 (stable, 2002-05-16)
Release notes
License: PHP License
+ Added setDebug() and stackdump() to allow for easier debugging.
+ Added setRecursiveOperation() to enable/disable the recursive
operation of the XML Transformer.* Changed the constructor to be more intuitive and user-friendly.
* Changed setCaseFolding() to accept a second parameter to set
the case to which XML attributes and elements are folded.
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #844 | Duplicate | Bug | 2004-02-23 | Using $this->depth instead of $this->_depth | |
| #1010 | Closed | Bug | 2004-03-14 | PHPdocumentor patch | |
| #2595 | Bogus | Bug | 2004-10-22 | No output if class XML_Transformer_Namespace_Image is involved | |
| #3628 | Closed | Bug | 2005-02-27 | CRITICAL: non-ISO-8859-1 characters in package.xml must be entitied | |
| #5069 | Suspended | Bug | 2005-08-11 | XML_Transformer documentation incorrecty describes non-existant method | |
| #5070 | Suspended | Bug | 2005-08-11 | XML_Transformer documentation very out of date in general | |
| #14681 | Closed | Bug | 1.1.0 | 2008-09-21 | Security issue due to seeding random number generator |
| #20004 | Duplicate | Bug | 1.1.2 | 2013-07-06 | TransformerTest.php has the line "require_once 'PHPUnit2/Framework/TestCase.php |
| #20005 | Closed | Bug | 1.1.2 | 2013-07-06 | TransformerTest.php has the line "require_once 'PHPUnit2/Framework/TestCase.php |
| #20042 | Open | Req | SVN | 2013-08-15 | could you please do a release with the last change in git |