Discussion:
Where is XSLT 2.0 support in PHP?
Jonathan Rosen
2009-07-28 01:15:46 UTC
Permalink
I have been building a project in PHP with XSLT, and am pretty
disappointed with the lack of a workable XSLT 2.0 solution.

The only workable solution I have found so far is this php extension:
http://sourceforge.net/docman/display_doc.php?docid=57770&group_id=197900
along with the AltovaXML COM interface on Windows. It is relatively
easy to install and works seamlessly. The problem is, it is a Windows
only solution. Altova does not appear to make an xml parser for use on
Linux.

The alternatives to this solution on Linux involve using a
PHP/Javabridge to Saxon. I have been working on installing said
PHP/Javabridge using Tomcat on a VPS. I can tell you it has been a
nightmare, especially because of the memory overhead of running a Java
Virtual Machine in parallel with requests from PHP. It is not a
workable production solution, and is a massive time sink to install as
well.

I know this question has probably been asked before. However, now that
there are stable and functional XSLT processors on the market, when
are we going to get one that can be loaded directly into php, a la
lib-xslt for xslt 1.0? The person who coded the solution I linked to
above was in high school when he wrote the code. There must be the
talent out there somewhere to make this happen? Why has none of it
been directed at supporting this standard?

Anyway, I look forward to hearing thoughts on why this standard has
not been embraced in PHP, and how it can be remedied. Having used XSLT
2.0 with the Altova solution, I can say from experience that XSLT 2.0
is a much cleaner and easier to implement language. The Meunchian
Grouping Solution in XSLT 1.0 that made up for the lack of a for-each
function looks pretty absurd compared to the ease of use of the 2.0
for-each-group function. It is also much better form a performance
perspective.

I look forward to your thoughts, and hopefully some actionable steps
on how we can put together the resources to make this happen in PHP. I
myself do not have the programming expertise to make this happen
myself, but would be happy to spearhead an effort to put together the
talent and resources to make it happen.

-Jon

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Michael Ludwig
2009-07-28 01:54:29 UTC
Permalink
Post by Jonathan Rosen
I have been building a project in PHP with XSLT, and am pretty
disappointed with the lack of a workable XSLT 2.0 solution.
Hi Jonathan,

no XSLT 2.0 support is advertised for PHP, as far as I know. The usual
(and perfectly respectable) choice for PHP is LibXSLT, which is 1.0, may
have some quirks, but works fine in general.
Post by Jonathan Rosen
AltovaXML COM interface on Windows [...] Windows only solution.
The alternatives to this solution on Linux involve using a
PHP/Javabridge to Saxon. [...] nightmare
Sorry to hear that. You might want to try Caucho's Quercus, which is a
PHP interpreter coded in Java. It is not complete, but it runs apps such
as Drupal and Wordpress. You can use it with Resin, Tomcat, Jetty etc.
Note that the advertised performance boost is for the commercial version
of Resin.

http://www.caucho.com/
Post by Jonathan Rosen
I know this question has probably been asked before. However, now that
there are stable and functional XSLT processors on the market, when
are we going to get one that can be loaded directly into php, a la
lib-xslt for xslt 1.0? The person who coded the solution I linked to
above was in high school when he wrote the code. There must be the
talent out there somewhere to make this happen? Why has none of it
been directed at supporting this standard?
I wouldn't even dare to think of implementing only 1% of such a beast.
Respect to those who've undertaken it. Personally, why haven't you
directed your talent at supporting this standard? :-)

If you're really interested in this issue, you could ask on the LibXSLT
list, A while ago (several months, maybe a year) there was a discussion
on how LibXSLT could be updated to 2.0. I don't know what has become of
it so far.
Post by Jonathan Rosen
I look forward to your thoughts, and hopefully some actionable steps
on how we can put together the resources to make this happen in PHP.
In order to work for PHP (Perl, Python, Ruby), this would have to happen
in C or C++. Certainly no small feat.
Post by Jonathan Rosen
I myself do not have the programming expertise to make this happen
myself, but would be happy to spearhead an effort to put together the
talent and resources to make it happen.
Sounds like a so-called "project manager" :-)

Anyway, good luck with your efforts.

Michael Ludwig

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Alexander Johannesen
2009-07-28 02:55:42 UTC
Permalink
Post by Michael Ludwig
If you're really interested in this issue, you could ask on the LibXSLT
list, A while ago (several months, maybe a year) there was a discussion
on how LibXSLT could be updated to 2.0. I don't know what has become of
it so far.
Yeah, this discussion comes up now and then. I think the short answer
is, if you've got the time to do it, by all means do it, but the
LibXSLT / LibXML guys are busy doing other things and don't have any
pressing *reason* for doing XSLT 2.0; it requires a rewrite of the
LibXML as well as a new LibXSLT (XSLT 2.0 isn't simply a refinement of
the 1.0 standard; it seriously alters basic premises), and this is
sounding more like a "10 developers for a couple of years" project
more than something any geezer can whip up in a school term. XSLT 2.0
may be cleaner, but it is by no means easier to implement.

Now, if your PHP-foo is high, there's plenty of extensions to what's
there in order to do most things you want, including regExp and
for-each-group. It's not a purist approach, but very pragmatic and -
quite possibly - the reason no one is pushing hard on native support
for it right now. There's simply not enough people demanding it, and
there's probably some good reason for it;

PHP is the pragmatist hackers platform, not a purist haven (although
PHP 6 is looking sexy!) PHP is not really your average Enterprise
stack, and even if XSLT 2.0 brings a lot of handy and excellent
solutions to where traditionally Enterprisey stacks go, the RESTful
nature of the PHP calls demands a quick and low-footprint response, so
we tend to keep it simple. Not to say that XSLT 2.0 would far more
complex, but switching from XSLT 1.0 to 2.0 on the PHP stack is not
the same as simply importing in Java or Ruby, another technical reason
for its delay.

The short answer, I think, is, if you've got the time, knock yourself
out. If not, rally up good reasons for doing it, and then rally up
other people agreeing with you. And then report your findings in a
positive way, and even better yet, find a sponsor that needs XSLT 2.0
as bad as you do. Or go all the way, and find someone with an XSLT 2.0
processor that's willing to donate their hard work to open-source! And
then we might see it happening. Or not. :)


Regards,

Alex
--
Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps
--- http://shelter.nu/blog/ ----------------------------------------------
------------------ http://www.google.com/profiles/alexander.johannesen ---

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
bryan rasmussen
2009-08-02 20:19:04 UTC
Permalink
On Tue, Jul 28, 2009 at 4:55 AM, Alexander
Post by Alexander Johannesen
Post by Michael Ludwig
If you're really interested in this issue, you could ask on the LibXSLT
list, A while ago (several months, maybe a year) there was a discussion
on how LibXSLT could be updated to 2.0. I don't know what has become of
it so far.
Now, if your PHP-foo is high, there's plenty of extensions to what's
there in order to do most things you want, including regExp and
for-each-group. It's not a purist approach, but very pragmatic and -
quite possibly - the reason no one is pushing hard on native support
for it right now. There's simply not enough people demanding it, and
there's probably some good reason for it;
How far would you say the PHP with extensions stack can go to handle
the functionality of XSLT 2.0 - minus XSD integration? What things are
absolutely missing?

I suppose that even if the above is an easy task that doing something
like enforcing side-effects free usage of the extensions would be
basically impossible (especially given the aforementioned pragmatism
of php and that side-effects are allowed in extensions)

Best Regards,

Bryan Rasmussen

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Alexander Johannesen
2009-08-02 22:52:23 UTC
Permalink
Post by bryan rasmussen
How far would you say the PHP with extensions stack can go to handle
the functionality of XSLT 2.0 - minus XSD integration? What things are
absolutely missing?
Well, using the DOM library in PHP, there really is nothing that you
can't do that XSLT 2.0 can do, anything from regExp and grouping to
lots of stuff that xSLT 2.0 in itself can't (and shouldn't) do. I once
did an inverse XSLT framework where program-flow was done through XML
and XSLT, and program execution was extensions, and it works quite
fast, too, even though it may not be the best way to go about things.
:)
Post by bryan rasmussen
I suppose that even if the above is an easy task that doing something
like enforcing side-effects free usage of the extensions would be
basically impossible (especially given the aforementioned pragmatism
of php and that side-effects are allowed in extensions)
Well, you probably can't guarantee that, no, but with a bit of smart
OO in the PHP layer I'm sure you can write interfaces and taxonomies
that guarantee it through *those* classes. But I reckon it's smarter
to just go Saxon (even with that PHP <-> Java bridge) as it truly
kicks ass.


Regards,

Alex
--
Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps
--- http://shelter.nu/blog/ ----------------------------------------------
------------------ http://www.google.com/profiles/alexander.johannesen ---

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Joseph Dane
2009-07-28 02:41:11 UTC
Permalink
Post by Jonathan Rosen
I have been building a project in PHP with XSLT, and am pretty
disappointed with the lack of a workable XSLT 2.0 solution.
one option might be here:

http://quercus.caucho.com/

it is claimed that this is a pure java implementation of PHP. I've
never used it, I've had a good experience with other of the company's
products. I expect there'd be a way to expose saxon/java to PHP apps.
--
joe


--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Michael Kay
2009-07-28 08:22:15 UTC
Permalink
Yes, there's a big gap in the market here.

Unfortunately there seems to be a shortage of people prepared to invest
what's probably 5 man years of (top-class) programming effort - or more like
50 years if you're a big corporation, where things take longer - into
producing something that then gets given away for free. I really can't
imagine why.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
-----Original Message-----
Sent: 28 July 2009 02:16
Subject: [xsl] Where is XSLT 2.0 support in PHP?
I have been building a project in PHP with XSLT, and am
pretty disappointed with the lack of a workable XSLT 2.0 solution.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Continue reading on narkive:
Loading...