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

Re: Simple XPath question


lisp xpath
> (did you mean to take this off list)

No, I didn't. I should have pushed 'Reply to all'.

Thanks for your patient explanations.

I just found some good introductory text online which explains
everything I need to know about XPath, but I haven't actually opened
up the tools, because I don't have a concrete application which
involves DOM.

I may need XPath for XSLT.

I'm a native Lisp programmer. I suppose, if there were a Lisp binding
for DOM, we'd be talking 'cons' cells.

1) DOM builds a list of nodes from a source document (note that "list"
is defined recursively, so it means "tree")

2) There must be a way to iterate through the list (I'm still not
familiar with the programming languages supporting DOM, like
Javascript and Java, but I have programmed alot in C/C++. I see there
is a very thorough API for C. It looks like a bear. Maybe Java is
easier!)

3) The result of evaluating an XPath expression would be a subtree, a
"sub DOM" (I hope), a "sub-document", another list, which could, in
turn, be traversed. [Or perhaps the root of the DOM object is all that
distinguishes a list from a sublist.]

4) The tree structure of a XML/DOM document is similar to, but much
more flexible than the Unix file system, where names must be unique
within a directory, so you're going to get multi-valued results
(lists) for an XPath expression evaluation (which can be iterated
through using the same DOM interfaces, whatever they are).

5) DOM would have a way to insert and delete nodes, compare trees,
just like Lisp.

6) The DOM object which results from an XSL transform would be
serialized in a suitable text format, like XML, but could be anything,
maybe even an mp3 playlist.

7) Of course, there would be DOM parsers to scan the XML document.

It's starting to make sense, thanks.

Joe

PS

I'm still not sure how all this technology fits together, but XLink
looks like a general purpose linking language. XPointer must refer to
XML document names.

XPath refers to DOM document names.

Am I confusing the notion of an XML document, which generally refers
to the file that holds the markup, with a DOM object, which refers to
a named structure which permits an XML "document" to be automatically
processed by a computer program?

XML documents have the more intuitive meaning, the one used by HTML
documents: things referrred to by a URL. I imagine the definition of a
URL has been extended to allow references to pieces of an XML document
(not a DOM object)....

[Sorry, I'm just thinking out loud]

Bye.

Joe


On 8/8/05, David Carlisle <davidc@n...> wrote:
> 
> (did you mean to take this off list)
> 
> > 1) space is not significant so [] must group the terms
> 
> No. [] isn't grouping terms (xpath uses () for that) square brackets apply
> a filter. A selects all A elements A[foo] selects all A such that foo is
> true.
> 
> > 2) '.' looks like a wildcard
> 
> No. It selects the current node.
> 
> > 3) '//, /@'    It looks like / and @ would be enough
> 
> // means something different than / so changing // to / would be legal
> but select very different nodes.
> 
> 
> > For each '.' i.e. child in A
> . does not mean child it means self (that is, A here)
> 
> > I was just wondering where you would use an expression like this,
> It is just a typical xpath expression, so you can use it wherever you
> use xpath. Originally in xslt but many other languages and dom
> implementations have xpath api these days.
> 
> David
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
>

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.