apply-templates select question

Subject: apply-templates select question
From: "Hunter, David" <dhunter@xxxxxxxxxxxx>
Date: Tue, 15 Jun 1999 11:14:12 -0400
I have a [hopefully] simple question, regarding the apply-templates element.
Consider the following snippet of XML, and the XSL after it:


    <ID Description="c">1256</ID>
    <ID Description="A">1892</ID>


<xsl:stylesheet xmlns:xsl="";>
      <xsl:apply-templates select="@* | * | text()"/>

  <xsl:template match="/TheRestOfTheDocument/Features">
      <xsl:apply-templates select="Count"/>
      <xsl:apply-templates select="ID" order-by="+@Description"/>

As you can see, what I want to do is sort the "ID" elements by their
"Description" attribute.  However, I also need to include that "Count"
attribute, so I need a separate apply-templates just for it.

My question is, can I create an apply-templates that will copy everything
EXCEPT the "ID" attributes?  So instead of 

<xsl:apply-templates select="Count"/>

I want something similar to

<xsl:apply-templates select="not(ID)"/>

(which, obviously, doesn't work.  At least, not with the IE5 XSL processor.)

The reason for this is that I'm sorting various sections of a very large
document, with a lot of similar scenarios, except that some of them might be
set up more like this:

	<ID Description="c">1</ID>
	<ID Description="A">2</ID>

and I don't want to have to do a separate apply-templates for each

As I mentioned, I'm using the IE5 XSL processor, if it makes a difference.
Following are some of the misguided syntaxes I tried to use, none of which

select="[* && not(ID)]"
select="[* $and$ not(ID)]"

Thanks in advance for any light you can shed.

David Hunter
MediaServ Information Architects

 XSL-List info and archive:

Current Thread