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

RE: Sorting attributes with XSL - Is there a way to "grep" a

Subject: RE: Sorting attributes with XSL - Is there a way to "grep" and match on partial attribute string value?
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Wed, 22 Sep 1999 17:43:53 -0600
grep exact match
> I want to match attribute string value for 
> HL71A/MSH/PID/@Name NOT as exact match as follows:
> 
> <xsl:apply-templates select="HL7A1/MSH/PID[@Name = 
> 'Donneley^Floyd']" order-by = "+@Name" />
> 
> Instead, what I want to do is sort @Name and match for all 
> @Name attribute values where @Name starts with D or d (or any 
> other letter) and would retrieve all attribute values which 
> start with D or and then populate the table.

You seem to be using the syntax for the IE5 implementation of the December
working draft, so the answer is no, because you don't have access to
substrings and thus can't test the first letter of the Name attributes
(unless there is some JScript/DOM trick someone can elaborate on).


Using the current XSLT and XPath syntax, it should be something like this:

<xsl:apply-templates select="HL7A1/MSH/PID[starts-with(@Name,'D') or
starts-with(@Name,'d')]">
    <xsl:sort select="@Name"/>
</xsl:apply-templates>


...which means:

"Apply the templates that match the following set of nodes:
  PID elements that are:
    (children of MSH elements that are
      children of HL7A1 elements that are
        children of the current node),
  and that have:
    (a Name attribute that starts with 'D' or
     a Name attribute that starts with 'd').

 Instead of looking at this set of nodes in document order,
 look at the set in ascending order according to the string
 value of the Name attribute of each node."


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.