By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,714 Members | 1,208 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,714 IT Pros & Developers. It's quick & easy.

Xquery instead of xslt

P: n/a
I am working to ease updating of a html page by transforming 2 xml files. I
was going to use xslt for this and had bought 2 unopened books, wrox xslt
and o'reilly's xslt cookbook. But am now wondering if I am better of
learning XQuery instead?

Any thought and opinions would be appreciated.

Cheers - Tom.

The Architect: "Hope, it is the quintessential human delusion,
simultaneously the source of your greatest strength, and your greatest
weakness" The Matrix Reloaded (2003)

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Please see the following from :
http://www.ibiblio.org/xml/slides/sd...xslt2/109.html

=========
What's the difference between XQuery and XSLT?
XSLT is document-driven; XQuery is program driven

XSLT is functional; XQuery is imperative

XSLT is written in XML; XQuery is not

An assertion (unproven): XSLT 2.0 can do everything XQuery can do

=============

I guess for transforming xml to html, xsl would be a better tool.

All the best.

"Tom Corcoran" <to*****************@nospam.btinternet.com> wrote in message
news:bk**********@titan.btinternet.com...
I am working to ease updating of a html page by transforming 2 xml files. I was going to use xslt for this and had bought 2 unopened books, wrox xslt
and o'reilly's xslt cookbook. But am now wondering if I am better of
learning XQuery instead?

Any thought and opinions would be appreciated.

Cheers - Tom.

The Architect: "Hope, it is the quintessential human delusion,
simultaneously the source of your greatest strength, and your greatest
weakness" The Matrix Reloaded (2003)

Jul 20 '05 #2

P: n/a
XSLT is functional; XQuery is imperative Wrong. XML Query is a functional language, like XSLT.
A more correct assertion would be:
XSLT is declarative, XQuery is imperative
XSLT is written in XML; XQuery is not For a human programmer, a non-XML syntax is an advantage IMHO.
Anyway there was and there will be again a XML syntax for XML Query.
An assertion (unproven): XSLT 2.0 can do everything XQuery can do It is almost true, but XQ has a more flexible processing model: you can
build intermediary trees, and work on these trees in the same way as
on input documents.
Conversely, XQ lacks of the template/apply-templates mechanism of XSLT.
It can however be emulated by functions and 'typeswitch'.

So Apart from the syntax, XML Query and XSLT2 are quite
close to each other. They could even be unified in one language.

* XQuery is not yet a stable recommendation. For production
projects it is not advisable to use it.

* Usable up to date open-source implementations:
- Michael Kay's Saxon 7 (http://saxon.sf.net):
XML Query and XSLT 2 (almost complete)
- Qizx/open (http://www.xfra.net/qizxopen/):
XML Query only
strajan wrote: Please see the following from :
http://www.ibiblio.org/xml/slides/sd...xslt2/109.html

=========
What's the difference between XQuery and XSLT?
XSLT is document-driven; XQuery is program driven

XSLT is functional; XQuery is imperative

XSLT is written in XML; XQuery is not

An assertion (unproven): XSLT 2.0 can do everything XQuery can do

=============

I guess for transforming xml to html, xsl would be a better tool.

All the best.

"Tom Corcoran" <to*****************@nospam.btinternet.com> wrote in message
news:bk**********@titan.btinternet.com...
I am working to ease updating of a html page by transforming 2 xml files.


I
was going to use xslt for this and had bought 2 unopened books, wrox xslt
and o'reilly's xslt cookbook. But am now wondering if I am better of
learning XQuery instead?

Any thought and opinions would be appreciated.

Cheers - Tom.

The Architect: "Hope, it is the quintessential human delusion,
simultaneously the source of your greatest strength, and your greatest
weakness" The Matrix Reloaded (2003)



Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.