Re: AW: [xsl] unsuspected output

Subject: Re: AW: [xsl] unsuspected output
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 01 Mar 2004 10:16:52 -0500
At 2004-03-01 15:12 +0100, Nikolas Nehmer wrote:
The problem is that the node comes from a list of hrefs to unknown xml
files. So I have to push the root element of that file which I do by
select="document($file)/*" !

Fine ... so you've pushed the document element with that instruction.


I just want to suppress the given behavior
for the case that an element will not match my template rules (so there
should not be displayed anything).

You are asking for:


<xsl:template match="*"/>

But ... I'm not sure that will help you. If the document element isn't what you are looking for, then you will get nothing at all, not just skipping the elements that you don't recognize.

If you want to go through the entire other document going through every element looking for something that you need, then use the following:

  <xsl:template match="*">
    <xsl:apply-templates select="*"/>
  </xsl:template>

That way you will, for any element you don't look for, only process all of its child elements (and not child text nodes). Any element that you push for which you do have an explicit template rule will trigger that rule instead of this rule.

I hope this helps!

........................ Ken

--
US XSL training: Washington,DC March 15; San Francisco,CA March 22
World-wide on-site corporate, government & user group XML training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc


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



Current Thread