xsl-list
[Top] [All Lists]

RE: XSL Error

2003-03-10 14:51:18
From: Jack Cane [mailto:jwcane(_at_)enw-ltd(_dot_)com]
Sent: Monday, March 10, 2003 1:47 PM
Subject: RE: [xsl] XSL Error

All of my elements have the apply-templates statement, as in 
the following:

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

I do not quite understand where the apply-templates statement 
should be
placed.

You may not be specifying the correct context node in which your templates
will match other nodes to process.

In your example above, you use xsl:apply-templates without supplying a
context node, so the XSLT processor will select templates that match child
nodes of SubSection.

But in your original message you wrote <xsl:apply-templates
select="ssHdr"/>, so only templates which match ssHdr (plus any children you
specify) will be selected.  So if ChapHdg is a child of ssHdr, you would
change your matching template to:

<xsl:template match="ssHdr/ChapHdg">
  <!-- do stuff -->
</xsl:template>

This is pretty basic XSLT/XPath--I recommend checking out the FAQ
(http://www.dpawson.co.uk/xsl/sect2/applytemplates.html and
http://www.dpawson.co.uk/xsl/sect2/N7654.html).

Also, please confirm that the .css reference is in the right 
place. I want
my .css to apply to all pages (about 30) of this document.

Not an XSLT question, but its placement appears OK.  Be mindful that you're
directly trying to reference a document on your filesystem--which may not
work when viewed in a browser.

hth,
b.

| brian martinez                              
brian(_dot_)martinez(_at_)trip(_dot_)com |
| lead gui programmer                                    303.708.7248 |
| trip network, inc.                                 fax 303.790.9350 |
| 6436 s. racine cir.                             englewood, co 80111 |
| http://www.cheaptickets.com/                   http://www.trip.com/ |

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



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