xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Kelly" <ke...@ad1440.net>
Subject XSLT selection by node contents
Date Fri, 24 Mar 2000 22:50:41 GMT
Hi folks.

This isn't necessarily Xalan-related, but I figure there ought to be at
least a few people proficient in XSL and XPath who could help me out.

I want to have two different xsl:template selections based on the string
contents of the node I'm matching.  For instance, if my document is


Then I want to key off the fact that some <location> nodes start with
"iiop", and others start with something else.  (No, I'm not in a position to
rewrite the DTD and fix the input document).

I want to write XSLT that looks like:

<xsl:template match="location[starts-with(???,'iiop')]">
   Do one thing.
<xsl:template match="not(location[starts-with(???,'iiop')])">
  Do another thing

The question is ... what do I put in for ??? that selects the value of the
text node of the location node?  Or is this even the right way to proceed?


View raw message