Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6610 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Hi Brian,

There are always good reasons to switch to PHP, below I will outline some that specifically apply to your situation:

is there any advantage in looking to switch to php instead?

While existing solutions that work with XSL do not need to be switched, a time might come when you want to upgrade them to use more robust programming. PHP allows you to use very powerful code which is hidden from the user, anywhere from connections to multiple databases to image manipulation.

Is php faster than xsl?

PHP can be significantly faster than XSL for advanced string transformation functions and other extensive data processing. But just like with any two languages, it all depends on the application - so speed should be compared on a case by case basis.

Is php easier to code than xsl?

From my own experience, yes - once you learn PHP it is extremely easy to use. It has many intuitive functions that can be used effortlessly. Also with a good set of include files you can develop applications rapidly with PHP and FileMaker.

Can you do more in php than xsl?

XSL was never designed to be a full fledged language, but only for data transformations and presentation. PHP was designed to be a whole engine which allows it to perform a vast amount of operations. Some of my favorites:

- connecting to remote sites to grab data

- multiple data sources support

- very complex text transformations using the Regular Expression engine

- file uploading and image manipulation

- dynamic PDF generation

- dynamic Excel worksheet generation WITH formatting (column widths, colors, text formats)

- and many more...

In Kindness

Stephen K Knight

http://www.fmwebschool.com

800.353.7950 / 386.453.5843

FMWebschool, we bring the web to life

FX.PHP PHP XML MySQL CDML ASP

Edited by Guest
  • 2 weeks later...
Posted

It all depends on what you need to do, and possibly your resources. I happen to do both...

Posted

with all programing languages and operating systems used you have to think what it is you want to do and then have a future looking vision as to what you want to do in the future.

With PHP vs xsl it may be like betting on a horse. both may cross the finish line and one may be fast today, but will it be around winning races tomorrow.

PHP has legs right now and the momentum in development, resources, etc is swinging clearly that way.

  • 4 weeks later...
Posted

with all programing languages and operating systems used you have to think what it is you want to do and then have a future looking vision as to what you want to do in the future.

With PHP vs xsl it may be like betting on a horse. both may cross the finish line and one may be fast today, but will it be around winning races tomorrow.

PHP has legs right now and the momentum in development, resources, etc is swinging clearly that way.

Have you seen that PHP can *do* XML and XSLT? I don't think it's a matter of what horse is "ahead". These are both really great technologies!!

  • 2 weeks later...
Posted (edited)

... robust programming. PHP allows you to use very powerful code which is hidden from the user, anywhere from connections to multiple databases to image manipulation.

Some critical comments : ;) :

How is "robust" defined?

XSLT stylesheets are also server-side, users don't see the code.

My only concern about PHP is security. PHP has MANY security issues, and you have to patch PHP every few weeks. See e.g. this recent report

Is php easier to code than xsl?

From my own experience, yes - once you learn PHP it is extremely easy to use. It has many intuitive functions that can be used effortlessly.

Agreed. PHP compares more to scripting and programming languages such as JavaScript, Java, or C++. Hence it's much easier to learn, especially if one already is used to one of those languages. Probably it's also easier for code maintenance. XSLT has its roots more in the LISP world and is a "functional" language (if you believe Michael Kay, one of the founders of XSLT). It is especially strong if you have to process large groups of structured information. With a few lines of code you can do transformations such as grouping and reordering, for which you would need a whole bunch of multi-line subroutines in other languages.

- connecting to remote sites to grab data

Can be done with a combination of XSLT and server-side JavaScript also, have a look at the FMSA CWP manual, p. 77-78

- multiple data sources support

True, here PHP shows its strengths, XSLT needs an XML source (at least ONE tag, the rest can be some type of garbage).

- very complex text transformations using the Regular Expression engine

RegEx is not always the best solution. I know examples where RegEx fails and XSLT shines, especially if one has to match irregular multiline patterns.

- file uploading and image manipulation

Agreed. Can not be done in XSLT (without e.g. Java).

- dynamic PDF generation

XSL-FO.

- dynamic Excel worksheet generation WITH formatting (column widths, colors, text formats)

XSLT can shine here as well by producing the required Excel XML.

PHP is especially strong because there is

- a large function set

- a wealth of available programming libraries for doing all type of stuff. You don't need to reinvent the wheel

- a huge user and programmer base

- a lot of literature about PHP (and some about PHP with FM)

- huge support (including Stephen's excellent one)

- excellent code development environments

With FMSA, you get out of the box a secure CWP solution based on XML/XSLT with a basic required set of reasonable web functionality (queries, results transformation, loading of additional documents, sessions, session variables, cookies, RegEx, date and time functions, HTTP header manipulation, e-mailing). PHP can do that as well, and then goes much farther with all its additional functions and libraries. However, I have the slight impression, that for the basic FM web functionality, more code is required with PHP than with XSLT to achieve the same result (probably this does not matter at the end).

IMO, XSLT is a little underestimated because the W3C specification is very difficult to understand (it's like an axiomatic declaration ...). In addition, XSLT must be understood in connection with XPath, which has a lot of functions (e.g. string processing as Stephen mentioned).

Edited by Guest

This topic is 6610 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.