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

Re: Nodes get new IDs in function?

Subject: Re: Nodes get new IDs in function?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 09 Apr 2010 01:37:50 +0100
Re:  Nodes get new IDs in function?
On 09/04/2010 01:15, Martynas Jusevicius wrote:
<xsl:function name="o2e:parent-heading" as="element()*">
     <xsl:param name="heading" as="element()"/>
     <xsl:copy-of select="$heading/preceding-sibling::h:*[self::h:h1 or
self::h:h2 or self::h:h3 or self::h:h4 or self::h:h5 or
self::h:h6][o2e:heading-level(.)&lt;
o2e:heading-level($heading)][1]"/>
</xsl:function>

The problem is, it seems that nodes returned from the parent-heading()
function get different IDs than identical nodes in the source
document. Is this the specified behavior, i.e. functions construct new
nodes, which get new IDs?

Not all functions but your function does.
You use xsl:copy-of, which as it's name implies returns a copy of what it selects, not the original. use xsl:sequence if you want to return the nodes selected rather than newly generated copies.


David

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.