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

how to sort a list of xpaths

Subject: how to sort a list of xpaths
From: Mark Hutchinson <mark@xxxxxxxxxxx>
Date: Sat, 19 Jan 2008 23:10:35 -0800
 how to sort a list of xpaths
I have an application that uses xpaths to identify which rule that
should be executed for a given tag in a source file.

eg given a source file of:
<section>
   <class type="AA">
      <entry>entry text</para>
   </class>
   <class type="BB">
      <entry type="italic">text text</para>
      <entry>text text</entry>
      <class>
         <entry>subclass entry text</entry>
      </class>
   </class>
</section>

My application might have the following rules :

  1. /section/class[@type="AA"]/entry
  2. //class
  3. /section/class[@type="BB"]/entry
  4. //entry
  5. //entry[@type="italic"]

My application searches the rules from the top down - stopping from
checking any further once a match has been found. ie the first class
(AA) matches with rule 1 and this is correct. The second class (BB)
matches with rule 2 which is, obviously, not correct.

Here's my question (finally!) - do anyone have a utility or xslt, perl
etc that can sort these rules based on a schema?

Regards
Mark H.

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.