[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML-aware programming language?


Re:  XML-aware programming language?
On Thu, 2 Dec 2004 23:41:18 -0000, Michael Kay <mike@s...> wrote:

> 
> 14 lines of code (twice as much), and less scope for reuse. No great
> difference in the conceptual difficulty - both require an understanding of
> recursion - but I think XSLT emerges here as the winner. (And remember this
> is only XSLT 1.0).

Arguably the point is not to minimize the lines of code it takes to do
something  (remember APL anyone? ), but to maximize the clarity of the
code. I strongly suspect (and will stake the alcoholic beverage of
your choice the next time we meet if I can be persuaded that I'm wrong
<grin>) that if one gave the two fragments to randomly chosen software
developers who have some familiarity with XML, almost NOBODY who had
not worked with XSLT before would have a clue what it does, but almost
EVERYBODY who had some programming experience and knew enough about
XML to guess that '@secret' referred to an attribute would be able to
figure out what the XQuery fragment does.

That begs the question of whether that is simply a lack of education
that should be rectified or a fundamental problem limiting the
popularity of XSLT, of course.   Thinking back to the thread a couple
of weeks ago, it's not just a matter of people needing to understand
recursion.  As you note, BOTH are recursive.  It's a matter of getting
used to the fundamental XSLT design pattern of  applying templates to
get work done.

>
> But in fact there's a bigger issue - the XQuery code is wrong. It loses the
> namespaces from the source document. Perhaps I'm missing something, but I
> can't see any way to solve this. XQuery may be computationally complete, but
> it's not actually closed over the data model - there is no way of generating
> a namespace dynamically. 

That is just bizzarre to me.  (I hope you're missing something but I
have no clue what it might be)  Where does XSLT get namespace mojo
that XQuery doesn't have?  Since XSLT and XQuery are based on the same
data model, and neither fragment does anything explicit to preserve
the namespace from the source document, why is it that the XQuery
fragment loses the namespaces and the XSLT doesn't?

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.