W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2013

[Bug 20639] XPath provides insufficient "glue" (modularity)

From: <bugzilla@jessica.w3.org>
Date: Fri, 11 Jan 2013 19:07:36 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-20639-523-OROcaWyqyB@http.www.w3.org/Bugs/Public/>

--- Comment #15 from dnovatchev@gmail.com ---
(In reply to comment #12)
> >I believe that this language would be lighter and much simpler.
> The paradox is that people love XPath for its lightness and simplicity, and
> those who love it the most want to add things to it that will make it
> heavier and more complex.
> Every feature that's in XQuery but not in XPath is a candidate for adding to
> XPath. Some such features (e.g. let expressions) have found their way in. If
> we add all such features, we have destroyed XPath. If we are to add only a
> few of the features, then we need a very strong view of the role of XPath
> and how it differs from the role of XQuery, to enable us to decide what goes
> in and what stays out. The view stated in the specification serves this
> purpose well: XPath is designed to provide XML navigation capability to
> augment other things that can be provided (better) by a host language. If we
> lose that focus, we lose XPath.

As with any new idea, some time is required in order to get accustomed and
fully understand it, so let's not draw conclusions immediately.

At present, if we have a set of useful functions written in pure XPath, and we
want to use these both in XSLT and in XQuery, we must:

 1. Save the XPath in one or more XSLT stylesheets.

 2. Save the XPath as one or more XQuery module files.

 3. In XSLT add an <xsl:import href="XPathFuncs.xsl"> directive.

 4. In XQuery add: import module "some namespace"
at "XPathFuncs.xq".

As time goes we make some changes to the functions -- then we must not forget
to do these changes both in XPathFuncs.xsl and in  XPathFuncs.xq. This is both
time consuming and, more importantly, error-prone. As result often we will have
the xsl and xq files out of sync. 

Providing modularity in XPath completely eliminates this problem and makes both
XSLT and XQuery more attractive to use.

For function library developers writing the functions in pure XPath saves
significant time and effort and completely eliminates the synchronization
problems between an XSLT version and an XQuery version. The time saved could be
used for doing more work and extending the coverage and quality of the library.

All these benefits directly translate into cost savings and profit.

You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 11 January 2013 19:07:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:41 UTC