Blog

All posts (105)

Pages: < Previous 1–10 11–20 21–30 31–40 41–50 51–60 61–70 71–80 81–90 91–100 101–110 Next >
Ordering: Ascending Descending

101. DIY Framework v0.1 released

2007-06-04 20:40:23 by Martynas Jusevičius

We are pleased to announce the release of our DIY Framework! It is an open-source web application framework based on MVC architecture, object-oriented PHP 5, MySQL, and XSLT.

The Model is database-backed and generated by Propel ORM tool, the Controller is inspired by REST and RDF, and the View is based on XSLT stylesheets as templates.

The framework allows clean and precise sever-side development with a fully object-oriented code, absolutely no mixing of PHP, (X)HTML and/or SQL code, resources that have nice meaningful URIs with no extra effort, and many other features. On the other hand, it is tiny, flexible, and not overloaded with buzzword things.

Get to know more about the framework and download it under Resources: DIY Framework!

Add a comment Comments (3)

102. Passing side documents to XSLT stylesheets in Java and PHP

2007-06-03 13:49:31 by Martynas Jusevičius

For some transformations, the XSLT stylesheet has to have access to more XML documents than the main one. They can be accessed using the document() function which has to be given a document URI. It is trivial in case the document is a static file in the file system. However, most of the time such documents are formed at run-time. Our templating system is very much based on that. The solution is to give such documents a “fake” URI scheme (such as arg://) and create a way for the XSLT processor to read from it.

In Java, you'll need to implement your own custom URIResolver.

In PHP 4, which had an XSLT extension based on Sablotron processor, one could pass an array of document arguments to the xslt_process() function.

In PHP 5, it is possible to achieve this functionality using stream wrappers that intercept calls from stylesheets. In our framework we have implemented a simplified version of Java's URIResolver interface which uses code by Alexandre Alapetite as its base. For example, in a class extending XSLTView you can pass a serialized object like this:

$this->resolver->setArgument("document-name", XMLSerializer::serialize($object));

Finally, the XSLT code for side document access would be document('arg://document-name').

Add a comment Comments (979)

103. URL encoding with PHP XSL

2007-06-02 14:41:25 by Martynas Jusevičius

In many situations, strings have to be encoded using the % notation before put in the URL, to avoid confusion with reserved characters such as : or /.

XSLT 1.0 has no standard function for URL encoding. In XSLT 2.0, encode-for-uri() function can be used. However, there are solutions for URL encoding in XSLT 1.0.

In case of the ISO-8859-1 charset, one can use encoding/decoding stylesheets from skew.org. It gets much more complicated with UTF-8 and a pure XSLT solution is not realistic — extension functions have to be used instead.

Using PHP's XSL extension, PHP's functions can be called directly from the stylesheet. registerPhpFunctions() method has to be called on the XSLT processor instance and PHP's namespace (http://php.net/xsl) has to be included in the stylesheet before doing that. Then PHP's urlencode() can be called from the stylesheet in such a way: php:function('urlencode', string('value')).

Add a comment Comments (881)

104. Bug in libxsl

2007-06-01 15:34:55 by Martynas Jusevičius

When specified

<xsl:output method="xml" encoding="UTF-8" indent="yes"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>

in the stylesheet, libxsl processor incorrectly adds

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

This meta tag should only be added with method="html", not method="xml".

Add a comment Comments (813)

105. Website launched

2007-05-31 13:16:37 by Martynas Jusevičius

We have launched a brand new website. Now you can find more information on what we do and what we offer to companies and developers. We also plan to blog regularly :)

From the technical point of view, the website is fully searchable, has a valid XHTML markup and table-less fluid CSS layout as well as a RSS 1.0 feed.

Add a comment Comments (5)

Pages: < Previous 1–10 11–20 21–30 31–40 41–50 51–60 61–70 71–80 81–90 91–100 101–110 Next >
Ordering: Ascending Descending