xsl-list
[Top] [All Lists]

[xsl] how to keep context when copying

2009-08-18 09:52:31
Hey All,

Is there a way of keeping the context information when you copy a
node?  Here's my use-case....

I have a document that has "refs" and "defs" and I'd like to write a
function that returns a "def"
node when you pass it a "ref".

I've got this working fine using keys to lookup the defs.  The
fdx:GetDef function basically boils
down to the following template (XSLT 2)....(it's actually a little
more complicated because depending
on the type of the "ref", it has to go lookup a different key)

<xsl:function name="fdx:GetDef">
  <xsl:param name="ref"/>
  <xsl:copy-of select="key('keyItems', $ref/@OID)"/>
</xsl:function>

My problem is that the nodes returned by this function lack ancestor
info that would be useful
in downstream processing of the node.  Is there a way that I can
rewrite the function to return
a node that allows me to get at the node's ancestors for example.

Cheers,
Andy

--~------------------------------------------------------------------
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>