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

Re: targeting the last element in a node or consecutiv

Subject: Re: targeting the last element in a node or consecutive elements
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 04 Jan 2007 15:51:47 +0100
Re:  targeting the last element in a node or consecutiv
Hi Emily,

This is a double post, you already opened this discussion under "suppressing only the last PI" (which differed in details, however).

If I may, it appears that you want to do this:

<somenode>
   <node1 />
   <?instr1?>
   <node2 />
   <?instr2?>
   <?instr3?>
</somenode>

1. Process node1, instr1, node2 etc
2. Do something before instr2 and instr3 (being consecutively and together at the end of a node)
3. Process instr2 and instr3
(if instr2 and instr3 were not there, you want to skip processing step 2 and 3?)


Am i right? Please confirm (and/or give your sample input, to make the subject easier)

Cheers,
-- Abel

Emily.Garrett@xxxxxxxxxxx wrote:
I'm trying to use xsl:apply templates to grab the entire content of a
node, except for any PIs that may be at the very end of the node.  I can
see how position()=last() can be used to refer to the very last PI, but
how would I refer to possibly 2 or 3 PIs that are at the end of the node
(not knowing what they are or how many), but still process PIs that are
contained elsewhere in this content?   Is there some syntax that refers
to consecutive elements or refers to an element that is the last one in
a node, not knowing what element it is?

Here is explanation for what I'm trying to do:

Process all content, unless they are PIs that occur consecutively at the
very end of the node.

Then I have to insert an element, then process these PIs that occur
consecutively at the very end of the node.

I'm having trouble narrowing down my research on this one.  Does anyone
have any ideas?

Thanks,
Emily

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.