|
[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
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








