ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408
Rep:
xquery or XSLT?
Hi,
I used used to embed html tags inside my php code for developing my website. This approach was the worst possible way of organizing data in a website, so I decided to organize everything using xml so that I can separate presentation from the PHP part. I did a quick research and found out that there are two ways of doing that using XSLT and xquery. I found out that xquery can do anything that XSLT can, but I also found that xquery is not enabled in php-5.2.3.
Basically, I'm having doubt regarding which technology to select so that I can expand the website in future easier.
Right now, website is very small, but this time I'm going to design it in a very well formed structure regardless of if it will grow in future.
I would appreciate your suggestions about what technology to use.
XSLT is much better suited to formatting XML to HTML output, Xquery is more a
akin to using something like SQL plus, i.e. a query language to mine data.
there are not very many Xquery (open-source) tools out there, the only one I could find was Saxon. It's still very much in it's early stages of take-up.
typically, you use Xquery to filter out the parts of the data you need and then
use XSL to tidy them up.
i.e. I use BOTH.
I wouldn't personally choose to use it for non-trivial stuff, Xquery itself is hopelessly
expensive to run as the documents get larger. Then you get
java.lang.outofmemory errors and you are completely stuffed.
I'm not a fan of XML myself having worked with it for a while.
for instance, we used to have Oracle, and I wrote a price server, where you squirteed price codes to a socket and got the values back, nice and efficient.
now we use XML SOAP requests from an outside contractor, very fahionable.
Now each price must be wrapped in a SOAP envelope and sent individually, so we transfer
about 700 bytes to get a few bytes back.
we have to do that for each price! ridiculous.
but my way is old fashioned!
Last edited by bigearsbilly; 12-17-2007 at 04:54 AM.
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408
Original Poster
Rep:
Thanks for responding.
Basically, I didn't find much tools for xquery, either. Since my ubuntu machine and my website server machine both support xslt, I'm working on xslt to transfer my xml files to html.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.