xsl-list
[Top] [All Lists]

XSL: query part of string to return element

2002-09-24 08:17:32
Hi. I am using XMLSPY (with Microsoft parser) to edit an existing stylesheet (XSL) that references several XMLs.

Essentially, I have a 'parent' element with sub-elements. I want to query a particular sub-element (which is a text string). As long as the text string BEGINS with a certain word, I would like for the parent element to be selected.

For example, the following code will select the parent element "attrlabl" when its sub-element "attrdef" has a value of "Navy."
        <xsl:when test="attrdef[. = Navy]">
       <xsl:value-of select="attrlabl"/>

This is similar to what I need - except the sub-element "attrdef" can have any number of words following "Navy." I have tried including wildcard symbols, and a number of other commands that do not seem to agree with the preexisting code.

For right or wrong, I am a novice, I have tried xsl:key, starts-with(),
context() . . . all to no avail.

Is it even possible to do this in XSL?

Thanks,
Carrie

G/I/S, Inc.
ckaufman01(_at_)hotmail(_dot_)com


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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



<Prev in Thread] Current Thread [Next in Thread>