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

Re: XPath discovery tool?

Subject: Re: XPath discovery tool?
From: Liam R E Quin <liam@xxxxxx>
Date: Sun, 25 Apr 2010 13:03:32 -0400
Re:  XPath discovery tool?
On Sat, 2010-04-24 at 20:09 -0400, cknell@xxxxxxxxxx wrote:
> I have a number of XML-formatted Excel workbooks from which I wish to
> extract data. While the procedure for determining the XPath to any
> particular cell's value is not difficult, it is tedious. Does anyone
> know of a tool into which I could load the XML file, select an
> element, and automatically display the XPath to that element?

Several others have given answers - most XML editors can do this, or
you can use XSLT for example.

You might also want to see if your spreadsheet has a facility to give
a name to a specific cell, to get a simpler or more predictable
expression. or see what "insert comment" does to the XML file, or
temporarily put specific data in the cell, to see where it comes out
with one or other of the stylesheets that were just posted.

If you are fetching the values of _all_ the table cells, however (and
this is really why I'm writing) consider using apply-templates instead
of value-of, and you may not need the XPath expressions.

I often see XSLT with just one template for / and then lots of XPath
expressions used to find sub-elements - in many cases, rewriting to
use apply-templates leads to a much clearer and shorter stylesheet.

This may or may not work for your case, of course.

Best,

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org

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.