[xquery-talk] Comparing XQuery to XSLT

Per Bothner per at bothner.com
Tue Aug 19 11:42:17 PDT 2003


rick schochler wrote:

> interesting...I was just taking a look at your photo
> album and will take a look at your article.
> 
> So, I suppose the next question is, given that you
> could do the exact same thing using xslt, do you have
> a preference?

An earlier version did use XSLT, and worked ok, though it
had fewer features.  I definitely prefer XSLT - and my
article partly explains why.

I've thought you could have the best of both with a "minor"
XQuery extension to handle patterns:  Extend SequenceType
to allow:
   "match" <pattern>
where <pattern> matches the XSLT definition of pattern.
Then a set of XSLT template rules can map directly into
a typeswitch:

typeswitch ($dot) {
case match chapter/title return process-chapter-title($dot)
case metch title return process-other-title($dot)
}
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/




More information about the talk mailing list