I think what you're describing is multiple templates in the XSLT. That's the one trick I have not tried yet, but probably will when I get time.
cmarshall, OOPS! I was tired.
Anyway, what complicates the problem is that the XML also has the states listed. In <companyname>, is the name of the state and in <state> is the abbreviation, and the <state> has an option, either 1 or 2. The XSL contains two <if> statements, to the effect:
<xsl:if test="state[@option = '2']"> it makes the <companyname>, hence the state's name, a bookmark on the output.
<xsl:if test="state[@option = '1']"> it makes the <companyname> a link. I tried using a <choose> for this, but the results were the same.
I think there ought to be a <sort> tag with a "then" function, kind of like:
<xsl:sort test="state 'then' companyname"/> (or some symbol for 'then', say an 'x' or '+'. But that would make it too easy :)
I'll keep trying and let all of you know if I get it to work. Thanks for your help.
I should add that the problem boils down to this:
If a company whose name begins with an "L" is located in Nevada (NV), then the output looks like this when I add the sort by companyname:
Company L in NV
Company M in NV
Company S in NV
and so on.
The problem is to get the state's name first regardless of the company names. Make sense?
[edited by: Marshall at 5:49 am (utc) on July 9, 2007]