Subject: RE: [xsl] position() test for processing boundaries From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 19 Nov 2004 15:55:53 -0500 |
Cheers, Wendell
The test is the same in both cases. The third item in .//* is the <rdg n="3"> element. The two elements before this are the <q n="1"> element and the <app n="2"> element, and you have obtained deep copies of these two elements, just as you requested.
However, this isn't going to help with your problem. Doing xsl:copy-of gives you a deep copy of all the selected nodes, and therefore xsl:copy-of select=".//*" is going to contain many duplicated nodes: each element will be copied once its own right, and once as a side-effect of copying its parent, once when copying its grandparent, and so on.
This kind of problem becomes much easier with the << and >> operators in XPath 2.0. Select the first and last nodes you want to process (say A and B), and then you can process all the required nodes using
select="$A | //*[. >> $A and . << $B] | $B"
Michael Kay http://www.saxonica.com/
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] position() test for proce, Michael Kay | Thread | RE: [xsl] position() test for proce, Ron Van den Branden |
Re: [xsl] On Sourceforge: Cool: Sax, Gunther Schadow | Date | Re: [xsl] XSLTBlog.com now live..., M. David Peterson |
Month |