xsl-list
[Top] [All Lists]

Re: [xsl] Nodes get new IDs in function?

2010-04-08 19:38:08
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>