Re: [xsl] Axis specifers

Subject: Re: [xsl] Axis specifers
From: xslt.new <xslt.new@xxxxxxxxx>
Date: Tue, 16 Jan 2007 10:25:19 -0600
you say
.> If a 'note' element appeared immediately after the list element,
but your example input didn't have a note after the list element, and
your posted code only appeared to be looking at child elements of list,
not following siblings.

My bad. What I meant was if there was a note element immediately following another note element like this:

<list>
<note>
<note>
<text>
</list>

I want both the note elements to appear above the text element. Right
now, with my code, the second NOTE element overlaps with the number 1.

On 1/16/07, David Carlisle <davidc@xxxxxxxxx> wrote:

This is the reason for the statement " <xsl:if test="child::note"> <xsl:apply-templates select="note" mode="list"/> </xsl:if>"

Michael's point was that teh xsl:if there is doing nothing, those lines
are equivalent to
 <xsl:apply-templates select="note" mode="list"/>

as in both cases, if there is a note, templates are applied, and if
there is not a note, templates are not applied.

Your example


<list> <note><para>This is the first note.</para></note> <note><para>This is the second note. </para></note> <text><para>This is some text. </para></text> <note><para>This note is after the text. </para></note> </list>

  So, only if the <note> element appeared before the text, it will have
  to be displayed before the text element like this:

  NOTE: This is the first note.
  NOTE: This is the second note.
  1. This is some text.

doesn't seem to involve any rearrangement at all and just needs
something like

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

<xsl:template match="note">
<block>NOTE:
<xsl:apply-templates/>
</block>
</xsl:template>

<xsl:template match="text">
<block><xsl:number/>.
<xsl:apply-templates/>
</block>
</xsl:template>

you say
.> If a 'note' element appeared immediately after the list element,
but your example input didn't have a note after the list element, and
your posted code only appeared to be looking at child elements of list,
not following siblings.

David

Current Thread