RE: [xsl] Axis specifers

Subject: RE: [xsl] Axis specifers
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 16 Jan 2007 16:30:09 -0000
> > Every note in your input has a parent::list so I don't 
> understand why 
> > you are testing this.
> >
> > The way a note is rendered doesn't depend on its position, 
> so I don't 
> > understand why you are testing this either.
> 
> The intention behind this was this. If a 'note' element 
> appeared immediately after the list element, then I needed to 
> display it before the text element. A note element can appear 
> anywhere inside the list element like this for 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>

Then I don't think you understand what "parent" means. All the note elements
in this example are children of the list element: parent::list will return
true for each of them.
> 
> So, only if the <note> element appeared before the text, it 
> will have to be displayed before the text element ...
> If the note element appeared after text, then it is displayed 
> after the text. 

The normal process in XSLT is when you are positioned on a node, to process
its children in document order by calling <xsl:apply-templates/>. This seems
to be exactly what you need to do. You're finding problems where there
aren't any.

Michael Kay
http://www.saxonica.com/

Current Thread