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

RE: Stepping through XPath in a visual XPath debugger

Subject: RE: Stepping through XPath in a visual XPath debugger
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 31 Jul 2007 15:33:23 -0400
RE:  Stepping through XPath in a visual XPath debugger
Hi,

At 01:08 PM 7/31/2007, Mike wrote:
> a) What is the most intuitive order in which to step-through
> an XPath 1.0 expression visually?

I really don't know the answer to this, but I think anything that presents a
view of the evaluation as a sequential process is misleading and likely to
be unhelpful. The concept should be to select parts of the expression and
understand what contribution they make to the result - for example, being
able to see which nodes a particular predicate is applied to, and which of
them match.

While admitting, in sympathy with this caution, that it is an academic exercise to view the evaluation of an XPath expression sequentially, it might be helpful to see how we've learned to teach neophytes to interpret XPath 1.0 location paths:


1. The concept of a step, each step being evaluated from the context of the previous step
2. Anatomy of a step:
2a Axis (required)
2b Node test (required)
2c Predicate(s) (optional)
3. Axes in detail
4. Node tests in detail
5. Predicates (as filters of sets of nodes)
6. Abbreviations (or, short vs long syntax)


It is of particular interest that XPath abbreviations sometimes have the effect of obscuring exactly what the axis and node tests are in a particular step. Accordingly, when we teach this subject at Mulberry, we lay some stress (how much depends on the class) on the long syntax, as it indicates explicitly just what is happening.

So I should think that a nice visualization of XPath would do, at least, the following:

1. Translate from short (abbreviated) syntax into long syntax
2. Discriminate between the steps in a path
3. Optionally, discriminate between the parts of each step
4. Show which nodes were selected in each step (perhaps identified in relation to the step's context)


Note that there have already been some worthy visualization tools for XPath, but nothing is a substitute for a concrete, meaningful example. While being able to visualize it generally is useful, it really clicks into place when students can see *why* particular XPaths are used in particular situations. This helps to dramatize which sorts of things matter (context nodes) and which ones don't (short or long syntax).

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread

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
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.