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

Re: Ranking Random Nodes from Top to Bottom

Subject: Re: Ranking Random Nodes from Top to Bottom
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 17 Aug 2007 15:30:47 +0200
Re:  Ranking Random Nodes from Top to Bottom
J. Zhang wrote:

I was thinking of the determining the string length from root to a particular node, and store that as output in the output file using XSLT. Then post-process it in Python to rank the paths into document order, where the lowest number appears on top and the highest number at the bottom. Does that make any sense?

an example would help a great deal here. You've talked of unstructured text in your first post, now I understand that it is actually about real nodes. It seems to me that you have strings of XPaths and that for some reason (why?) you want to show them to the user in the order equal to what the XPaths would select from the (a?) document. If so, what about an XPath that selects multiple nodes?


To know whether one node is before the other, you can use the preceding:: axis (but this is an expensive operation). But you'll first have to write an XPath parser in XSLT if you want the xpaths to be given as strings. If you can (or want to) rely on extensions, you can use saxon:evaluate() when you run your stylesheets with Saxon.


Cheers, -- Abel Braaksma

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.