LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   xquery or XSLT? (https://www.linuxquestions.org/questions/programming-9/xquery-or-xslt-607031/)

mohtasham1983 12-15-2007 04:49 PM

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.

Thanks in advance.

bigearsbilly 12-17-2007 04:52 AM

what are you trying to do?

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!

mohtasham1983 12-17-2007 05:47 AM

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.

bigearsbilly 12-17-2007 06:06 AM

yes, well I don't think Xquery is even properly standardised yet.
oracle do an open source XML database that may be worth looking into.

and remember if you plan serious data crunching it's very very expensive.

I like it, it's quite fun but personally I would never use it for serious work.


All times are GMT -5. The time now is 01:25 PM.