News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Weier O'Phinney's Blog:
Converting DocBook4 to DocBook5
July 20, 2011 @ 09:55:50

In this new post to his blog Matthew Weier O'Phinney looks at the steps he took to convert over the documentation for the Zend Framework 2 from the DocBook 4 formatting over to DocBook 5. Included in the post is some of the (PHP and bash) code he used to make the switch.

Within the Zend Framework 2 repository, I recently performed a conversion from DocBook 4 to 5. [...] Interestingly, for DocBook5 being available in beta since 2005 and an official standard since 2009, there is very little material on migrating from DocBook 4 to 5.

Right from the start he came across a few problems with the included conversion process that're a part of the "db4-update.xsl" definitions. He has a list of eight steps he had to perform on the current DocBook 4 formatted documentation to make the conversion work smoothly including:

  • Identify files containing entity declarations, and skip them.
  • Run the XML file through the db4-upgrade.xsl stylesheet and restore XML entities from the previously placed markers
  • Fix programlisting elements (replaces entities with original text and wraps in CDATA).

He details these steps in a few different sections talking about handling the entities, creating some helper scripts and how to put the two code parts together in a single bash script that can be run on the entire documentation set. If you're just looking for the code, you can find it on his github account.

0 comments voice your opinion now!
convert docbook4 docbook5 xsl entities xml bash


Ibuildings techPortal:
Transforming XML with PHP and XSL
December 16, 2009 @ 08:35:37

New on the Ibuildings techPortal today is an article from Michael looking at XML transformation with PHP and XSL (XML-based "style sheets").

If you want to transform XML from one format to another, and especially if either the input or output XML is complicated or the transformation itself is difficult or awkward to express, then XSL may be a good choice. XSL is the eXtensible Stylesheet Language; a family of three W3C recommendations to do with the transformation and presentation of XML documents. This article will walk through some examples of how XSL and PHP can be used to achieve these types of XML tranformations.

He starts off by describing what XSL looks like and how it relates back to the XML you're applying it to. XSL allows you to take an XML file and work with it as a data source to pull bits of information out of or modify and push back out the other side. He gives three specific examples: pulling information out of an XML file, rewriting URLs and one of the more handy things PHP allows you to do - directly call PHP script inside the XSL document for those things that the normal XSL standards don't include.

1 comment voice your opinion now!
tutorial xml xsl transform


Alexey Zakhlestin's Blog:
XSLCache in PECL
August 27, 2009 @ 07:56:09

In a new post to his blog Alexey Zakhlestin talks about the "rebirth" of the XSLCache extension for PHP, this time as a PECL module.

XSLCache extension for PHP, originally developed by NYTimes started its second life in PECL's repository and I am proud to announce first PECL-release. The XSL Cache extension is a modification of PHP's standard XSL extension that caches the parsed XSL stylesheet representation between sessions for 2.5x boost in performance for sites that repeatedly apply the same transform.

It works with the normal XSL extension with some small differences around which classname to use and a change to the importStylesheet function.

0 comments voice your opinion now!
pecl extension xslcache xsl


Christian Weiske's Blog:
PEARhd steaming on
October 16, 2008 @ 08:49:02

Christian Weiske set out on a project - no small thing - to convert the current PEAR documentation info over to the PhD DocBook rendering system. In a new post he talks about the conversion process and some of the technology involved.

The reason for PhD to exist was that the previously used DSSSL based system was slow: a full build (all formats and all languages) took 24 hours to complete. Further, the tools the system based on were old, rusty and nobody understood why they broke on some machines, but also why they worked on other ones. Having a php-based system for PHP ensures that there is always someone around who can fix it if it's broken. This wasn't the case with the old documentation build system.

The conversion was spurred on by the fact that the PEAR documentation stopped building and more and more people were finding it hard to build on their machines too. He walks through the steps he took - installing PhD, converting over the docs to the DocBook 5 format and the first builds with the new system.

Now that at the XML was shiny, too, it was time to actually use PhD on it. The numbers were amazing: While a build for one format and one language took around 40 minutes on my system (dual core Macbook with 2GHz and 2GiB RAM), building the same with PhD takes 45 seconds!
0 comments voice your opinion now!
pear documentation docbook phd render xml xsl


Francois Zaninotto's Blog:
Validating a YAML file against a schema in PHP
September 24, 2008 @ 12:58:35

Francois Zaninotto submitted a tutorial he's written up about creating a YAML validation script with PHP.

As of today, there is no simple way to validate the syntax of a YAML file in PHP. But with two simple tricks, it takes only a few dozens of lines of code to build a robust validator capable of checking the syntax of any YAML file against a given schema.

He points out that Ruby has a tool for this (kwalify) but PHP doesn't. He creates his own with the help of the sfYaml component from the symfony framework, translating the YAML data into something PHP can parse more easily - XML. He passes this through an XSL parser and uses the DOM XML schemaValidate function to check it against the given schema.

0 comments voice your opinion now!
yaml validate tutorial schema xsl domxml sfyaml symfony framework


PHP.net:
Update to PHP 5.2.6 Release (XSL & IMAP)
May 06, 2008 @ 08:49:05

The PHP group has made a two quick updates to the recent release of PHP 5.2.6 for the Windows users out there:

The Windows installers and archives were missing the XSL and IMAP extensions.

These updated packages can be downloaded from the Downloads page on PHP.net as usual (with each updated package having a note indicating the change).

0 comments voice your opinion now!
xsl phpnet update imap extension windows installer


Zend Developer Zone:
XML and PHP 5
August 01, 2007 @ 10:13:00

The Zend Developer Zone has a new tutorial posted looking at PHP5 and the new XML tools that it has to offer - as broken up into categories:

Things are a bit different using XML in PHP 5. In a similar scenario, you could use one of the new native extensions, like DOM or SimpleXML, to manipulate the XML data tree. This tree can then be passed directly to and used by the XSL extension without incurring any additional overhead. There is no serialization nor copying involved; ext/xsl is able to work directly with the XML tree it is given, resulting in a significant improvement in use of system resources as compared to coding a similar task in PHP 4. So now that you have an idea why XML support got a face lift, you might like to know about the different tools available to you.
0 comments voice your opinion now!
xml php5 tutorial introduction dom xsl xmlreader xmlwriter simplexml xml php5 tutorial introduction dom xsl xmlreader xmlwriter simplexml


IBM developerWorks:
Turn SQL into XML with PHP
July 25, 2007 @ 09:21:00

On the IBM developerWorks site today, there's a new tutorial by Vikram Vaswani walking through the use of the XML_Query2XML PEAR package to pull data from your SQL database and push it into an XML structure.

Ever wished for an easy way to transform SQL result sets into XML? It's a PEAR package named XML_Query2XML, and it provides a comprehensive framework to efficiently turn the results of a database query into a customizable XML document. This article introduces the package, and demonstrates useful real-world applications, including using it with XSL and XPath, combining it with data from external Web services, and creating database dump files.

They go through the installation and the steps to create the XML:

  • Convert SQL to XML
  • Transform XML output with XSL
  • Customize XML output
  • Work with SQL joins
  • Filter SQL records with XPath
  • Merge data from multiple sources
  • Create database backups

Check out the full tutorial for an excellent guide to using this powerful PEAR package.

0 comments voice your opinion now!
pear xmlquery2xml xsl xpath join install backup pear xmlquery2xml xsl xpath join install backup


PHP.net:
PHP Manual Updates
February 05, 2007 @ 09:41:00

The PHP Group has announced some big updates to one of the finest manuals for an open source project out there today - the manual found on the PHP website.

Updates to the manual include:

  • an improved, XSL-based build system that will deliver compiled manuals to mirrors in a more timely manner (goodbye dsssl)
  • manual pages can now contain images (see imagearc() for an example)
  • updated function version information and capture system (fewer "no version information, might be only in CVS" messages)

Of course, help from the community helps things even more, so they request helping out or just submitting bug reports for problems found in the documentation or user comments.

0 comments voice your opinion now!
manual website update xsl images version function information manual website update xsl images version function information


PHPBuilder.com:
Using XML - Part 6 Validation
July 20, 2006 @ 09:46:37

PHPBuilder.com has posted part six of their "Using XML" series today with a focus on validation techniques using both normal PHP abilities and the XSL functionality in PHP5 with the Schematron language.

This series has so far focused on XML technologies and how they can be utilised using PHP 5. A subject we have not touched upon yet, is XML validation. This article will explore the application independent XML validation standards of DTD's, the XML Schema Language and the XSLT-based Schematron language.

They point back to part one of the series for the XML library they'll use and waste no time getting right into the code. They demonstrate a simple validation first before moving on to the use of DTDs to ensure the correct content. Next up is more work with the XML schemas continuing on to the Schematron functionality (their use and validation).

0 comments voice your opinion now!
xml validation xsl schematron dtd dom tutorial part6 xml validation xsl schematron dtd dom tutorial part6



Community Events





Don't see your event here?
Let us know!


language deployment conference podcast release symfony voicesoftheelephpant framework laravel zendserver list threedevsandamaybe code tips api community interview series bugfix introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework