xsl-list
[Top] [All Lists]

Re: [xsl] Axis specifers

2007-01-16 09:25:41
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(_at_)nag(_dot_)co(_dot_)uk> 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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--