Re: [xsl] Stumped on why a field isn't showing up

Subject: Re: [xsl] Stumped on why a field isn't showing up
From: Deirdre Saoirse Moen <deirdre@xxxxxxxxxxx>
Date: Sun, 13 Jun 2004 10:45:31 -0700
On Jun 13, 2004, at 5:19 AM, M. David Peterson wrote:

Thanks to both you and J.Pietschmann for providing answers. In the sake of efficiency, I'm replying to only one.

The first thing I notice in your stylesheet is the fact that you are
selecting "novel/chapter" for your first apply-templates.  According to
your sample XML there is no novel/chapter.  There is a text node
"&ch01;" that looks like it could at one point been a representation of
something but I'm just making a guess.

Actually, there is a novel/chapter -- it's in the included file referenced by &ch01;

It is using "chapter" as the context of continuing the recursion process
of apply-templates. Since "author" and "address" are child elements of
"novel" and not "chapter" the apply-templates process being invoked
doesn’t find any child elements following the chapter path and stop's
the processing for that element.


Initially, the address and author were on a title page, where there was no chapter scope. So that's what I wasn't getting. Since this is literally day three with XSL (swapping in and out with everything else I'm working on), I'm still struggling to understand everything.

There are two ways to fix this:

1) Add a root ("/") reference to the beginning of your apply-templates
for the "author" and "address". So, turn this:

That's the easy fix, which I'll use for now. Anything else seems to require more restructuring than I can do now. For one thing, I'm using something that's really not intended for this kind of a document at all, but rather for the body of a novel.

The one other thing I should point out is the fact that you have an
extra </xsl:apply-templates> in your second template.

Huh. I didn't see any with a closing tag, just a bad indent.

I hope this helps you get a little closer to where you want to be!  And
don’t hesitate to ask further questions if the need arises.

Thanks very much for both of your help.

Obviously, I have a lot more to learn, but I did need to get the silly synopsis into the mail. :)

"Cannot run out of time. There is infinite time. You are finite. Zathras is finite. wrong tool." -- Zathras

Current Thread