[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Apply-templates

Subject: Apply-templates
From: Thomas Karlsen <ThomasK@xxxxxxxxxxxxxxx>
Date: Thu, 16 Dec 1999 10:18:54 +0100
membership id template
I have a question
Is it possible, when you apply-templates, to decide that it should apply
from position()=3 and out the siblings.

XML:
<section>
 <item>I am item number 1</item>
 <item>I am item number 2</item>
 <item>I am item number 3</item>
 <item>I am item number 4</item>
</section>

XSL:
<xsl:template match="section">
 <xsl:apply-templates select="following-sibling::item[position() = 3]
</xsl:template>

<xsl:template match="item">
 <xsl:value-of select="."/><br/>
</xsl:template>

So the output should be:
I am item number 3<br/>I am item number 4<br/>

I dont get this to work?

__ Thomas Karlsen | System Developer
__ Cell Network ASA | New Media Science | Sørkedalsveien 10A, N-0304 Oslo,
Norway
    Tel: +47 23196600 | Fax: +47 23196601 | Mob: +47 91514293


> -----Original Message-----
> From: Kay Michael [mailto:Michael.Kay@xxxxxxx]
> Sent: 15. desember 1999 14:58
> To: 'xsl-list@xxxxxxxxxxxxxxxx'
> Subject: RE: what are node set fragments and why are they ruining my
> life?
> 
> 
> >then I get the bizarre result [from Saxon] - 
> 
> >member local-name=member, id=1
> >member local-name=member, id=2
> >member local-name=RESULT-TREE-FRAGMENT, id=
> >member 1member 2
> 
> > - which looks like a new bug to me. 
> 
> Bizarre perhaps, but not a bug. sxf:node-set is documented to 
> work this way.
> As well as putting the dummy root node in as a parent for the 
> user-written
> nodes, it also wraps a dummy element around them, to make the 
> fragment a
> well-formed document. This was basically done for code reuse 
> reasons, and
> because at the time it was written the implementation of result tree
> fragments was not exposed to the application.
> 
> This will change in the next version to work the same as xt.
> 
> I'm hitting a few other problems in the area of output XML 
> not needing to be
> a well-formed document, e.g. when calling a DocumentHandler 
> to process the
> output, or when chaining it into another stylesheet. (The 
> contract with a
> SAX DocumentHandler of course says that the sequence of 
> events will always
> be well-formed). It's an area where the spec seems a bit 
> vague, e.g. it
> seems perfectly possible to output
> 
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <element1/>
> <element2/>
> 
> which is neither a well-formed document nor a well-formed 
> external entity.
> 
> 
> Mike Kay
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.